diff options
author | Alan Conway <aconway@apache.org> | 2012-04-16 19:20:15 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2012-04-16 19:20:15 +0000 |
commit | 0dde682105118b364773e2bee18021734edcf573 (patch) | |
tree | 32400857b5df39ac77526a096b84fd1412c6ca74 | |
parent | 6cf716b52c086e19a7439468b9de4e314625c55d (diff) | |
download | qpid-python-0dde682105118b364773e2bee18021734edcf573.tar.gz |
QPID-3603: Minor improvements to HA tests, documentation and examples.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1326755 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | qpid/cpp/etc/cluster.conf-example.xml.in | 27 | ||||
-rwxr-xr-x | qpid/cpp/etc/qpidd.in | 7 | ||||
-rw-r--r-- | qpid/cpp/src/tests/cluster.mk | 3 | ||||
-rwxr-xr-x | qpid/cpp/src/tests/cluster_failover | 7 | ||||
-rwxr-xr-x | qpid/cpp/src/tests/qpid-cluster-benchmark | 5 | ||||
-rwxr-xr-x | qpid/cpp/src/tests/qpid-cpp-benchmark | 18 | ||||
-rw-r--r-- | qpid/doc/book/src/Active-Passive-Cluster.xml | 27 |
7 files changed, 38 insertions, 56 deletions
diff --git a/qpid/cpp/etc/cluster.conf-example.xml.in b/qpid/cpp/etc/cluster.conf-example.xml.in index eb70ebbb1e..14b961a363 100644 --- a/qpid/cpp/etc/cluster.conf-example.xml.in +++ b/qpid/cpp/etc/cluster.conf-example.xml.in @@ -2,36 +2,33 @@ <!-- This is an example of a cluster.conf file to run qpidd HA under rgmanager. This example assumes a 3 node cluster, with nodes named node1, node2 and node3. + +NOTE: fencing is not shown, it should be configured in a real cluster configuration. --> <cluster name="qpid-test" config_version="18"> - <!-- The cluster has 3 nodes. Each has a unique nodid and one vote for quorum. --> + <!-- The cluster has 3 nodes. Each has a unique nodid and one vote + for quorum. --> <clusternodes> - <clusternode name="node1" nodeid="1"> - <fence/> - </clusternode> - <clusternode name="node2" nodeid="2"> - <fence/> - </clusternode> - <clusternode name="node3" nodeid="3"> - <fence/> - </clusternode> + <clusternode name="node1.example.com" nodeid="1"/> + <clusternode name="node2.example.com" nodeid="2"/> + <clusternode name="node3.example.com" nodeid="3"/> </clusternodes> <!-- Resouce Manager configuration. --> - <rm log_level="7"> <!-- Verbose logging --> + <rm> <!-- There is a failoverdomain for each node containing just that node. - This lets us stipulate that the qpidd service should always run on all nodes. + This lets us stipulate that the qpidd service should always run on each node. --> <failoverdomains> <failoverdomain name="node1-domain" restricted="1"> - <failoverdomainnode name="node1"/> + <failoverdomainnode name="node1.example.com"/> </failoverdomain> <failoverdomain name="node2-domain" restricted="1"> - <failoverdomainnode name="node2"/> + <failoverdomainnode name="node2.example.com"/> </failoverdomain> <failoverdomain name="node3-domain" restricted="1"> - <failoverdomainnode name="node3"/> + <failoverdomainnode name="node3.example.com"/> </failoverdomain> </failoverdomains> diff --git a/qpid/cpp/etc/qpidd.in b/qpid/cpp/etc/qpidd.in index 23c15283dc..2b43625b7d 100755 --- a/qpid/cpp/etc/qpidd.in +++ b/qpid/cpp/etc/qpidd.in @@ -39,13 +39,14 @@ prog=qpidd lockfile=/var/lock/subsys/$prog pidfile=/var/run/qpidd.pid -# Source function library. -. /etc/rc.d/init.d/functions - +# Source configuration if [ -f !!sysconfdir!!/sysconfig/$prog ] ; then . !!sysconfdir!!/sysconfig/$prog fi +# Source function library. +. /etc/rc.d/init.d/functions + RETVAL=0 #ensure binary is present and executable diff --git a/qpid/cpp/src/tests/cluster.mk b/qpid/cpp/src/tests/cluster.mk index 199d1e7b57..df24f021ba 100644 --- a/qpid/cpp/src/tests/cluster.mk +++ b/qpid/cpp/src/tests/cluster.mk @@ -25,8 +25,7 @@ CLUSTER_TEST_SCRIPTS_LIST= \ allhosts rsynchosts \ qpid-build-rinstall qpid-src-rinstall \ - qpid-test-cluster \ - qpid-cluster-benchmark + qpid-test-cluster EXTRA_DIST += \ $(CLUSTER_TEST_SCRIPTS_LIST) \ diff --git a/qpid/cpp/src/tests/cluster_failover b/qpid/cpp/src/tests/cluster_failover index 2a68d1ec79..43170c731a 100755 --- a/qpid/cpp/src/tests/cluster_failover +++ b/qpid/cpp/src/tests/cluster_failover @@ -11,8 +11,9 @@ echo $SEND $RECV seq 1000000 > $SEND -qpid-receive -f -a 'q;{create:always}' -b $URL --connection-options "{reconnect:true}" | tee $RECV & - -qpid-send -a 'q;{create:always}' -b $URL --connection-options "{reconnect:true}" --send-rate 10 --content-stdin < $SEND & +qpid-send -a 'cluster_failover;{create:always}' -b $URL --connection-options "{reconnect:true}" --send-rate 10 --content-stdin < $SEND & +while msg=$(qpid-receive -m1 -f -a 'cluster_failover;{create:always}' -b $URL --connection-options "{reconnect:true,heartbeat:1}"); do + echo -n $msg; date +done wait diff --git a/qpid/cpp/src/tests/qpid-cluster-benchmark b/qpid/cpp/src/tests/qpid-cluster-benchmark index 10b751c46d..fec2eb0e96 100755 --- a/qpid/cpp/src/tests/qpid-cluster-benchmark +++ b/qpid/cpp/src/tests/qpid-cluster-benchmark @@ -57,11 +57,12 @@ done shift $(($OPTIND-1)) CONNECTION_OPTIONS="--connection-options {tcp-nodelay:$TCP_NODELAY,reconnect:$RECONNECT,heartbeat:$HEARTBEAT}" +CREATE_OPTIONS="node:{x-declare:{arguments:{'qpid.replicate':all}}}" -REPLICATE="node:{x-declare:{arguments:{'qpid.replicate':all}}}" BROKER=$(echo $BROKERS | sed s/,.*//) run_test() { echo $*; shift; "$@"; echo; echo; echo; } OPTS="$OPTS $REPEAT $BROKERS --summarize $QUEUES $SENDERS $RECEIVERS $MESSAGES $CLIENT_HOSTS $SAVE_RECEIVED $CONNECTION_OPTIONS $NO_DELETE" -OPTS="$OPTS --create-option $REPLICATE" +OPTS="$OPTS --create-option $CREATE_OPTIONS" + run_test "Benchmark:" qpid-cpp-benchmark $OPTS "$@" diff --git a/qpid/cpp/src/tests/qpid-cpp-benchmark b/qpid/cpp/src/tests/qpid-cpp-benchmark index 19c01dd08a..1c649b333a 100755 --- a/qpid/cpp/src/tests/qpid-cpp-benchmark +++ b/qpid/cpp/src/tests/qpid-cpp-benchmark @@ -169,18 +169,6 @@ def first_line(p): raise Exception("Process exit %d: %s"%(p.returncode, error_msg(out,err))) return out.split("\n")[0] -def queue_exists(queue,broker): - c = qpid.messaging.Connection(broker) - c.open() - try: - s = c.session() - try: - s.sender(queue) - return True - except qpid.messaging.exceptions.NotFound: - return False - finally: c.close() - def recreate_queues(queues, brokers, no_delete, opts): c = qpid.messaging.Connection(brokers[0]) c.open() @@ -189,15 +177,9 @@ def recreate_queues(queues, brokers, no_delete, opts): if not no_delete: try: s.sender("%s;{delete:always}"%(q)).close() except qpid.messaging.exceptions.NotFound: pass - # FIXME aconway 2011-05-04: new cluster async wiring, wait for changes to propagate - for b in brokers: - while queue_exists(q,b): time.sleep(0.1); address = "%s;{%s}"%(q, ",".join(opts.create_option + ["create:always"])) if opts.verbose: print "Creating", address s.sender(address) - # FIXME aconway 2011-05-04: new cluster async wiring, wait for changes to propagate - for b in brokers: - while not queue_exists(q,b): time.sleep(0.1); c.close() def print_header(timestamp): diff --git a/qpid/doc/book/src/Active-Passive-Cluster.xml b/qpid/doc/book/src/Active-Passive-Cluster.xml index ffec584679..5f5823bdd2 100644 --- a/qpid/doc/book/src/Active-Passive-Cluster.xml +++ b/qpid/doc/book/src/Active-Passive-Cluster.xml @@ -316,39 +316,42 @@ under the License. <!-- This is an example of a cluster.conf file to run qpidd HA under rgmanager. This example assumes a 3 node cluster, with nodes named node1, node2 and node3. + +NOTE: fencing is not shown, you must configure fencing appropriately for your cluster. --> <cluster name="qpid-test" config_version="18"> - <!-- The cluster has 3 nodes. Each has a unique nodid and one vote for quorum. --> + <!-- The cluster has 3 nodes. Each has a unique nodid and one vote + for quorum. --> <clusternodes> - <clusternode name="node1" nodeid="1"/> - <clusternode name="node2" nodeid="2"/> - <clusternode name="node3" nodeid="3"/> + <clusternode name="node1.example.com" nodeid="1"/> + <clusternode name="node2.example.com" nodeid="2"/> + <clusternode name="node3.example.com" nodeid="3"/> </clusternodes> <!-- Resouce Manager configuration. --> - <rm log_level="7"> <!-- Verbose logging --> + <rm> <!-- There is a failoverdomain for each node containing just that node. - This lets us stipulate that the qpidd service should always run on all nodes. + This lets us stipulate that the qpidd service should always run on each node. --> <failoverdomains> <failoverdomain name="node1-domain" restricted="1"> - <failoverdomainnode name="node1"/> + <failoverdomainnode name="node1.example.com"/> </failoverdomain> <failoverdomain name="node2-domain" restricted="1"> - <failoverdomainnode name="node2"/> + <failoverdomainnode name="node2.example.com"/> </failoverdomain> <failoverdomain name="node3-domain" restricted="1"> - <failoverdomainnode name="node3"/> + <failoverdomainnode name="node3.example.com"/> </failoverdomain> </failoverdomains> <resources> <!-- This script starts a qpidd broker acting as a backup. --> - <script file="!!sysconfdir!!/init.d/qpidd" name="qpidd"/> + <script file="/etc/init.d/qpidd" name="qpidd"/> <!-- This script promotes the qpidd broker on this node to primary. --> - <script file="!!sysconfdir!!/init.d/qpidd-primary" name="qpidd-primary"/> + <script file="/etc/init.d/qpidd-primary" name="qpidd-primary"/> <!-- This is a virtual IP address for broker replication traffic. --> <ip address="20.0.10.200" monitor_link="1"/> @@ -376,8 +379,6 @@ This example assumes a 3 node cluster, with nodes named node1, node2 and node3. <ip ref="20.0.20.200"/> </service> </rm> - <fencedevices/> - <fence_daemon clean_start="0" post_fail_delay="0" post_join_delay="3"/> </cluster> ]]> </programlisting> |