Hi!
Here is a new version of the opensaf_scale_out example script, where I
have corrected a few warnings from the shell checker tool. Please use
this new version instead (just sending the new version of the example
script instead of a completely new review request).
thanks,
Anders Widell
On 10/02/2015 05:04 PM, Anders Widell wrote:
Summary: clm: Call plug-in script when an unconfigured node tries to join the
cluster [#1453]
Review request for Trac Ticket(s): 1453
Peer Reviewer(s): Mathi
Pull request to:
Affected branch(es): opensaf-4.7.x, default(5.0)
Development branch: default
--------------------------------
Impacted area Impact y/n
--------------------------------
Docs y
Build system n
RPM/packaging n
Configuration files y
Startup scripts n
SAF services y
OpenSAF services n
Core libraries n
Samples n
Tests n
Other n
Comments (indicate scope for each "y" above):
---------------------------------------------
changeset b65bbf23422f9bcdaa0ad7592d9a492f4dd98e92
Author: Anders Widell <[email protected]>
Date: Fri, 02 Oct 2015 16:47:47 +0200
clmd: Add support for scale-out by calling a custom script to configure
new
nodes [#1453]
The scale-out feature makes it possible to run a customizable script
when a
node which is not configured in IMM tries to join the cluster. The
intention
is that the script will check if the new node is eligible to be added
to the
cluster, and if so add the necessary IMM objects so that the node will
be
able to join the next time it tries. The script will be called with one
or
more command-line arguments, where each argument is a comma-separated
list
of properties of a node that wishes to join the cluster. Currently, the
comma-separated list in each command-line argument contains only two
entries, but the script should be forwards compatible with future
extensions
where more entries may be added to the comma-separated list. The first
entry
in the list is the node id represented as a decimal number. The second
entry
in the list is the name of the node.
NOTE: the script must be idempotent, i.e. it must be harmless to call it
more than one time with the same parameters. The second call should do
nothing since the nodes were added to the cluster the first time the
script
was called.
To enable the scale-out feature in CLM, set the variable
OPENSAF_CLUSTERAUTO_SCALE_ENABLED in nid.conf to the value 1. You must
also
customize the script $pkglibdir/opensaf_scale_out so that it adds the
IMM
objects needed necessary for the node to join the cluster.
changeset b1bad826511dd8c41f39bccbe9d3786c45465eb5
Author: Anders Widell <[email protected]>
Date: Fri, 02 Oct 2015 16:47:51 +0200
clmna: Re-try joining the cluster when CLMD returns TRY_AGAIN [#1453]
When the scale-out feature has been enabled in clmd.conf, CLMD will
reply
with the TRY_AGAIN error code instead of the ERR_NOT_EXIST error code
when a
node which is not configured tries to join the cluster. CLMNA will
re-try
joining the cluster when it receives this new error code.
Complete diffstat:
------------------
Makefile.am | 3 +-
opensaf.spec.in | 1 +
osaf/services/infrastructure/nid/config/nid.conf | 9 +++++
osaf/services/saf/clmsv/README | 29 ++++++++++++++++-
osaf/services/saf/clmsv/clms/clms_cb.h | 37 +++++++++++++++++++++-
osaf/services/saf/clmsv/clms/clms_evt.c | 252
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
osaf/services/saf/clmsv/clms/clms_main.c | 24 +++++++++++++-
osaf/services/saf/clmsv/nodeagent/cb.h | 7 +++-
osaf/services/saf/clmsv/nodeagent/evt.h | 5 ++-
osaf/services/saf/clmsv/nodeagent/main.c | 73
++++++++++++++++++++++++++++++++++++++++--
scripts/opensaf_scale_out | 53
+++++++++++++++++++++++++++++++
11 files changed, 480 insertions(+), 13 deletions(-)
Testing Commands:
-----------------
* Build OpenSAF with -DRUNASROOT (needed because sample script requires write
access to $pkgimmxmldir) and install it in UML
* Run "./build_uml generate_immxml 1" to configure the cluster with just one
node
* Set OPENSAF_CLUSTERAUTO_SCALE_ENABLED to 1 in nid.conf
* Remove the line "exit 0" in $pkgimmxmldir/opensaf_scale_out
* Add the getent command to the UML environment (needed by the immxml scripts)
* Run ./opensaf start 1
* Run ./opensaf nodestart 42 (for example). Node 42 shall now be scaled out
Testing, Expected Results:
--------------------------
When starting new nodes, they should be automatically scaled out and join the
cluster
Conditions of Submission:
-------------------------
Ack from Mathi
Arch Built Started Linux distro
-------------------------------------------
mips n n
mips64 n n
x86 y n
x86_64 y y
powerpc n n
powerpc64 n n
Reviewer Checklist:
-------------------
[Submitters: make sure that your review doesn't trigger any checkmarks!]
Your checkin has not passed review because (see checked entries):
___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.
___ You have failed to nominate the proper persons for review and push.
___ Your patches do not have proper short+long header
___ You have grammar/spelling in your header that is unacceptable.
___ You have exceeded a sensible line length in your headers/comments/text.
___ You have failed to put in a proper Trac Ticket # into your commits.
___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)
___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.
___ You have ^M present in some of your files. These have to be removed.
___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.
___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.
___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.
___ You have extraneous garbage in your review (merge commits etc)
___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.
___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.
___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.
___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.
___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)
___ Your computer have a badly configured date and time; confusing the
the threaded patch review.
___ Your changes affect IPC mechanism, and you don't present any results
for in-service upgradability test.
___ Your changes affect user manual and documentation, your patch series
do not contain the patch that updates the Doxygen manual.
------------------------------------------------------------------------------
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel
#!/bin/sh
#
# -*- OpenSAF -*-
#
# (C) Copyright 2015 The OpenSAF Foundation
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. This file and program are licensed
# under the GNU Lesser General Public License Version 2.1, February 1999.
# The complete license can be accessed from the following location:
# http://opensource.org/licenses/lgpl-license.php
# See the Copying file included with the OpenSAF distribution for full
# licensing terms.
#
# Author(s): Ericsson AB
#
. /etc/opensaf/osafdir.conf
export PATH=$sbindir:$bindir:$PATH
export LD_LIBRARY_PATH=$libdir:$LD_LIBRARY_PATH
# NOTE 1: This script is a customization point between OpenSAF and a target
# system and should be changed according to the needs of such system.
# NOTE 2: The script must be idempotent, i.e. it must be harmless to call it
# more than one time with the same parameters. The second call should do nothing
# since the nodes were added to the cluster the first time the script was
# called.
# NOTE 3: This example script requires write access to the $pkgimmxmldir
# directory
# Remove the following line when customizing this script.
exit 0
cd "$pkgimmxmldir"
immfind -c SaClmNode | sed -e 's/^[^=]*=//;s/,.*$//' > nodes.cfg.tmp
for node in "$@"; do
node_name=$(echo "$node" | cut -d, -f2)
echo "$node_name" >> nodes.cfg.tmp
done
rm -f nodes.cfg
for node in $(sort < nodes.cfg.tmp | uniq); do
case "$node" in
PL*)
node_type=PL
;;
*)
node_type=SC
;;
esac
echo "$node_type $node $node" >> nodes.cfg
done
rm -f nodes.cfg.tmp imm_generated.xml
./immxml-configure imm_generated.xml && immcfg -f imm_generated.xml
------------------------------------------------------------------------------
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel