From: Luis Gomez Date: Mon, 27 Apr 2020 18:48:32 +0000 (-0700) Subject: Add cluster scripts to ONAP distribution X-Git-Tag: release/aluminium~15 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=integration%2Fdistribution.git;a=commitdiff_plain;h=88b19e26c1ae6d563d3297408748126db2401f47 Add cluster scripts to ONAP distribution - Also removing not needed configuration in common distribution. Change-Id: I4230b06ec3481692e5870caae4291b1c5703eecf Signed-off-by: Luis Gomez --- diff --git a/onap-karaf/pom.xml b/onap-karaf/pom.xml index 06c7a201..d1e47ebe 100644 --- a/onap-karaf/pom.xml +++ b/onap-karaf/pom.xml @@ -141,6 +141,13 @@ test + + org.opendaylight.integration + karaf-scripts + ${project.version} + test + + @@ -168,6 +175,21 @@ true + + unpack-odl-karaf-resources + + unpack-dependencies + + prepare-package + + ${project.build.directory}/assembly + org.opendaylight.integration + karaf-scripts + META-INF\/** + true + false + + diff --git a/onap-karaf/src/main/assembly/etc/org.ops4j.pax.url.mvn.cfg b/onap-karaf/src/main/assembly/etc/org.ops4j.pax.url.mvn.cfg deleted file mode 100644 index f1958bef..00000000 --- a/onap-karaf/src/main/assembly/etc/org.ops4j.pax.url.mvn.cfg +++ /dev/null @@ -1,96 +0,0 @@ -################################################################################ -# -# 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. -# -################################################################################ - -# -# If set to true, the following property will not allow any certificate to be used -# when accessing Maven repositories through SSL -# -#org.ops4j.pax.url.mvn.certificateCheck= - -# -# Path to the local Maven settings file. -# The repositories defined in this file will be automatically added to the list -# of default repositories if the 'org.ops4j.pax.url.mvn.repositories' property -# below is not set. -# The following locations are checked for the existence of the settings.xml file -# * 1. looks for the specified url -# * 2. if not found looks for ${user.home}/.m2/settings.xml -# * 3. if not found looks for ${maven.home}/conf/settings.xml -# * 4. if not found looks for ${M2_HOME}/conf/settings.xml -# -#org.ops4j.pax.url.mvn.settings= - -# -# Path to the local Maven repository which is used to avoid downloading -# artifacts when they already exist locally. -# The value of this property will be extracted from the settings.xml file -# above, or defaulted to: -# System.getProperty( "user.home" ) + "/.m2/repository" -# -org.ops4j.pax.url.mvn.localRepository=${karaf.home}/${karaf.default.repository} - -# -# Default this to false. It's just weird to use undocumented repos -# -org.ops4j.pax.url.mvn.useFallbackRepositories=false - -# -# Uncomment if you don't wanna use the proxy settings -# from the Maven conf/settings.xml file -# -# org.ops4j.pax.url.mvn.proxySupport=false - -# -# Comma separated list of repositories scanned when resolving an artifact. -# Those repositories will be checked before iterating through the -# below list of repositories and even before the local repository -# A repository url can be appended with zero or more of the following flags: -# @snapshots : the repository contains snaphots -# @noreleases : the repository does not contain any released artifacts -# -# The following property value will add the system folder as a repo. -# -org.ops4j.pax.url.mvn.defaultRepositories=\ - file:${karaf.home}/${karaf.default.repository}@id=system.repository@snapshots,\ - file:${karaf.data}/kar@id=kar.repository@multi@snapshots,\ - file:${karaf.base}/${karaf.default.repository}@id=child.system.repository@snapshots - -# Use the default local repo (e.g.~/.m2/repository) as a "remote" repo -#org.ops4j.pax.url.mvn.defaultLocalRepoAsRemote=false - -# -# Comma separated list of repositories scanned when resolving an artifact. -# The default list includes the following repositories: -# http://repo1.maven.org/maven2@id=central -# http://repository.springsource.com/maven/bundles/release@id=spring.ebr -# http://repository.springsource.com/maven/bundles/external@id=spring.ebr.external -# http://zodiac.springsource.com/maven/bundles/release@id=gemini -# http://repository.apache.org/content/groups/snapshots-group@id=apache@snapshots@noreleases -# https://oss.sonatype.org/content/repositories/snapshots@id=sonatype.snapshots.deploy@snapshots@noreleases -# https://oss.sonatype.org/content/repositories/ops4j-snapshots@id=ops4j.sonatype.snapshots.deploy@snapshots@noreleases -# To add repositories to the default ones, prepend '+' to the list of repositories -# to add. -# A repository url can be appended with zero or more of the following flags: -# @snapshots : the repository contains snapshots -# @noreleases : the repository does not contain any released artifacts -# @id=repository.id : the id for the repository, just like in the settings.xml this is optional but recommended -# -org.ops4j.pax.url.mvn.repositories= -### ^^^ No remote repositories. This is the only ODL change compared to Karaf defaults. - diff --git a/onap-karaf/src/main/assembly/etc/shell.init.script b/onap-karaf/src/main/assembly/etc/shell.init.script deleted file mode 100644 index a44ec0c0..00000000 --- a/onap-karaf/src/main/assembly/etc/shell.init.script +++ /dev/null @@ -1,67 +0,0 @@ -// -// 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. -// -// This script is run each time a shell is created. -// You can define here closures or variables that will be available -// in each session. -// -ld = { log:display $args } ; -lde = { log:exception-display $args } ; -la = { bundle:list -t 0 $args } ; -ls = { service:list $args } ; -cl = { config:list "(service.pid=$args)" } ; -halt = { system:shutdown -h -f $args } ; -help = { *:help $args | more } ; -man = { help $args } ; -log:list = { log:get ALL } ; -service:get = { $.context getService ($.context getServiceReference $args) }; - -env = { shell:set $args } -edit = { shell:nano $args } -more = { shell:less -F $args } - -// \#prompt = { "${USER}@${APPLICATION}(${SUBSHELL})> "?}; - -__load_class = { - (($.reader class) classLoader) loadClass $1 -} - -// make sure that we catch exceptions -// as they do occur if the session is headless / non-interactive -jlineReader = $.reader -if { %(jlineReader != null) } { - - # On 256 colors terminal, add a right prompt - max_colors = ($.jline.terminal getNumericCapability max_colors) - if { %(max_colors >= 256) } { - __rprompt_formatter = (((__load_class java.text.SimpleDateFormat) getConstructor (__load_class java.lang.String)) newInstance \'$'\u001B\[90m'\'HH:mm:ss) - __date_class = (__load_class java.util.Date) -// Do not use right prompt by default -// \#rprompt = { $__rprompt_formatter format ($__date_class newInstance) } - } - - setopt group - setopt auto-fresh-line - unsetopt insert-tab - keymap "^[OA" up-line-or-search - keymap "^[[A" up-line-or-search - keymap "^[OB" down-line-or-search - keymap "^[[B" down-line-or-search - -} - diff --git a/opendaylight/src/main/assembly/bin/configure-cluster-ipdetect.sh b/opendaylight/src/main/assembly/bin/configure-cluster-ipdetect.sh deleted file mode 100755 index 7b97ef96..00000000 --- a/opendaylight/src/main/assembly/bin/configure-cluster-ipdetect.sh +++ /dev/null @@ -1,265 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2015 Brocade Communications Systems, Inc. and others. All rights reserved. -# Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved. -# -# This program and the accompanying materials are made available under the -# terms of the Eclipse Public License v1.0 which accompanies this distribution, -# and is available at http://www.eclipse.org/legal/epl-v10.html -# - - -function usage() -{ - # Print any error messages - test "$1" != "" && echo " ERROR: $1" - - # Print standard usage help - cat << EOF - This script is used to configure cluster parameters on this - controller. The user should restart controller to apply changes. - - Usage: $0 - - seed_nodes_list: List of seed nodes, separated by comma or space. - - The script checks that one (any) of the the controller's active IP - addresses is present in the seed_nodes_list. When running this script - on multiple seed nodes, keep the seed_node_list same on all nodes. - - Optionally, shards can be configured in a more granular way by - modifying the file "custom_shard_configs.txt" in the same folder - as this tool. Please see that file for more details. - -This script is currently limited to IPv4 addresses. If you have -problems running this script, please use 'configure_cluster.sh'. - -EOF - - exit 1 -} - - -function start_banner -{ -cat < ${MODULESHARDSCONF} - modules_builder > ${MODULESCONF} - cat ${MODULESCONF} - fi - - echo "Configuring replication type in module-shards.conf" - sed -i -e "/^[^#].*replicas[ ]*=/ { :loop /.*\]/ b done; N; b loop; :done s/replicas.*\]/replicas = [${MEMBER_NAME_LIST}]/}" ${MODULESHARDSCONF} -} - - -function verify_configuration_files -{ - # Constants - BIN_DIR=`dirname $0` - test ${BIN_DIR} == '.' && BIN_DIR=${PWD} - CONTROLLER_DIR=`dirname ${BIN_DIR}` - CONF_DIR=${CONTROLLER_DIR}/configuration/initial - AKKACONF=${CONF_DIR}/akka.conf - MODULESCONF=${CONF_DIR}/modules.conf - MODULESHARDSCONF=${CONF_DIR}/module-shards.conf - - # Verify configuration files are present in expected location. - if [ ! -f ${AKKACONF} -o ! -f ${MODULESHARDSCONF} ]; then - # Check if the configuration files exist in the system - # directory, then copy them over. - ORIG_CONF_DIR=${CONTROLLER_DIR}/system/org/opendaylight/controller/sal-clustering-config - version=$(sed -n -e 's/.*\(.*\)<\/version>/\1/p' ${ORIG_CONF_DIR}/maven-metadata-local.xml) - ORIG_CONF_DIR=${ORIG_CONF_DIR}/${version} - ORIG_AKKA_CONF=sal-clustering-config-${version}-akkaconf.xml - ORIG_MODULES_CONF=sal-clustering-config-${version}-moduleconf.xml - ORIG_MODULESHARDS_CONF=sal-clustering-config-${version}-moduleshardconf.xml - - if [ -f ${ORIG_CONF_DIR}/${ORIG_AKKA_CONF} -a \ - -f ${ORIG_CONF_DIR}/${ORIG_MODULES_CONF} -a \ - -f ${ORIG_CONF_DIR}/${ORIG_MODULESHARDS_CONF} ]; then - cat < - - index: Integer within 1..N, where N is the number of seed nodes. - - seed_nodes_list: List of seed nodes, separated by comma or space. - - The address at the provided index should belong this controller. - When running this script on multiple seed nodes, keep the - seed_node_list same, and vary the index from 1 through N. - - Optionally, shards can be configured in a more granular way by - modifying the file "custom_shard_configs.txt" in the same folder - as this tool. Please see that file for more details - -EOF - - exit 1 -} - - -function start_banner -{ -cat < ${MODULESHARDSCONF} - modules_builder > ${MODULESCONF} - cat ${MODULESCONF} - fi - - echo "Configuring replication type in module-shards.conf" - sed -i -e "/^[^#].*replicas[ ]*=/ { :loop /.*\]/ b done; N; b loop; :done s/replicas.*\]/replicas = [${MEMBER_NAME_LIST}]/}" ${MODULESHARDSCONF} -} - - -function verify_configuration_files -{ - # Constants - BIN_DIR=`dirname $0` - test ${BIN_DIR} == '.' && BIN_DIR=${PWD} - CONTROLLER_DIR=`dirname ${BIN_DIR}` - CONF_DIR=${CONTROLLER_DIR}/configuration/initial - AKKACONF=${CONF_DIR}/akka.conf - MODULESCONF=${CONF_DIR}/modules.conf - MODULESHARDSCONF=${CONF_DIR}/module-shards.conf - - # Verify configuration files are present in expected location. - if [ ! -f ${AKKACONF} -o ! -f ${MODULESHARDSCONF} ]; then - # Check if the configuration files exist in the system - # directory, then copy them over. - ORIG_CONF_DIR=${CONTROLLER_DIR}/system/org/opendaylight/controller/sal-clustering-config - version=$(sed -n -e 's/.*\(.*\)<\/version>/\1/p' ${ORIG_CONF_DIR}/maven-metadata-local.xml) - ORIG_CONF_DIR=${ORIG_CONF_DIR}/${version} - ORIG_AKKA_CONF=sal-clustering-config-${version}-akkaconf.xml - ORIG_MODULES_CONF=sal-clustering-config-${version}-moduleconf.xml - ORIG_MODULESHARDS_CONF=sal-clustering-config-${version}-moduleshardconf.xml - - if [ -f ${ORIG_CONF_DIR}/${ORIG_AKKA_CONF} -a \ - -f ${ORIG_CONF_DIR}/${ORIG_MODULES_CONF} -a \ - -f ${ORIG_CONF_DIR}/${ORIG_MODULESHARDS_CONF} ]; then - cat < - -EOF - - exit 1 -} - - -function end_banner -{ -cat <\(.*\)<\/version>/\1/p' ${ORIG_CONF_DIR}/maven-metadata-local.xml) - ORIG_CONF_DIR=${ORIG_CONF_DIR}/${version} - ORIG_CLUSTER_CONF=sal-clustering-config-${version}-datastore.cfg - - if [ -f ${ORIG_CONF_DIR}/${ORIG_CLUSTER_CONF} ]; then - cat < "?}; - -__load_class = { - (($.reader class) classLoader) loadClass $1 -} - -// make sure that we catch exceptions -// as they do occur if the session is headless / non-interactive -jlineReader = $.reader -if { %(jlineReader != null) } { - - # On 256 colors terminal, add a right prompt - max_colors = ($.jline.terminal getNumericCapability max_colors) - if { %(max_colors >= 256) } { - __rprompt_formatter = (((__load_class java.text.SimpleDateFormat) getConstructor (__load_class java.lang.String)) newInstance \'$'\u001B\[90m'\'HH:mm:ss) - __date_class = (__load_class java.util.Date) -// Do not use right prompt by default -// \#rprompt = { $__rprompt_formatter format ($__date_class newInstance) } - } - - setopt group - setopt auto-fresh-line - unsetopt insert-tab - keymap "^[OA" up-line-or-search - keymap "^[[A" up-line-or-search - keymap "^[OB" down-line-or-search - keymap "^[[B" down-line-or-search - -}