From 07e92150af9261036c1a593461a5adfc03a901a7 Mon Sep 17 00:00:00 2001 From: Moiz Raja Date: Mon, 10 Nov 2014 17:35:04 -0800 Subject: [PATCH] BUG 2344 : Add the multi-node-test template for clustering integration tests The multi-node-test template installs all the odl-clustering-test-app and ensures that the modules.conf and module-shards.conf is generated appropriately for testing the app in a multi-node cluster This patch is dependent on the following controller patch, https://git.opendaylight.org/gerrit/#/c/12705/ Change-Id: I58b2938c3125068ef895733bcec8e26050190b39 Signed-off-by: Moiz Raja --- .../multi-node-test/akka.conf.template | 83 +++++++++++++++++ .../multi-node-test/jolokia.xml.template | 9 ++ .../module-shards.conf.template | 92 +++++++++++++++++++ .../multi-node-test/modules.conf.template | 50 ++++++++++ .../org.apache.karaf.features.cfg.template | 48 ++++++++++ .../org.apache.karaf.management.cfg.template | 63 +++++++++++++ 6 files changed, 345 insertions(+) create mode 100644 test/tools/cluster-deployer/templates/multi-node-test/akka.conf.template create mode 100644 test/tools/cluster-deployer/templates/multi-node-test/jolokia.xml.template create mode 100644 test/tools/cluster-deployer/templates/multi-node-test/module-shards.conf.template create mode 100644 test/tools/cluster-deployer/templates/multi-node-test/modules.conf.template create mode 100644 test/tools/cluster-deployer/templates/multi-node-test/org.apache.karaf.features.cfg.template create mode 100644 test/tools/cluster-deployer/templates/multi-node-test/org.apache.karaf.management.cfg.template diff --git a/test/tools/cluster-deployer/templates/multi-node-test/akka.conf.template b/test/tools/cluster-deployer/templates/multi-node-test/akka.conf.template new file mode 100644 index 0000000000..738d538994 --- /dev/null +++ b/test/tools/cluster-deployer/templates/multi-node-test/akka.conf.template @@ -0,0 +1,83 @@ + +odl-cluster-data { + bounded-mailbox { + mailbox-type = "org.opendaylight.controller.cluster.common.actor.MeteredBoundedMailbox" + mailbox-capacity = 1000 + mailbox-push-timeout-time = 100ms + } + + metric-capture-enabled = true + + akka { + loglevel = "INFO" + loggers = ["akka.event.slf4j.Slf4jLogger"] + + actor { + + provider = "akka.cluster.ClusterActorRefProvider" + serializers { + java = "akka.serialization.JavaSerializer" + proto = "akka.remote.serialization.ProtobufSerializer" + } + + serialization-bindings { + "com.google.protobuf.Message" = proto + + } + } + remote { + log-remote-lifecycle-events = off + netty.tcp { + hostname = "{{HOST}}" + port = 2550 + maximum-frame-size = 419430400 + send-buffer-size = 52428800 + receive-buffer-size = 52428800 + } + } + + cluster { + seed-nodes = {{{DS_SEED_NODES}}} + + auto-down-unreachable-after = 10s + + roles = [ + "{{MEMBER_NAME}}" + ] + + } + } +} + +odl-cluster-rpc { + bounded-mailbox { + mailbox-type = "org.opendaylight.controller.cluster.common.actor.MeteredBoundedMailbox" + mailbox-capacity = 1000 + mailbox-push-timeout-time = 100ms + } + + metric-capture-enabled = true + + akka { + loglevel = "INFO" + loggers = ["akka.event.slf4j.Slf4jLogger"] + + actor { + provider = "akka.cluster.ClusterActorRefProvider" + + } + remote { + log-remote-lifecycle-events = off + netty.tcp { + hostname = "{{HOST}}" + port = 2551 + } + } + + cluster { + seed-nodes = {{{RPC_SEED_NODES}}} + + auto-down-unreachable-after = 10s + } + } +} diff --git a/test/tools/cluster-deployer/templates/multi-node-test/jolokia.xml.template b/test/tools/cluster-deployer/templates/multi-node-test/jolokia.xml.template new file mode 100644 index 0000000000..be150b0130 --- /dev/null +++ b/test/tools/cluster-deployer/templates/multi-node-test/jolokia.xml.template @@ -0,0 +1,9 @@ + + + + + + mvn:org.jolokia/jolokia-osgi/1.1.5 + + + diff --git a/test/tools/cluster-deployer/templates/multi-node-test/module-shards.conf.template b/test/tools/cluster-deployer/templates/multi-node-test/module-shards.conf.template new file mode 100644 index 0000000000..6a39724799 --- /dev/null +++ b/test/tools/cluster-deployer/templates/multi-node-test/module-shards.conf.template @@ -0,0 +1,92 @@ +# This file describes which shards live on which members +# The format for a module-shards is as follows, +# { +# name = "" +# shards = [ +# { +# name="" +# replicas = [ +# "" +# ] +# ] +# } +# +# For Helium we support only one shard per module. Beyond Helium +# we will support more than 1 +# The replicas section is a collection of member names. This information +# will be used to decide on which members replicas of a particular shard will be +# located. Once replication is integrated with the distributed data store then +# this section can have multiple entries. +# +# + + +module-shards = [ + { + name = "default" + shards = [ + { + name="default" + replicas = {{{REPLICAS_1}}} + + } + ] + }, + { + name = "topology" + shards = [ + { + name="topology" + replicas = {{{REPLICAS_2}}} + + } + ] + }, + { + name = "inventory" + shards = [ + { + name="inventory" + replicas = {{{REPLICAS_3}}} + + } + ] + }, + { + name = "toaster" + shards = [ + { + name="toaster" + replicas = {{{REPLICAS_4}}} + } + ] + }, + { + name = "car" + shards = [ + { + name="car" + replicas = {{{REPLICAS_4}}} + } + ] + }, + { + name = "people" + shards = [ + { + name="people" + replicas = {{{REPLICAS_4}}} + } + ] + }, + { + name = "car-people" + shards = [ + { + name="car-people" + replicas = {{{REPLICAS_4}}} + } + ] + } + +] diff --git a/test/tools/cluster-deployer/templates/multi-node-test/modules.conf.template b/test/tools/cluster-deployer/templates/multi-node-test/modules.conf.template new file mode 100644 index 0000000000..71c12d2f34 --- /dev/null +++ b/test/tools/cluster-deployer/templates/multi-node-test/modules.conf.template @@ -0,0 +1,50 @@ +# This file should describe all the modules that need to be placed in a separate shard +# The format of the configuration is as follows +# { +# name = "" +# namespace = "" +# shard-strategy = "module" +# } +# +# Note that at this time the only shard-strategy we support is module which basically +# will put all the data of a single module in two shards (one for config and one for +# operational data) + +modules = [ + { + name = "inventory" + namespace = "urn:opendaylight:inventory" + shard-strategy = "module" + }, + + { + name = "topology" + namespace = "urn:TBD:params:xml:ns:yang:network-topology" + shard-strategy = "module" + }, + + { + name = "toaster" + namespace = "http://netconfcentral.org/ns/toaster" + shard-strategy = "module" + }, + + { + name = "car" + namespace = "urn:opendaylight:params:xml:ns:yang:controller:config:sal-clustering-it:car" + shard-strategy = "module" + }, + + { + name = "people" + namespace = "urn:opendaylight:params:xml:ns:yang:controller:config:sal-clustering-it:people" + shard-strategy = "module" + }, + + { + name = "car-people" + namespace = "urn:opendaylight:params:xml:ns:yang:controller:config:sal-clustering-it:car-people" + shard-strategy = "module" + } + +] diff --git a/test/tools/cluster-deployer/templates/multi-node-test/org.apache.karaf.features.cfg.template b/test/tools/cluster-deployer/templates/multi-node-test/org.apache.karaf.features.cfg.template new file mode 100644 index 0000000000..aaac53c202 --- /dev/null +++ b/test/tools/cluster-deployer/templates/multi-node-test/org.apache.karaf.features.cfg.template @@ -0,0 +1,48 @@ +################################################################################ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ + +# +# Defines if the startlvl should be respected during feature startup. The default value is true. The default +# behavior for 2.x is false (!) for this property +# +# Be aware that this property is deprecated and will be removed in Karaf 4.0. So, if you need to +# set this to false, please use this only as a temporary solution! +# +#respectStartLvlDuringFeatureStartup=true + +# +# Defines if the startlvl should be respected during feature uninstall. The default value is true. +# If true, means stop bundles respecting the descend order of start level in a certain feature. +# +#respectStartLvlDuringFeatureUninstall=true + +# +# Comma separated list of features repositories to register by default +# +featuresRepositories = mvn:org.apache.karaf.features/standard/3.0.1/xml/features,mvn:org.apache.karaf.features/enterprise/3.0.1/xml/features,mvn:org.ops4j.pax.web/pax-web-features/3.1.0/xml/features,mvn:org.apache.karaf.features/spring/3.0.1/xml/features,mvn:org.opendaylight.integration/features-integration/{{ODL_DISTRIBUTION}}/xml/features + +# +# Comma separated list of features to install at startup +# +featuresBoot=config,standard,region,package,kar,ssh,management,odl-clustering-test-app,odl-restconf-noauth,odl-mdsal-clustering + +# +# Defines if the boot features are started in asynchronous mode (in a dedicated thread) +# +featuresBootAsynchronous=false diff --git a/test/tools/cluster-deployer/templates/multi-node-test/org.apache.karaf.management.cfg.template b/test/tools/cluster-deployer/templates/multi-node-test/org.apache.karaf.management.cfg.template new file mode 100644 index 0000000000..510eebd81e --- /dev/null +++ b/test/tools/cluster-deployer/templates/multi-node-test/org.apache.karaf.management.cfg.template @@ -0,0 +1,63 @@ +################################################################################ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ + +# +# The properties in this file define the configuration of Apache Karaf's JMX Management +# + +# +# Port number for RMI registry connection +# +rmiRegistryPort = 1099 + +# +# Port number for RMI server connection +# +rmiServerPort = 44444 + +# +# Name of the JAAS realm used for authentication +# +jmxRealm = karaf + +# +# The service URL for the JMXConnectorServer +# +serviceUrl = service:jmx:rmi://{{HOST}}:${rmiServerPort}/jndi/rmi://{{HOST}}:${rmiRegistryPort}/karaf-${karaf.name} + +# +# Whether any threads started for the JMXConnectorServer should be started as daemon threads +# +daemon = true + +# +# Whether the JMXConnectorServer should be started in a separate thread +# +threaded = true + +# +# The ObjectName used to register the JMXConnectorServer +# +objectName = connector:name=rmi + +# +# Role name used for JMX access authorization +# If not set, this defaults to the ${karaf.admin.role} configured in etc/system.properties +# +# jmxRole=admin -- 2.36.6