Repository: incubator-trafodion Updated Branches: refs/heads/master 47ca2755b -> 141f35434
Documentation and installer change for Floating IP Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/1cde2505 Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/1cde2505 Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/1cde2505 Branch: refs/heads/master Commit: 1cde2505bef3b26428537c064790db8157a2b9ae Parents: b2b3e6b Author: Anuradha Hegde <[email protected]> Authored: Tue Jan 5 17:46:09 2016 +0000 Committer: Anuradha Hegde <[email protected]> Committed: Tue Jan 5 17:46:09 2016 +0000 ---------------------------------------------------------------------- .../main/asciidoc/_chapters/architecture.adoc | 15 +-- .../main/asciidoc/_chapters/configuration.adoc | 74 ++++++++---- .../main/asciidoc/_chapters/external_apis.adoc | 34 ------ dcs/src/main/asciidoc/_chapters/ops_mgt.adoc | 30 ++++- .../asciidoc/_chapters/troubleshooting.adoc | 4 +- dcs/src/main/asciidoc/index.adoc | 1 - dcs/src/main/resources/dcs-default.xml | 45 ------- install/installer/cloud_cli_setup | 75 ++++++++++++ install/installer/dcs_installer | 27 +++-- install/installer/traf_config_setup | 120 ++++++++++++------- install/installer/trafodion_install | 6 + 11 files changed, 253 insertions(+), 178 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1cde2505/dcs/src/main/asciidoc/_chapters/architecture.adoc ---------------------------------------------------------------------- diff --git a/dcs/src/main/asciidoc/_chapters/architecture.adoc b/dcs/src/main/asciidoc/_chapters/architecture.adoc index d43741f..4f42881 100644 --- a/dcs/src/main/asciidoc/_chapters/architecture.adoc +++ b/dcs/src/main/asciidoc/_chapters/architecture.adoc @@ -78,20 +78,7 @@ functions such as listening for clients and restarting DcsServers. So, while the a time without the DcsMaster, it should be restarted as soon as possible. === High Availability -DcsMaster backup servers may be configured by adding host names to the _conf/backup-masters_ file. They are started -and stopped automatically by the _bin/master-backup.sh_ script whenever DCS is started or stopped. Every backup -DcsMaster follows the current leader DcsMaster watching for it to fail. If failure of the leader occurs the first -backup DcsMaster in line for succession checks to see if floating IP is enabled. If enabled it executes -the _bin/scripts/dcsbind.sh_ script to add a floating IP address to an interface on its node. It then continues -with normal initialization and eventually starts listening for new client connections. It may take -several seconds for the takeover to complete. When a failed node is restored a new DcsMaster backup may -be started manually by executing the _bin/dcs-daemon.sh_ script on the restored node e.g., - ----- ->bin/dcs-daemon.sh start master ----- - -The newly created DcsMaster backup process will take its place at the back of the line waiting for the current DcsMaster leader to fail. +Please refer to section <<ha.configurations, High Availability>> [[master-processes]] === Processes http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1cde2505/dcs/src/main/asciidoc/_chapters/configuration.adoc ---------------------------------------------------------------------- diff --git a/dcs/src/main/asciidoc/_chapters/configuration.adoc b/dcs/src/main/asciidoc/_chapters/configuration.adoc index abcaa9c..b577c16 100644 --- a/dcs/src/main/asciidoc/_chapters/configuration.adoc +++ b/dcs/src/main/asciidoc/_chapters/configuration.adoc @@ -127,7 +127,13 @@ All servers listed in this file will be started and stopped when DCS start or st The _backup-masters_ file lists all hosts that you would have running backup DcsMaster processes, one host per line. All servers listed in this file will be started -and stopped when DCS start or stop is run. +and stopped during DCS start or stop is run. + +==== _master_ + +The _master_ file lists the host of the primary DcsMaster process. Only one host is allowed to +be the primary master. The server listed in this file will be started +and stopped during DCS start or stop is run. ==== ZooKeeper and DCS See section <<zookeeper,Zookeeper>> for ZooKeeper setup for DCS. @@ -311,16 +317,20 @@ Edit this file to change rate at which DCS files are rolled and to change the le Changes here will require a cluster restart for DCS to notice the change though log levels can be changed for particular daemons via the DCS UI. +=== _master_ +A plain-text file which lists host on which the primary master process should be started. Only one host allowed to be the +primary master + === _backup-masters_ -A plain-text file which lists hosts on which the backup Master process, one host per line, should be started. +A plain-text file which lists hosts on which the backup master process should be started. Only one host per line is allowed == Example Configurations === Basic Distributed DCS Install This example shows a basic configuration for a distributed four-node cluster. The nodes are named -`example1`,`example2`, and so on, through node`example4` in this example. The DCS Master is running -on the node `example1`. DCS Servers run on nodes `example1`-`example4`. A 3-node ZooKeeper ensemble runs on `example1`, +`example1`,`example2`, and so on, through node`example4` in this example. The DCS Master is configured to run +on node `example4`. DCS Servers run on nodes `example1`-`example4`. A 3-node ZooKeeper ensemble runs on `example1`, `example2`, and `example3` on the default ports. ZooKeeper data is persisted to the directory _/export/zookeeper_. Below we show what the main configuration files, _dcs-site.xml_, _servers_, and _dcs-env.sh_, found in the DCS _conf_ directory might look like. @@ -373,6 +383,14 @@ Alternatively, you can list the nodes followed by the number of mxosrvrs: example4 2 ---- +==== _master_ + +In this file, you list the node that will run primary DcsMasters. +[source,console] +---- + example4 +---- + ==== _backup-masters_ In this file, you list the nodes that will run backup DcsMasters. In this case, @@ -408,36 +426,46 @@ index e70ebc6..96f8c27 100644 Use _rsync_ to copy the content of the _conf_ directory to all nodes of the cluster. -[[important.configurations]] -== The Important Configurations -Below we list the *important* Configurations. We've divided this section into required configuration -and worth-a-look recommended configs. - -=== Required Configurations -Review the <<os,OS>> section. +[[ha.configurations]] +== High Availability(HA) Configuration +The master configuration file for DcsMaster may be configured by adding the host name to the _conf/master_ file. If the master is +configured to start on the remote node then, during start of dcs the primary master will be started on the remote +node. If the _conf/master_ file is empty then the primary master will be the host where the dcs start script was run. +Similarly, DcsMaster backup servers may be configured by adding host names to the _conf/backup-masters_ file. They are +started and stopped automatically by the _bin/master-backup.sh_ script whenever DCS is started or stopped. Every backup +DcsMaster follows the current leader DcsMaster watching for it to fail. If failure of the leader occurs the first +backup DcsMaster in line for succession checks to see if floating IP is enabled. If enabled it executes +the _bin/scripts/dcsbind.sh_ script to add a floating IP address to an interface on its node. It then continues +with normal initialization and eventually starts listening for new client connections. It may take +several seconds for the take over to complete. When a failed node is restored a new DcsMaster backup may +be started manually by executing the _bin/dcs-daemon.sh_ script on the restored node -=== Recommended Configurations -==== `dcs.master.port` -The default value is 37800. This is the port the DcsMaster listener binds to +---- +>bin/dcs-daemon.sh start master +---- + +The newly created DcsMaster backup process will take its place at the back of the line waiting for the current DcsMaster leader to fail. + +=== `dcs.master.port` +The default value is 23400. This is the port the DcsMaster listener binds to waiting for JDBC/ODBC T4 client connections. The value may need to be changed if this port number conflicts with other ports in use on your cluster. To change this configuration, edit _conf/dcs-site.xml_, copy the changed file around the cluster and restart. -==== `dcs.master.port.range` +=== `dcs.master.port.range` The default value is 100. This is the total number of ports that MXOSRVRs will scan trying to find an available port to use. You must ensure the value is large enough to support the number of MXOSRVRs configured in _conf/servers_. -==== `dcs.master.floating.ip` +=== `dcs.master.floating.ip` The default value is false. When set to true the floating IP feature in the DcsMaster is enabled via the _bin/dcsbind.sh_ script. -This allows backup DcsMaster to takeover and set the floating IP address. +This allows backup DcsMaster to take over and set the floating IP address. -==== `dcs.master.floating.ip.external.interface` -There is no default value. You must ensure the value contains the correct interface -for your networking configuration. +=== `dcs.master.floating.ip.external.interface` +There is no default value. You must ensure the value contains the correct interface for your network configuration. -==== `dcs.master.floating.ip.external.ip.address` -There is no default value. It is importatnt that you set this to the dotted IP address appropriate for your network. +=== `dcs.master.floating.ip.external.ip.address` +There is no default value. It is important that you set this to the dotted IP address appropriate for your network. -To change this configuration, edit _dcs-site.xml_, copy the changed file around the cluster and restart. \ No newline at end of file +To change this configuration, edit _dcs-site.xml_, copy the changed file to all nodes in the cluster and restart dcs. \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1cde2505/dcs/src/main/asciidoc/_chapters/external_apis.adoc ---------------------------------------------------------------------- diff --git a/dcs/src/main/asciidoc/_chapters/external_apis.adoc b/dcs/src/main/asciidoc/_chapters/external_apis.adoc deleted file mode 100644 index 9e307a0..0000000 --- a/dcs/src/main/asciidoc/_chapters/external_apis.adoc +++ /dev/null @@ -1,34 +0,0 @@ -//// -/** - *@@@ START COPYRIGHT @@@ - * 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. - * @@@ END COPYRIGHT @@@ - */ -//// - -[[external-apis]] -= External APIs -:doctype: book -:numbered: -:toc: left -:icons: font -:experimental: - -This chapter will cover access to DCS either through non-Java languages, or through custom protocols. - -[[rest]] -== REST \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1cde2505/dcs/src/main/asciidoc/_chapters/ops_mgt.adoc ---------------------------------------------------------------------- diff --git a/dcs/src/main/asciidoc/_chapters/ops_mgt.adoc b/dcs/src/main/asciidoc/_chapters/ops_mgt.adoc index 87991ff..cd5ff50 100644 --- a/dcs/src/main/asciidoc/_chapters/ops_mgt.adoc +++ b/dcs/src/main/asciidoc/_chapters/ops_mgt.adoc @@ -34,4 +34,32 @@ and <<configuration,configuration>> but is a distinct topic in itself. [[tools]] == Tools and Utilities -Here we list tools for administration, analysis, and debugging. \ No newline at end of file +Here we list tools for administration, analysis, and debugging. + +[[client-server-connectivity]] +=== DcsMaster and mxosrvr unable to communicate via the interface specified in _conf/_dcs_site.xml_ +Symptoms are: When connection are viewed using DCS webUI, the server state will be in "CONNECTING" and the state does not change to "CONNECTED". + +When such issues are seen, validate network communication works by using the linux utility 'netstat(nc)'command. +---- +From the first node, type 'nc -l <any port number>'. This tells that the node (server) is listening on the specified port + +From the second node, type ânc <external IP of the first node> <the listening port specified on the first node>â. Now the second node (client) trying to connect to the port. +Start entering some text on the client node and hit enter. The message you typed should reach the server on the first node. + +To exit , Press Ctrl-D , both the client and server will exit. +---- + +Another test would be to enable verbose when using ssh by using the public or private IP address +---- +ssh -v <private IP address OR public IP address> +---- + +The third test would be to use linux tool 'traceroute' +---- +traceroute <privateIP or public IP address> +---- + + + + http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1cde2505/dcs/src/main/asciidoc/_chapters/troubleshooting.adoc ---------------------------------------------------------------------- diff --git a/dcs/src/main/asciidoc/_chapters/troubleshooting.adoc b/dcs/src/main/asciidoc/_chapters/troubleshooting.adoc index a1cb2b2..6a74484 100644 --- a/dcs/src/main/asciidoc/_chapters/troubleshooting.adoc +++ b/dcs/src/main/asciidoc/_chapters/troubleshooting.adoc @@ -49,7 +49,7 @@ The key process logs are as follows...(replace <user> with the user that started [[trouble-tools-builtin-webmaster]] ==== DcsMaster Web Interface -The DcsMaster starts a web-interface on port 40010 by default. +The DcsMaster starts a web-interface on port 24400 by default. The DcsMaster web UI lists created DcsServers (e.g., build info, zookeeper quorum, metrics, etc.). Additionally, the available DcsServers in the cluster are listed along with selected high-level metrics (listenerRequests, listenerCompletedRequests, @@ -58,7 +58,7 @@ The DcsMaster web UI allows navigation to each DcsServer's web UI. [[trouble-tools-builtin-webserver]] ==== DcsServer Web Interface -DcsServers starts a web-interface on port 40030 by default. +DcsServers starts a web-interface on port 24420 by default. The DcsServer web UI lists its server metrics (build info, zookeeper quorum, usedHeap, maxHeap, etc.). http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1cde2505/dcs/src/main/asciidoc/index.adoc ---------------------------------------------------------------------- diff --git a/dcs/src/main/asciidoc/index.adoc b/dcs/src/main/asciidoc/index.adoc index 5cf6a9e..7509e03 100644 --- a/dcs/src/main/asciidoc/index.adoc +++ b/dcs/src/main/asciidoc/index.adoc @@ -68,7 +68,6 @@ include::_chapters/preface.adoc[] include::_chapters/getting_started.adoc[] include::_chapters/configuration.adoc[] include::_chapters/architecture.adoc[] -include::_chapters/external_apis.adoc[] include::_chapters/performance.adoc[] include::_chapters/troubleshooting.adoc[] include::_chapters/ops_mgt.adoc[] http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1cde2505/dcs/src/main/resources/dcs-default.xml ---------------------------------------------------------------------- diff --git a/dcs/src/main/resources/dcs-default.xml b/dcs/src/main/resources/dcs-default.xml index 577003c..cdff47f 100644 --- a/dcs/src/main/resources/dcs-default.xml +++ b/dcs/src/main/resources/dcs-default.xml @@ -324,51 +324,6 @@ </property> <!-- End of properties that are directly mapped from ZooKeeper's zoo.cfg --> <property> - <name>dcs.rest.port</name> - <value>8080</value> - <description>The port for the dcs REST server.</description> - </property> - <property> - <name>dcs.rest.readonly</name> - <value>false</value> - <description> - Defines the mode the REST server will be started in. Possible values are: - false: All HTTP methods are permitted - GET/PUT/POST/DELETE. - true: Only the GET method is permitted. - </description> - </property> - <property> - <name>dcs.rest.threads.max</name> - <value>100</value> - <description> - The maximum number of threads of the REST server thread pool. - Threads in the pool are reused to process REST requests. This - controls the maximum number of requests processed concurrently. - It may help to control the memory used by the REST server to - avoid out of memory issues. If the thread pool is full, incoming requests - will be queued up and wait for some free threads. The default - is 100. - </description> - </property> - <property> - <name>dcs.rest.threads.min</name> - <value>2</value> - <description> - The minimum number of threads of the REST server thread pool. - The thread pool always has at least these number of threads so - the REST server is ready to serve incoming requests. The default - is 2. - </description> - </property> - <property> - <name>dcs.rest.refresh.seconds</name> - <value>5</value> - <description> - Time in seconds between refresh of the REST server page. Set to 0 - to disable automatic refresh. The default is 5. - </description> - </property> - <property> <name>dcs.server.user.program.statistics.interval.time</name> <value>60</value> <description> http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1cde2505/install/installer/cloud_cli_setup ---------------------------------------------------------------------- diff --git a/install/installer/cloud_cli_setup b/install/installer/cloud_cli_setup new file mode 100755 index 0000000..a7a0d44 --- /dev/null +++ b/install/installer/cloud_cli_setup @@ -0,0 +1,75 @@ +#!/bin/bash +# @@@ START COPYRIGHT @@@ +# +# 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. +# +# @@@ END COPYRIGHT @@@ + +# This script sets up the Command Line Interface(CLI) for various cloud environments +# + +TRAF_CONFIG=/etc/trafodion/trafodion_config +source $TRAF_CONFIG + +if [ $node_count -eq 1 ]; then + TRAF_PDSH="" + TRAF_PDCP="" +else + TRAF_PDSH="pdsh -R exec $MY_NODES $PDSH_SSH_CMD" + TRAF_PDCP="pdcp -R ssh $MY_NODES" +fi + +###### Setting up CLI for AWS as sudo id +if [[ ! -z $AWS_CLOUD ]]; then + ###### Check if aws configuration file exist for Trafodion Id + AWSCONFIG_DIR=$(sudo su $TRAF_USER --login --command "$(/bin/ls -d $HOME/.aws)" 2>/dev/null) + if [[ -z $AWSCONFIG_DIR ]]; then + cd $HOME + curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip" + unzip $HOME/awscli-bundle.zip + + if [[ $node_count -gt "1" ]]; then + $TRAF_PDCP $HOME/awscli-bundle $HOME + $TRAF_PDSH sudo $HOME/awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws + else + $HOME/awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws + fi + + $TRAF_PDSH sudo rm -f $HOME/awscli-bundle + rm -f $HOME/awscli-bundle.zip + + ###### Execute 'aws configure' command as a Trafodion Id + sudo su $TRAF_USER --login --command "/usr/local/bin/aws configure" + + ###### Copy the .aws folder to all nodes in the cluster for Trafodion Id + sudo su $TRAF_USER --login --command "$TRAF_PDCP $HOME/.aws $HOME" + else + echo "AWS Configuration already exist for Trafodion Id" + echo -n "Do you want to overwrite the configuration (Y/N), default is N: " + read answer + if [ ! -z $answer ]; then + if [[ "${answer}" =~ ^[Yy]$ ]]; then + ###### Execute 'aws configure' command as a Trafodion id + sudo su $TRAF_USER --login --command "/usr/local/bin/aws configure" + + ###### Copy the .aws folder to all nodes in the cluster for Trafodion Id + sudo su $TRAF_USER --login --command "$TRAF_PDCP $HOME/.aws $HOME" + fi + fi + fi +fi http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1cde2505/install/installer/dcs_installer ---------------------------------------------------------------------- diff --git a/install/installer/dcs_installer b/install/installer/dcs_installer index 07f5a06..4ebe06b 100755 --- a/install/installer/dcs_installer +++ b/install/installer/dcs_installer @@ -191,7 +191,13 @@ cat dcs-site.xml | sed -e "s@</configuration>@ <property>\n <name>dcs.dns.in cp dcs-site.temp dcs-site.xml rm dcs-site.temp 2>/dev/null +#Configure the dcs primary node +echo $DCS_PRIMARY_MASTER_NODE > $DCS_DIR/conf/master + + if [[ "$ENABLE_HA" == "true" ]]; then + + ######Configure dcs-site.xml file rm dcs-site.temp 2>/dev/null cat dcs-site.xml | sed -e "s@</configuration>@ <property>\n <name>dcs.master.floating.ip</name>\n <value>true</value>\n </property>\n</configuration>@" > dcs-site.temp cp dcs-site.temp dcs-site.xml @@ -206,18 +212,23 @@ if [[ "$ENABLE_HA" == "true" ]]; then cat dcs-site.xml | sed -e "s@</configuration>@ <property>\n <name>dcs.master.floating.ip.external.ip.address</name>\n <value>$FLOATING_IP</value>\n </property>\n</configuration>@" > dcs-site.temp cp dcs-site.temp dcs-site.xml rm dcs-site.temp 2>/dev/null -fi -if [[ "$ENABLE_HA" == "true" ]]; then + ######Configure the backup masters file echo "***INFO: modifying $DCS_DIR/conf/backup-masters file" - for node in $BACKUP_DCS_NODES do echo $node >> $DCS_DIR/conf/backup-masters done + ######Configure trafci wrapper script to use Floating IP address + newHName="HNAME=$FLOATING_IP:23400" + sed -i -e "s/HNAME=localhost:23400/$newHName/g" $SQ_ROOT/trafci/bin/trafci + + ######Copy HA configuration to all nodes in the cluster if [[ $node_count -gt 1 ]]; then + $TRAF_PDCP $DCS_DIR/conf/dcs-site.xml $DCS_DIR/conf/dcs-site.xml $TRAF_PDCP $DCS_DIR/conf/backup-masters $DCS_DIR/conf/backup-masters + $TRAF_PDCP $SQ_ROOT/trafci/bin/trafci $SQ_ROOT/trafci/bin/trafci fi fi @@ -238,15 +249,5 @@ do (( count++ )) done -if [[ "$ENABLE_HA" == "true" ]]; then - newHName="HNAME=$FLOATING_IP:23400" - sed -i -e "s/HNAME=localhost:23400/$newHName/g" $SQ_ROOT/trafci/bin/trafci - - if [[ $node_count -gt 1 ]]; then - $TRAF_PDCP $SQ_ROOT/trafci/bin/trafci $SQ_ROOT/trafci/bin/trafci - fi -fi - - echo "***INFO: End of DCS install." http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1cde2505/install/installer/traf_config_setup ---------------------------------------------------------------------- diff --git a/install/installer/traf_config_setup b/install/installer/traf_config_setup index a00eb6b..4adb9b7 100755 --- a/install/installer/traf_config_setup +++ b/install/installer/traf_config_setup @@ -63,6 +63,7 @@ FLOATING_IP="" BACKUP_DCS_NODES="" LDAP_SECURITY="N" SCANNER_MODE="N" +DCS_PRIMARY_MASTER_NODE=`hostname` LDAP_LEVEL="0" #============================================== @@ -157,6 +158,44 @@ echo "export LOCAL_WORKDIR=\"$LOCAL_WORKDIR\"" >> $LOCAL_TRAF_CONFIG echo "export SQCONFIG=\"$SQCONFIG\"" >> $LOCAL_TRAF_CONFIG #============================================== +#Check if customer is using cloud environment and get the type of cloud being used +#Get the CLOUD_CONFIG and CLOUD_TYPE +echo -n "Is this a cloud environment (Y/N), default is N: " +read answer + +if [ ! -z $answer ]; then + if [[ "${answer}" =~ ^[Yy]$ ]]; then + CLOUD_CONFIG="Y" + fi + else + CLOUD_CONFIG="N" +fi + +echo "export CLOUD_CONFIG=\"$CLOUD_CONFIG\"" >> $LOCAL_TRAF_CONFIG + +if [[ "$CLOUD_CONFIG" == "Y" ]]; then + echo -n "Specify the type of cloud being used (1: AWS(Amazon cloud), 2: OpenStack, 3: Other): " + read answer1 + if [[ -z "$answer1" ]]; then + echo "***ERROR: Must specify the type of Cloud being used." + exit -1 + else + CLOUD_TYPE=$answer1 + fi + echo "export CLOUD_TYPE=\"$CLOUD_TYPE\"" >> $LOCAL_TRAF_CONFIG + case "$CLOUD_TYPE" in + 1) AWS_CLOUD=true + echo "export AWS_CLOUD=\"$AWS_CLOUD\"" >> $LOCAL_TRAF_CONFIG + ;; + 2) OPEN_STACK=true + echo "export OPEN_STACK=\"$OPEN_STACK\"" >> $LOCAL_TRAF_CONFIG + ;; + 3) CLOUD_OTHER=true + echo "export CLOUD_OTHER=\"$CLOUD_OTHER\"" >> $LOCAL_TRAF_CONFIG + esac +fi + +#============================================== # Password echo -n "Enter $TRAF_USER password, default is [$TRAF_USER_PASSWORD]: " read answer @@ -472,6 +511,18 @@ fi echo "export DCS_SERVERS_PARM=\"$DCS_SERVERS_PARM\"" >> $LOCAL_TRAF_CONFIG #============================================== +#Get the node name where the customer would like to start DcsMaster process + +echo -n "Specify the node of DcsMaster process, default [$DCS_PRIMARY_MASTER_NODE]: " +read answer + +if [ ! -z $answer ]; then + DCS_PRIMARY_MASTER_NODE="$answer" +fi + +echo "export DCS_PRIMARY_MASTER_NODE=\"$DCS_PRIMARY_MASTER_NODE\"" >> $LOCAL_TRAF_CONFIG + +#============================================== #Enable HA echo -n "Enable High Availability (Y/N), default is N: " @@ -490,65 +541,44 @@ fi echo "export ENABLE_HA=\"$ENABLE_HA\"" >> $LOCAL_TRAF_CONFIG #============================================== -#Add Floating IP if HA Enabled +#Get the floating IP address, interface name and the list of backup nodes to be used if [[ "$ENABLE_HA" == "true" ]]; then - echo -n "Enter Floating IP address for DCS HA, default [$FLOATING_IP]: " - read answer + ######Get the floating IP address + echo -n "Enter floating IP address for setting up HA: " + read answer1 - if [ -z $answer ]; then - if [[ -z $FLOATING_IP ]]; then - echo "***ERROR: Floating IP address not given." - echo "***ERROR: Install will continue but WITHOUT High Availability" - echo "***ERROR: HA can be configured later, or kill this script and start over." - sed -i '/ENABLE_HA\=/d' $LOCAL_TRAF_CONFIG - echo "export ENABLE_HA=\"false\"" >> $LOCAL_TRAF_CONFIG - fi + if [[ -z $answer1 ]]; then + echo "Floating IP address must be specified." + exit 1 else - FLOATING_IP="$answer" + FLOATING_IP="$answer1" fi echo "export FLOATING_IP=\"$FLOATING_IP\"" >> $LOCAL_TRAF_CONFIG -fi - -#============================================== -#Add Floating IP if HA Enabled -if [[ "$ENABLE_HA" == "true" ]]; then - echo -n "Enter interface for Floating IP address (example: eth0), default [$INTERFACE]: " - read answer + ######Get the interface used by the floating IP address + echo -n "Enter interface used for floating IP address: " + read answer2 - if [ -z $answer ]; then - if [[ -z $INTERFACE ]]; then - echo "***ERROR: Floating IP interface was not given." - echo "***ERROR: Install will contiune but WITHOUT High Availability" - echo "***ERROR: HA can be configured later, or kill this script and start over." - sed -i '/ENABLE_HA\=/d' $LOCAL_TRAF_CONFIG - echo "export ENABLE_HA=\"false\"" >> $LOCAL_TRAF_CONFIG - fi + if [ -z $answer2 ]; then + echo "Floating IP address interface name must be specified." + exit 1 else - INTERFACE="$answer" + INTERFACE="$answer2" fi echo "export INTERFACE=\"$INTERFACE\"" >> $LOCAL_TRAF_CONFIG -fi -#============================================== -#Add Backup DCS Master nodes if HA Enabled -if [[ "$ENABLE_HA" == "true" ]]; then - echo -n "Enter DCS Backup Master Nodes for DCS HA, default [$BACKUP_DCS_NODES]: " - read answer + ######Get the list of backup nodes to be used + echo -n "Enter backup nodes for HA (blank seperated): " + read answer3 - if [[ -z "$answer" ]]; then - if [[ -z "$BACKUP_DCS_NODES" ]]; then - echo "***ERROR: Backup DCS Nodes not given." - echo "***ERROR: Install will contiune but WITHOUT High Availability" - echo "***ERROR: HA can be configured later, or kill this script and start over." - sed -i '/ENABLE_HA\=/d' $LOCAL_TRAF_CONFIG - echo "export ENABLE_HA=\"false\"" >> $LOCAL_TRAF_CONFIG - fi + if [[ -z "$answer3" ]]; then + echo "Backup nodes must be specified." + exit 1 else - BACKUP_DCS_NODES="$answer" + BACKUP_DCS_NODES="$answer3" fi echo "export BACKUP_DCS_NODES=\"$BACKUP_DCS_NODES\"" >> $LOCAL_TRAF_CONFIG -fi +fi #============================================== #Simple security @@ -645,7 +675,7 @@ if [[ $SCANNER_MODE == "N" ]]; then read answer4 if [[ -z "$answer4" ]]; then if [ -z "$LDAP_LEVEL" ]; then - echo "***ERROR: Much enter LDAP Encryption level." + echo "***ERROR: Must enter LDAP Encryption level." exit -1 fi else http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1cde2505/install/installer/trafodion_install ---------------------------------------------------------------------- diff --git a/install/installer/trafodion_install b/install/installer/trafodion_install index 08a2569..5ddb791 100755 --- a/install/installer/trafodion_install +++ b/install/installer/trafodion_install @@ -782,6 +782,12 @@ if [ ${PIPESTATUS[0]} != "0" ]; then exit -1 fi +# Installing and configuring CLI for Cloud environments +if [[ $CLOUD_CONFIG == "Y" ]]; then + echo "Installing and configure CLI for Cloud ($CLOUD_TYPE)" + $TRAF_WORKDIR/installer/cloud_cli_setup +fi + if [[ $START_ALL == "Y" ]]; then sudo su $TRAF_USER --command "$TRAF_WORKDIR/installer/traf_start" 2>&1 | tee -a $INSTALL_LOG
