You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-09-03 23:42:03 +03:00
@@ -1,2 +1,2 @@
|
||||
|
||||
install(PROGRAMS MCSInstanceCmds.sh MCSVolumeCmds.sh DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
||||
install(PROGRAMS MCSInstanceCmds.sh MCSVolumeCmds.sh MCSgetCredentials.sh DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
||||
|
406
oam/cloud/MCSInstanceCmds.sh
Normal file → Executable file
406
oam/cloud/MCSInstanceCmds.sh
Normal file → Executable file
@@ -8,8 +8,7 @@ prefix=/usr/local
|
||||
|
||||
#check command
|
||||
if [ "$1" = "" ]; then
|
||||
echo "Enter Command Name: {launchInstance|getInstance|getZone|getPrivateIP|getKey|getAMI|getType|terminateInstance|startInstance|assignElasticIP|deassignElasticIP|getProfile|stopInstance|getGroup|getSubnet}
|
||||
}"
|
||||
echo "Enter Command Name: {launchInstance|getInstance|getZone|getPrivateIP|getKey|getAMI|getType|terminateInstance|startInstance|assignElasticIP|deassignElasticIP|getProfile|stopInstance|getGroup|getSubnet|getVpc|getRegion|getRole}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -33,9 +32,9 @@ if [ "$1" = "launchInstance" ]; then
|
||||
instanceType="$3"
|
||||
fi
|
||||
if [ "$4" = "" ]; then
|
||||
group="unassigned"
|
||||
groupid="unassigned"
|
||||
else
|
||||
group="$4"
|
||||
groupid="$4"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -88,163 +87,77 @@ if [ "$1" = "deassignElasticIP" ]; then
|
||||
fi
|
||||
|
||||
|
||||
test -f /usr/local/mariadb/columnstore/post/functions && . /usr/local/mariadb/columnstore/post/functions
|
||||
$prefix/mariadb/columnstore/bin/MCSgetCredentials.sh >/dev/null 2>&1
|
||||
|
||||
ec2=`$prefix/mariadb/columnstore/bin/getConfig Installation EC2_HOME`
|
||||
|
||||
if [ $ec2 == "unassigned" ]; then
|
||||
if [ "$1" = "getPrivateIP" ]; then
|
||||
echo "stopped"
|
||||
exit 1
|
||||
else
|
||||
echo "unknown"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
java=`$prefix/mariadb/columnstore/bin/getConfig Installation JAVA_HOME`
|
||||
path=`$prefix/mariadb/columnstore/bin/getConfig Installation EC2_PATH`
|
||||
|
||||
export PATH=$path
|
||||
export EC2_HOME=$ec2
|
||||
export JAVA_HOME=$java
|
||||
|
||||
# get Keys and region
|
||||
AmazonAccessKeyFile=`$prefix/mariadb/columnstore/bin/getConfig Installation AmazonAccessKey`
|
||||
if [ $AmazonAccessKeyFile == "unassigned" ]; then
|
||||
echo "FAILED: missing Config Setting AmazonAccessKey : $AmazonAccessKeyfile"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
AmazonSecretKeyFile=`$prefix/mariadb/columnstore/bin/getConfig Installation AmazonSecretKey`
|
||||
if [ $AmazonSecretKeyFile == "unassigned" ]; then
|
||||
echo "FAILED: missing Config Setting AmazonSecretKeyFile : $AmazonSecretKeyFile"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
AmazonAccessKey=`cat $AmazonAccessKeyFile`
|
||||
AmazonSecretKey=`cat $AmazonSecretKeyFile`
|
||||
|
||||
Region=`$prefix/mariadb/columnstore/bin/getConfig Installation AmazonRegion`
|
||||
subnet=`$prefix/mariadb/columnstore/bin/getConfig Installation AmazonSubNetID`
|
||||
|
||||
if test ! -f $AmazonAccessKeyfile ; then
|
||||
echo "FAILED: missing AmazonAccessKeyfile : $AmazonAccessKeyfile"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test ! -f $AmazonSecretKeyfile ; then
|
||||
echo "FAILED: missing AmazonSecretKeyfile : $AmazonSecretKeyfile"
|
||||
exit 1
|
||||
fi
|
||||
test -f $prefix//mariadb/columnstore/post/functions && . $prefix//mariadb/columnstore/post/functions
|
||||
|
||||
#default instance to null
|
||||
instance=""
|
||||
|
||||
describeInstanceFile="/tmp/describeInstance.txt"
|
||||
touch $describeInstanceFile
|
||||
AWSCLI="aws ec2 "
|
||||
|
||||
describeInstance() {
|
||||
ec2-describe-instances -O $AmazonAccessKey -W $AmazonSecretKey --region $Region > $describeInstanceFile 2>&1
|
||||
getRegion() {
|
||||
Region=`curl --silent http://169.254.169.254/latest/dynamic/instance-identity/document/region | grep region | cut -d':' -f2 | sed 's/\"//g' | sed 's/\,//g' | sed -e 's/^[ \t]*//'`
|
||||
|
||||
echo $Region
|
||||
return
|
||||
}
|
||||
|
||||
#call at start up
|
||||
describeInstance
|
||||
getRole() {
|
||||
#check for iam folder
|
||||
iam=`curl -s http://169.254.169.254/latest/meta-data/ | grep iam`
|
||||
|
||||
if [ -z "$iam" ]; then
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
Role=`curl -s http://169.254.169.254/latest/meta-data/iam/security-credentials/`
|
||||
|
||||
if [ -z "$Role" ]; then
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
echo $Role
|
||||
return
|
||||
}
|
||||
|
||||
getInstance() {
|
||||
if [ "$instance" != "" ]; then
|
||||
echo $instance
|
||||
if [ "$instanceName" != "" ]; then
|
||||
echo $instanceName
|
||||
return
|
||||
fi
|
||||
|
||||
# first get local IP Address
|
||||
localIP=`ifconfig eth0 | grep -m 1 "inet" | awk '{print substr($2,0,20)}'`
|
||||
|
||||
#get local Instance ID
|
||||
instance=`cat $describeInstanceFile | grep -m 1 -w $localIP | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $2}'`
|
||||
if [ "$instance" == "" ]; then
|
||||
describeInstance
|
||||
fi
|
||||
instance=`cat $describeInstanceFile | grep -m 1 -w $localIP | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $2}'`
|
||||
|
||||
echo $instance
|
||||
return
|
||||
}
|
||||
|
||||
getInstancePrivate() {
|
||||
if [ "$instance" != "" ]; then
|
||||
echo $instance
|
||||
return
|
||||
fi
|
||||
|
||||
# first get local IP Address
|
||||
localIP=`ifconfig eth0 | grep -m 1 "inet" | awk '{print substr($2,0,20)}'`
|
||||
|
||||
#get local Instance ID
|
||||
instance=`cat $describeInstanceFile | grep -m 1 -w $localIP | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $2}'`
|
||||
if [ "$instance" == "" ]; then
|
||||
describeInstance
|
||||
fi
|
||||
instance=`cat $describeInstanceFile | grep -m 1 -w $localIP | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $2}'`
|
||||
instanceName=`curl -s http://169.254.169.254/latest/meta-data/instance-id`
|
||||
|
||||
echo $instanceName
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
getZone() {
|
||||
#get from Columnstore.xml if it's there, if not, get from instance then store
|
||||
zone=`$prefix/mariadb/columnstore/bin/getConfig Installation AmazonZone`
|
||||
|
||||
if [ "$zone" = "unassigned" ] || [ "$zone" = "" ]; then
|
||||
#get local Instance ID
|
||||
getInstancePrivate >/dev/null 2>&1
|
||||
#get zone
|
||||
if [ "$subnet" == "unassigned" ]; then
|
||||
zone=`cat $describeInstanceFile | grep -m 1 $instance | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $11}'`
|
||||
if [ "$zone" == "" ]; then
|
||||
describeInstance
|
||||
fi
|
||||
zone=`cat $describeInstanceFile | grep -m 1 $instance | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $11}'`
|
||||
|
||||
else
|
||||
zone=`cat $describeInstanceFile | grep -m 1 $instance | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $11}'`
|
||||
if [ "$zone" == "" ]; then
|
||||
describeInstance
|
||||
fi
|
||||
zone=`cat $describeInstanceFile | grep -m 1 $instance | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $11}'`
|
||||
fi
|
||||
$prefix/mariadb/columnstore/bin/setConfig Installation AmazonZone $zone
|
||||
fi
|
||||
zone=`curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone`
|
||||
|
||||
echo $zone
|
||||
return
|
||||
}
|
||||
|
||||
getPrivateIP() {
|
||||
#get instance info
|
||||
grep -B1 -A4 -m 1 $instanceName $describeInstanceFile > /tmp/instanceInfo_$instanceName 2>&1
|
||||
if [ `cat /tmp/instanceInfo_$instanceName | wc -c` -eq 0 ]; then
|
||||
describeInstance
|
||||
fi
|
||||
grep -B1 -A4 -m 1 $instanceName $describeInstanceFile > /tmp/instanceInfo_$instanceName 2>&1
|
||||
#get region
|
||||
getRegion >/dev/null 2>&1
|
||||
|
||||
#check if running or terminated
|
||||
cat /tmp/instanceInfo_$instanceName | grep running > /tmp/instanceStatus_$instanceName
|
||||
if [ `cat /tmp/instanceStatus_$instanceName | wc -c` -eq 0 ]; then
|
||||
state=`aws ec2 describe-instances --instance-ids $instanceName --region $Region --output text --query 'Reservations[*].Instances[*].State.Name'`
|
||||
if [ "$state" != "running" ]; then
|
||||
# not running
|
||||
cat /tmp/instanceInfo_$instanceName | grep pending > /tmp/instanceStatus_$instanceName
|
||||
if [ `cat /tmp/instanceStatus_$instanceName | wc -c` -ne 0 ]; then
|
||||
describeInstance
|
||||
if [ "$state" != "stopped" ]; then
|
||||
echo "stopped"
|
||||
exit 1
|
||||
else
|
||||
cat /tmp/instanceInfo_$instanceName | grep terminated > /tmp/instanceStatus_$instanceName
|
||||
if [ `cat /tmp/instanceStatus_$instanceName | wc -c` -ne 0 ]; then
|
||||
if [ "$state" != "terminated" ]; then
|
||||
echo "terminated"
|
||||
exit 1
|
||||
else
|
||||
cat /tmp/instanceInfo_$instanceName | grep shutting-down > /tmp/instanceStatus_$instanceName
|
||||
if [ `cat /tmp/instanceStatus_$instanceName | wc -c` -ne 0 ]; then
|
||||
if [ "$state" != "shutting-down" ]; then
|
||||
echo "terminated"
|
||||
exit 1
|
||||
else
|
||||
@@ -256,11 +169,7 @@ getPrivateIP() {
|
||||
fi
|
||||
|
||||
#running, get priviate IP Address
|
||||
if [ "$subnet" == "unassigned" ]; then
|
||||
IpAddr=`head -n 2 /tmp/instanceInfo_$instanceName | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $14}'`
|
||||
else
|
||||
IpAddr=`head -n 2 /tmp/instanceInfo_$instanceName | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $14}'`
|
||||
fi
|
||||
IpAddr=`aws ec2 describe-instances --instance-ids $instanceName --region $Region --output text --query 'Reservations[*].Instances[*].PrivateIpAddress'`
|
||||
|
||||
echo $IpAddr
|
||||
exit 0
|
||||
@@ -268,195 +177,155 @@ getPrivateIP() {
|
||||
|
||||
getType() {
|
||||
#get local Instance ID
|
||||
getInstancePrivate >/dev/null 2>&1
|
||||
#get Type
|
||||
if [ "$subnet" == "unassigned" ]; then
|
||||
instanceType=`cat $describeInstanceFile | grep -m 1 $instance | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $9}'`
|
||||
if [ "$instanceType" == "" ]; then
|
||||
describeInstance
|
||||
fi
|
||||
instanceType=`cat $describeInstanceFile | grep -m 1 $instance | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $9}'`
|
||||
|
||||
else
|
||||
instanceType=`cat $describeInstanceFile | grep -m 1 $instance | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $9}'`
|
||||
if [ "$instanceType" == "" ]; then
|
||||
describeInstance
|
||||
fi
|
||||
instanceType=`cat $describeInstanceFile | grep -m 1 $instance | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $9}'`
|
||||
|
||||
fi
|
||||
instanceType=`curl -s http://169.254.169.254/latest/meta-data/instance-type`
|
||||
|
||||
echo $instanceType
|
||||
return
|
||||
}
|
||||
|
||||
getKey() {
|
||||
#get region
|
||||
getRegion >/dev/null 2>&1
|
||||
|
||||
#get local Instance ID
|
||||
getInstancePrivate >/dev/null 2>&1
|
||||
#get Key
|
||||
if [ "$subnet" == "unassigned" ]; then
|
||||
key=`cat $describeInstanceFile | grep -m 1 $instance | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $7}'`
|
||||
if [ "$key" == "" ]; then
|
||||
describeInstance
|
||||
fi
|
||||
key=`cat $describeInstanceFile | grep -m 1 $instance | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $7}'`
|
||||
getInstance >/dev/null 2>&1
|
||||
|
||||
else
|
||||
key=`cat $describeInstanceFile | grep -m 1 $instance | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $7}'`
|
||||
if [ "$key" == "" ]; then
|
||||
describeInstance
|
||||
fi
|
||||
key=`cat $describeInstanceFile | grep -m 1 $instance | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $7}'`
|
||||
|
||||
fi
|
||||
key=`aws ec2 describe-instances --instance-ids $instanceName --region $Region --output text --query 'Reservations[*].Instances[*].KeyName'`
|
||||
|
||||
echo $key
|
||||
return
|
||||
}
|
||||
|
||||
getVpc() {
|
||||
#get region
|
||||
getRegion >/dev/null 2>&1
|
||||
|
||||
#get local Instance ID
|
||||
getInstance >/dev/null 2>&1
|
||||
|
||||
#get VCP
|
||||
vpc=`aws ec2 describe-instances --instance-ids $instanceName --output text --region $Region --query 'Reservations[*].Instances[*].VpcId'`
|
||||
|
||||
echo $vpc
|
||||
return
|
||||
}
|
||||
|
||||
getAMI() {
|
||||
#get local Instance ID
|
||||
getInstancePrivate >/dev/null 2>&1
|
||||
#get AMI
|
||||
ami=`cat $describeInstanceFile | grep -m 1 $instance | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $3}'`
|
||||
if [ "$ami" == "" ]; then
|
||||
describeInstance
|
||||
fi
|
||||
ami=`cat $describeInstanceFile | grep -m 1 $instance | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $3}'`
|
||||
ami=`curl -s http://169.254.169.254/latest/meta-data/ami-id`
|
||||
|
||||
echo $ami
|
||||
return
|
||||
}
|
||||
|
||||
getGroup() {
|
||||
#get local Instance ID
|
||||
getInstancePrivate >/dev/null 2>&1
|
||||
#get group
|
||||
if [ "$subnet" == "unassigned" ]; then
|
||||
group=`grep -B1 -A4 -m 1 $instance $describeInstanceFile | grep -m 1 RESERVATION | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $4}'`
|
||||
if [ "$group" == "" ]; then
|
||||
describeInstance
|
||||
fi
|
||||
group=`grep -B1 -A4 -m 1 $instance $describeInstanceFile | grep -m 1 RESERVATION | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $4}'`
|
||||
if [ "$group" == "" ]; then
|
||||
group=`grep -B1 -A4 -m 1 $instance $describeInstanceFile | grep -m 1 INSTANCE | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $21}'`
|
||||
fi
|
||||
else
|
||||
group=`grep -B1 -A6 -m 1 $instance $describeInstanceFile | grep -m 1 GROUP | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $2}'`
|
||||
if [ "$group" == "" ]; then
|
||||
describeInstance
|
||||
fi
|
||||
group=`grep -B1 -A6 -m 1 $instance $describeInstanceFile | grep -m 1 GROUP | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $2}'`
|
||||
if [ "$group" == "" ]; then
|
||||
group=`grep -B1 -A4 -m 1 $instance $describeInstanceFile | grep -m 1 INSTANCE | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $21}'`
|
||||
fi
|
||||
fi
|
||||
#get region
|
||||
getRegion >/dev/null 2>&1
|
||||
|
||||
echo $group
|
||||
#get group id
|
||||
groupid=`aws ec2 describe-instances --instance-ids $instanceName --region $Region --output text --query 'Reservations[*].Instances[*].SecurityGroups[*].GroupId' | grep -m 1 sg`
|
||||
echo $groupid
|
||||
return
|
||||
}
|
||||
|
||||
getProfile() {
|
||||
#get local Instance ID
|
||||
getInstancePrivate >/dev/null 2>&1
|
||||
#get Type
|
||||
if [ "$subnet" == "unassigned" ]; then
|
||||
instanceProfile=`cat $describeInstanceFile | grep -m 1 $instance | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $23}'`
|
||||
if [ "$instanceProfile" == "" ]; then
|
||||
describeInstance
|
||||
fi
|
||||
instanceProfile=`cat $describeInstanceFile | grep -m 1 $instance | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $23}'`
|
||||
#get region
|
||||
getRegion >/dev/null 2>&1
|
||||
|
||||
else
|
||||
instanceProfile=`cat $describeInstanceFile | grep -m 1 $instance | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $22}'`
|
||||
if [ "$instanceProfile" == "" ]; then
|
||||
describeInstance
|
||||
fi
|
||||
instanceProfile=`cat $describeInstanceFile | grep -m 1 $instance | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $22}'`
|
||||
|
||||
fi
|
||||
# get profile
|
||||
instanceProfile=`curl -s http://169.254.169.254/latest/meta-data/profile`
|
||||
|
||||
echo $instanceProfile
|
||||
return
|
||||
}
|
||||
|
||||
launchInstance() {
|
||||
#get region
|
||||
getRegion >/dev/null 2>&1
|
||||
|
||||
#get publickey
|
||||
getKey >/dev/null 2>&1
|
||||
if [ "$group" = "unassigned" ]; then
|
||||
if [ "$groupid" = "unassigned" ]; then
|
||||
#get group
|
||||
getGroup >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
#get AMI
|
||||
getAMI >/dev/null 2>&1
|
||||
|
||||
#get Zone
|
||||
getZone >/dev/null 2>&1
|
||||
if [ "$instanceType" = "unassigned" ]; then
|
||||
#get type
|
||||
getType >/dev/null 2>&1
|
||||
fi
|
||||
#get AMI Profile
|
||||
getProfile >/dev/null 2>&1
|
||||
|
||||
if [ "$subnet" == "unassigned" ]; then
|
||||
#NOT VPC
|
||||
if [ "$instanceProfile" = "" ] || [ "$instanceProfile" = "default" ]; then
|
||||
newInstance=`ec2-run-instances -O $AmazonAccessKey -W $AmazonSecretKey -k $key -g $group -t $instanceType -z $zone --region $Region $ami | grep -m 1 INSTANCE | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $2}'`
|
||||
#get Subnet
|
||||
getSubnet >/dev/null 2>&1
|
||||
|
||||
#get IAM Role
|
||||
getRole >/dev/null 2>&1
|
||||
|
||||
if [ "$Role" = "" ] || [ "$Role" = "default" ]; then
|
||||
if [ "$groupid" != "default" ]; then
|
||||
if [ "$IPaddress" = "autoassign" ] || [ "$IPaddress" = "unassigned" ] ; then
|
||||
newInstance=`$AWSCLI run-instances --region $Region --key-name $key --instance-type $instanceType --placement AvailabilityZone=$zone --subnet-id $subnet --image-id $ami --security-group-ids $groupid --query 'Instances[*].InstanceId' --output text`
|
||||
else
|
||||
newInstance=`ec2-run-instances -O $AmazonAccessKey -W $AmazonSecretKey -k $key -g $group -t $instanceType -z $zone -p $instanceProfile --region $Region $ami | grep -m 1 INSTANCE | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $2}'`
|
||||
fi
|
||||
else # VPC
|
||||
if [ "$instanceProfile" = "" ] || [ "$instanceProfile" = "default" ]; then
|
||||
if [ "$group" != "default" ]; then
|
||||
if [ "$IPaddress" = "autoassign" ]; then
|
||||
newInstance=`ec2-run-instances -O $AmazonAccessKey -W $AmazonSecretKey -k $key -g $group -t $instanceType -z $zone --region $Region -s $subnet $ami | grep -m 1 INSTANCE | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $2}'`
|
||||
else
|
||||
newInstance=`ec2-run-instances -O $AmazonAccessKey -W $AmazonSecretKey -k $key -g $group -t $instanceType -z $zone --region $Region -s $subnet --private-ip-address $IPaddress $ami | grep -m 1 INSTANCE | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $2}'`
|
||||
newInstance=`$AWSCLI run-instances --region $Region --key-name $key --instance-type $instanceType --placement AvailabilityZone=$zone --subnet-id $subnet --private-ip-address $IPaddress --image-id $ami --query 'Instances[*].InstanceId' --output text`
|
||||
fi
|
||||
else
|
||||
if [ "$IPaddress" = "autoassign" ]; then
|
||||
newInstance=`ec2-run-instances -O $AmazonAccessKey -W $AmazonSecretKey -k $key -t $instanceType -z $zone --region $Region -s $subnet $ami | grep -m 1 INSTANCE | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $2}'`
|
||||
if [ "$IPaddress" = "autoassign" ] || [ "$IPaddress" = "unassigned" ]; then
|
||||
newInstance=`$AWSCLI run-instances --region $Region --key-name $key --instance-type $instanceType --placement AvailabilityZone=$zone --subnet-id $subnet --image-id $ami --query 'Instances[*].InstanceId' --output text`
|
||||
else
|
||||
newInstance=`ec2-run-instances --O $AmazonAccessKey -W $AmazonSecretKey -k $key -t $instanceType -z $zone --region $Region -s $subnet --private-ip-address $IPaddress $ami | grep -m 1 INSTANCE | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $2}'`
|
||||
newInstance=`$AWSCLI run-instances --region $Region --key-name $key --instance-type $instanceType --placement AvailabilityZone=$zone --subnet-id $subnet --private-ip-address $IPaddress --image-id $ami --query 'Instances[*].InstanceId' --output text`
|
||||
fi
|
||||
fi
|
||||
else
|
||||
if [ "$group" != "default" ]; then
|
||||
if [ "$IPaddress" = "autoassign" ]; then
|
||||
newInstance=`ec2-run-instances -O $AmazonAccessKey -W $AmazonSecretKey -k $key -g $group -t $instanceType -z $zone -p $instanceProfile --region $Region -s $subnet $ami | grep -m 1 INSTANCE | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $2}'`
|
||||
if [ "$groupid" != "default" ]; then
|
||||
if [ "$IPaddress" = "autoassign" ] || [ "$IPaddress" = "unassigned" ]; then
|
||||
newInstance=`$AWSCLI run-instances --region $Region --key-name $key --instance-type $instanceType --placement AvailabilityZone=$zone --iam-instance-profile "Name=$Role" --subnet-id $subnet --image-id $ami --security-group-ids $groupid --query 'Instances[*].InstanceId' --output text`
|
||||
else
|
||||
newInstance=`ec2-run-instances -O $AmazonAccessKey -W $AmazonSecretKey -k $key -g $group -t $instanceType -z $zone -p $instanceProfile --region $Region -s $subnet --private-ip-address $IPaddress $ami | grep -m 1 INSTANCE | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $2}'`
|
||||
newInstance=`$AWSCLI run-instances --region $Region --key-name $key --instance-type $instanceType --placement AvailabilityZone=$zone --iam-instance-profile "Name=$Role" --subnet-id $subnet --private-ip-address $IPaddress --image-id $ami --security-group-ids $groupid --query 'Instances[*].InstanceId' --output text`
|
||||
fi
|
||||
else
|
||||
if [ "$IPaddress" = "autoassign" ]; then
|
||||
newInstance=`ec2-run-instances -O $AmazonAccessKey -W $AmazonSecretKey -k $key -t $instanceType -z $zone -p $instanceProfile --region $Region -s $subnet $ami | grep -m 1 INSTANCE | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $2}'`
|
||||
if [ "$IPaddress" = "autoassign" ] || [ "$IPaddress" = "unassigned" ]; then
|
||||
newInstance=`$AWSCLI run-instances --region $Region --key-name $key --instance-type $instanceType --placement AvailabilityZone=$zone --iam-instance-profile "Name=$Role" --subnet-id $subnet --image-id $ami --query 'Instances[*].InstanceId' --output text`
|
||||
else
|
||||
newInstance=`ec2-run-instances -O $AmazonAccessKey -W $AmazonSecretKey -k $key -t $instanceType -z $zone -p $instanceProfile --region $Region -s $subnet --private-ip-address $IPaddress $ami | grep -m 1 INSTANCE | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $2}'`
|
||||
fi
|
||||
newInstance=`$AWSCLI run-instances --region $Region --key-name $key --instance-type $instanceType --placement AvailabilityZone=$zone --iam-instance-profile "Name=$Role" --subnet-id $subnet --private-ip-address $IPaddress --image-id $ami --query 'Instances[*].InstanceId' --output text`
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
echo $newInstance
|
||||
return
|
||||
}
|
||||
|
||||
terminateInstance() {
|
||||
#get region
|
||||
getRegion >/dev/null 2>&1
|
||||
|
||||
#terminate Instance
|
||||
ec2-terminate-instances -O $AmazonAccessKey -W $AmazonSecretKey --region $Region $instanceName > /tmp/termInstanceInfo_$instanceName 2>&1
|
||||
$AWSCLI terminate-instances --instance-ids $instanceName --region $Region > /tmp/termInstanceInfo_$instanceName 2>&1
|
||||
return
|
||||
}
|
||||
|
||||
stopInstance() {
|
||||
#get region
|
||||
getRegion >/dev/null 2>&1
|
||||
|
||||
#terminate Instance
|
||||
ec2-stop-instances -O $AmazonAccessKey -W $AmazonSecretKey --region $Region $instanceName > /tmp/stopInstanceInfo_$instanceName 2>&1
|
||||
$AWSCLI stop-instances --instance-ids $instanceName --region $Region > /tmp/stopInstanceInfo_$instanceName 2>&1
|
||||
return
|
||||
}
|
||||
|
||||
startInstance() {
|
||||
#terminate Instance
|
||||
ec2-start-instances -O $AmazonAccessKey -W $AmazonSecretKey --region $Region $instanceName > /tmp/startInstanceInfo_$instanceName 2>&1
|
||||
#get region
|
||||
getRegion >/dev/null 2>&1
|
||||
|
||||
cat /tmp/startInstanceInfo_$instanceName | grep INSTANCE > /tmp/startInstanceStatus_$instanceName
|
||||
#terminate Instance
|
||||
$AWSCLI start-instances --instance-ids $instanceName --region $Region > /tmp/startInstanceInfo_$instanceName 2>&1
|
||||
|
||||
cat /tmp/startInstanceInfo_$instanceName | grep InstanceId > /tmp/startInstanceStatus_$instanceName
|
||||
if [ `cat /tmp/startInstanceStatus_$instanceName | wc -c` -eq 0 ]; then
|
||||
echo "Failed, check /tmp/startInstanceInfo_$instanceName"
|
||||
exit 1
|
||||
@@ -466,17 +335,15 @@ startInstance() {
|
||||
}
|
||||
|
||||
assignElasticIP() {
|
||||
#terminate Instance
|
||||
#get region
|
||||
getRegion >/dev/null 2>&1
|
||||
|
||||
if [ "$subnet" == "unassigned" ]; then
|
||||
ec2-associate-address -O $AmazonAccessKey -W $AmazonSecretKey -i $instanceName $IPAddress > /tmp/assignElasticIPInfo_$IPAddress 2>&1
|
||||
else
|
||||
EIP=`ec2-describe-addresses -O $AmazonAccessKey -W $AmazonSecretKey --region $Region $IPAddress | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $4}'`
|
||||
ec2-associate-address -O $AmazonAccessKey -W $AmazonSecretKey --region $Region -i $instanceName -a $EIP > /tmp/assignElasticIPInfo_$IPAddress 2>&1
|
||||
fi
|
||||
EIP=`$AWSCLI describe-addresses --region $Region --public-ips $IPAddress --query 'Addresses[*].AllocationId' --output text`
|
||||
|
||||
cat /tmp/assignElasticIPInfo_$IPAddress | grep ADDRESS > /tmp/assignElasticIPStatus_$IPAddress
|
||||
if [ `cat /tmp/assignElasticIPStatus_$IPAddress | wc -c` -eq 0 ]; then
|
||||
$AWSCLI associate-address --region $Region --instance-id $instanceName --allocation-id $EIP > /tmp/assignElasticIPInfo_$IPAddress 2>&1
|
||||
|
||||
cat /tmp/assignElasticIPInfo_$IPAddress | grep error > /tmp/assignElasticIPStatus_$IPAddress
|
||||
if [ `cat /tmp/assignElasticIPStatus_$IPAddress | wc -c` -ne 0 ]; then
|
||||
echo "Failed, check /tmp/assignElasticIPInfo_$IPAddress"
|
||||
exit 1
|
||||
fi
|
||||
@@ -486,11 +353,14 @@ assignElasticIP() {
|
||||
}
|
||||
|
||||
deassignElasticIP() {
|
||||
#terminate Instance
|
||||
ec2-disassociate-address -O $AmazonAccessKey -W $AmazonSecretKey $IPAddress > /tmp/deassignElasticIPInfo_$IPAddress 2>&1
|
||||
#get region
|
||||
getRegion >/dev/null 2>&1
|
||||
|
||||
cat /tmp/deassignElasticIPInfo_$IPAddress | grep ADDRESS > /tmp/deassignElasticIPStatus_$IPAddress
|
||||
if [ `cat /tmp/deassignElasticIPStatus_$IPAddress | wc -c` -eq 0 ]; then
|
||||
EIP=`$AWSCLI describe-addresses --region $Region --public-ips $IPAddress --query 'Addresses[*].AssociationId' --output text`
|
||||
|
||||
$AWSCLI disassociate-address --region $Region --association-id $EIP > /tmp/deassignElasticIPInfo_$IPAddress 2>&1
|
||||
cat /tmp/deassignElasticIPInfo_$IPAddress | grep error > /tmp/deassignElasticIPStatus_$IPAddress
|
||||
if [ `cat /tmp/deassignElasticIPStatus_$IPAddress | wc -c` -ne 0 ]; then
|
||||
echo "Failed, check /tmp/deassignElasticIPStatus_$IPAddress"
|
||||
exit 1
|
||||
fi
|
||||
@@ -500,14 +370,13 @@ deassignElasticIP() {
|
||||
}
|
||||
|
||||
getSubnet() {
|
||||
#get region
|
||||
getRegion >/dev/null 2>&1
|
||||
|
||||
#get local Instance ID
|
||||
getInstancePrivate >/dev/null 2>&1
|
||||
getInstance >/dev/null 2>&1
|
||||
#get Subnet
|
||||
subnet=`cat $describeInstanceFile | grep -m 1 $instance | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $16}'`
|
||||
if [ "$subnet" == "" ]; then
|
||||
describeInstance
|
||||
fi
|
||||
subnet=`cat $describeInstanceFile | grep -m 1 $instance | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $16}'`
|
||||
subnet=`aws ec2 describe-instances --instance-ids $instanceName --region $Region --output text --query 'Reservations[*].Instances[*].SubnetId'`
|
||||
|
||||
if [[ $subnet == *"subnet"* ]]
|
||||
then
|
||||
@@ -566,8 +435,17 @@ case "$1" in
|
||||
getSubnet)
|
||||
getSubnet
|
||||
;;
|
||||
getVpc)
|
||||
getVpc
|
||||
;;
|
||||
getRegion)
|
||||
getRegion
|
||||
;;
|
||||
getRole)
|
||||
getRole
|
||||
;;
|
||||
*)
|
||||
echo $"Usage: $0 {launchInstance|getInstance|getZone|getPrivateIP|getType|getKey|getAMI|terminateInstance|startInstance|assignElasticIP|deassignElasticIP|getProfile|stopInstance|getGroup|getSubnet}"
|
||||
echo $"Usage: $0 {launchInstance|getInstance|getZone|getPrivateIP|getType|getKey|getAMI|terminateInstance|startInstance|assignElasticIP|deassignElasticIP|getProfile|stopInstance|getGroup|getSubnet|getVpc|getRegion|getRole}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
|
60
oam/cloud/MCSVolumeCmds.sh
Normal file → Executable file
60
oam/cloud/MCSVolumeCmds.sh
Normal file → Executable file
@@ -95,48 +95,12 @@ fi
|
||||
|
||||
test -f $prefix/mariadb/columnstore/post/functions && . $prefix/mariadb/columnstore/post/functions
|
||||
|
||||
ec2=`$prefix/mariadb/columnstore/bin/getConfig Installation EC2_HOME`
|
||||
AWSCLI="aws ec2 "
|
||||
|
||||
if [ $ec2 == "unassigned" ]; then
|
||||
STATUS="unknown"
|
||||
RETVAL=1
|
||||
fi
|
||||
|
||||
java=`$prefix/mariadb/columnstore/bin/getConfig Installation JAVA_HOME`
|
||||
path=`$prefix/mariadb/columnstore/bin/getConfig Installation EC2_PATH`
|
||||
|
||||
export PATH=$path
|
||||
export EC2_HOME=$ec2
|
||||
export JAVA_HOME=$java
|
||||
|
||||
# get Keys and region
|
||||
AmazonAccessKeyFile=`$prefix/mariadb/columnstore/bin/getConfig Installation AmazonAccessKey`
|
||||
if [ $AmazonAccessKeyFile == "unassigned" ]; then
|
||||
echo "FAILED: missing Config Setting AmazonAccessKey : $AmazonAccessKeyfile"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
AmazonSecretKeyFile=`$prefix/mariadb/columnstore/bin/getConfig Installation AmazonSecretKey`
|
||||
if [ $AmazonSecretKeyFile == "unassigned" ]; then
|
||||
echo "FAILED: missing Config Setting AmazonSecretKeyFile : $AmazonSecretKeyFile"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
AmazonAccessKey=`cat $AmazonAccessKeyFile`
|
||||
AmazonSecretKey=`cat $AmazonSecretKeyFile`
|
||||
|
||||
if test ! -f $AmazonAccessKeyfile ; then
|
||||
echo "FAILED: missing AmazonAccessKeyfile : $AmazonAccessKeyfile"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test ! -f $AmazonSecretKeyfile ; then
|
||||
echo "FAILED: missing AmazonSecretKeyfile : $AmazonSecretKeyfile"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
Region=`$prefix/mariadb/columnstore/bin/getConfig Installation AmazonRegion`
|
||||
$prefix/mariadb/columnstore/bin/MCSgetCredentials.sh >/dev/null 2>&1
|
||||
|
||||
#get Region
|
||||
Region=`$prefix/mariadb/columnstore/bin/MCSInstanceCmds.sh getRegion`
|
||||
|
||||
checkInfostatus() {
|
||||
#check if attached
|
||||
@@ -209,9 +173,9 @@ createvolume() {
|
||||
|
||||
#create volume
|
||||
if [ $volumeType == "io1" ]; then
|
||||
volume=`ec2-create-volume -O $AmazonAccessKey -W $AmazonSecretKey --region $Region -z $zone -s $volumeSize -t $volumeType -iops $volumeIOPS | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $2}'`
|
||||
volume=`$AWSCLI create-volume --region $Region --availability-zone $zone --size $volumeSize --volume-type $volumeType --iops $volumeIOPS --output text --query VolumeId`
|
||||
else
|
||||
volume=`ec2-create-volume -O $AmazonAccessKey -W $AmazonSecretKey --region $Region -z $zone -s $volumeSize -t $volumeType | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $2}'`
|
||||
volume=`$AWSCLI create-volume --region $Region --availability-zone $zone --size $volumeSize --volume-type $volumeType --output text --query VolumeId`
|
||||
fi
|
||||
|
||||
echo $volume
|
||||
@@ -220,7 +184,7 @@ createvolume() {
|
||||
|
||||
describevolume() {
|
||||
#describe volume
|
||||
ec2-describe-volumes -O $AmazonAccessKey -W $AmazonSecretKey --region $Region $volumeName > /tmp/volumeInfo_$volumeName 2>&1
|
||||
$AWSCLI describe-volumes --volume-ids $volumeName --region $Region > /tmp/volumeInfo_$volumeName 2>&1
|
||||
|
||||
checkInfostatus
|
||||
echo $STATUS
|
||||
@@ -229,14 +193,14 @@ describevolume() {
|
||||
|
||||
detachvolume() {
|
||||
#detach volume
|
||||
ec2-detach-volume -O $AmazonAccessKey -W $AmazonSecretKey --region $Region $volumeName > /tmp/volumeInfo_$volumeName 2>&1
|
||||
$AWSCLI detach-volume --volume-id $volumeName --region $Region > /tmp/volumeInfo_$volumeName 2>&1
|
||||
|
||||
checkInfostatus
|
||||
if [ $STATUS == "detaching" ]; then
|
||||
retries=1
|
||||
while [ $retries -ne 60 ]; do
|
||||
#retry until it's attached
|
||||
ec2-detach-volume -O $AmazonAccessKey -W $AmazonSecretKey --region $Region $volumeName > /tmp/volumeInfo_$volumeName 2>&1
|
||||
$AWSCLI detach-volume --volume-id $volumeName --region $Region > /tmp/volumeInfo_$volumeName 2>&1
|
||||
|
||||
checkInfostatus
|
||||
if [ $STATUS == "available" ]; then
|
||||
@@ -266,7 +230,7 @@ detachvolume() {
|
||||
attachvolume() {
|
||||
|
||||
#detach volume
|
||||
ec2-attach-volume -O $AmazonAccessKey -W $AmazonSecretKey --region $Region $volumeName -i $instanceName -d $deviceName > /tmp/volumeInfo_$volumeName 2>&1
|
||||
$AWSCLI attach-volume --volume-id $volumeName --instance-id $instanceName --device $deviceName --region $Region > /tmp/volumeInfo_$volumeName 2>&1
|
||||
|
||||
checkInfostatus
|
||||
if [ $STATUS == "attaching" -o $STATUS == "already-attached" ]; then
|
||||
@@ -300,13 +264,13 @@ attachvolume() {
|
||||
|
||||
deletevolume() {
|
||||
#delete volume
|
||||
ec2-delete-volume -O $AmazonAccessKey -W $AmazonSecretKey --region $Region $volumeName > /tmp/deletevolume_$volumeName 2>&1
|
||||
$AWSCLI delete-volume --volume-id $volumeName --region $Region > /tmp/deletevolume_$volumeName 2>&1
|
||||
return
|
||||
}
|
||||
|
||||
createTag() {
|
||||
#create tag
|
||||
ec2-create-tags -O $AmazonAccessKey -W $AmazonSecretKey --region $Region $resourceName --tag $tagName=$tagValue > /tmp/createTag_$volumeName 2>&1
|
||||
$AWSCLI create-tags --resources $resourceName --tags Key=$tagName,Value=$tagValue --region $Region > /tmp/createTag_$volumeName 2>&1
|
||||
return
|
||||
}
|
||||
|
||||
|
46
oam/cloud/MCSgetCredentials.sh
Normal file
46
oam/cloud/MCSgetCredentials.sh
Normal file
@@ -0,0 +1,46 @@
|
||||
#! /bin/sh
|
||||
# Get Amazon EC2 security-credentials, access and secret access keys
|
||||
#
|
||||
#first check for local versions, then meta-data versions
|
||||
if [ -f $HOME/.aws/credentials ]; then
|
||||
echo "$HOME/.aws/credentials found, use local credentials"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
#get IAM Role
|
||||
#check for iam folder
|
||||
iam=`curl -s http://169.254.169.254/latest/meta-data/ | grep iam`
|
||||
|
||||
if [ -z "$iam" ]; then
|
||||
echo "No IAM in meta-data"
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
Role=`curl -s http://169.254.169.254/latest/meta-data/iam/security-credentials/`
|
||||
|
||||
if [ -z "$Role" ]; then
|
||||
echo "No Role in IAM meta-data"
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
aws_access_key_id=`curl -s http://169.254.169.254/latest/meta-data/iam/security-credentials/${Role} | grep AccessKeyId | cut -d':' -f2 | sed 's/[^0-9A-Z]*//g'`
|
||||
|
||||
if [ -z "$aws_access_key_id" ]; then
|
||||
echo "No Access-Key is blank in IAM meta-data"
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
aws_secret_access_key=`curl -s http://169.254.169.254/latest/meta-data/iam/security-credentials/${Role} | grep SecretAccessKey | cut -d':' -f2 | sed 's/[^0-9A-Za-z/+=]*//g'`
|
||||
|
||||
if [ -z "$aws_secret_access_key" ]; then
|
||||
echo "No Secret-Key is blank in IAM meta-data"
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
|
||||
echo $aws_access_key_id $aws_secret_access_key
|
||||
#
|
||||
export AWS_ACCESS_KEY_ID=${aws_access_key_id}
|
||||
export AWS_SECRET_ACCESS_KEY=${aws_secret_access_key}
|
||||
|
||||
exit 0
|
@@ -443,20 +443,15 @@
|
||||
<SystemLogConfigFile>unassigned</SystemLogConfigFile>
|
||||
<rpw>mariadb1</rpw>
|
||||
<Cloud>unassigned</Cloud>
|
||||
<AmazonAccessKey>unassigned</AmazonAccessKey>
|
||||
<AmazonSecretKey>unassigned</AmazonSecretKey>
|
||||
<AmazonRegion>us-east-1</AmazonRegion>
|
||||
<AmazonZone>unassigned</AmazonZone>
|
||||
<AmazonSubNetID>unassigned</AmazonSubNetID>
|
||||
<AmazonVPCNextPrivateIP>autoassign</AmazonVPCNextPrivateIP>
|
||||
<UMInstanceType>unassigned</UMInstanceType>
|
||||
<UMSecurityGroup>unassigned</UMSecurityGroup>
|
||||
<UMVolumeSize>unassigned</UMVolumeSize>
|
||||
<UMVolumeType>standard</UMVolumeType>
|
||||
<UMVolumeType>gp2</UMVolumeType>
|
||||
<UMVolumeIOPS>unassigned</UMVolumeIOPS>
|
||||
<PMInstanceType>unassigned</PMInstanceType>
|
||||
<PMVolumeSize>unassigned</PMVolumeSize>
|
||||
<PMVolumeType>standard</PMVolumeType>
|
||||
<PMVolumeType>gp2</PMVolumeType>
|
||||
<PMVolumeIOPS>unassigned</PMVolumeIOPS>
|
||||
<AmazonPMFailover>y</AmazonPMFailover>
|
||||
<AmazonAutoTagging>y</AmazonAutoTagging>
|
||||
@@ -467,8 +462,6 @@
|
||||
<GlusterCopies>0</GlusterCopies>
|
||||
<GlusterStorageType>unassigned</GlusterStorageType>
|
||||
<CoreFileFlag>n</CoreFileFlag>
|
||||
<JavaHome>unassigned</JavaHome>
|
||||
<JavaPath>unassigned</JavaPath>
|
||||
<MySQLPort>3306</MySQLPort>
|
||||
<MySQLPasswordConfig>unassigned</MySQLPasswordConfig>
|
||||
<AmazonDeviceName>/dev/xvd</AmazonDeviceName>
|
||||
|
@@ -54,10 +54,10 @@ fi
|
||||
export COLUMNSTORE_INSTALL_DIR=$installdir
|
||||
|
||||
cloud=`$COLUMNSTORE_INSTALL_DIR/bin/getConfig Installation Cloud`
|
||||
if [ $module = "pm" ]; then
|
||||
if [ $cloud = "amazon-ec2" ] || [ $cloud = "amazon-vpc" ]; then
|
||||
cp $COLUMNSTORE_INSTALL_DIR/local/etc/*.pem /root/. > /dev/null 2>&1
|
||||
cp $COLUMNSTORE_INSTALL_DIR/local/etc/*.pem $HOME/. > /dev/null 2>&1
|
||||
|
||||
if [ $module = "pm" ]; then
|
||||
if test -f $COLUMNSTORE_INSTALL_DIR/local/etc/pm1/fstab ; then
|
||||
echo "Setup fstab on Module"
|
||||
touch /etc/fstab
|
||||
|
@@ -249,15 +249,10 @@ if [ $rc1 -ne 0 -a $rc2 -ne 0 ]; then
|
||||
echo " " >> ${bashFile}
|
||||
fi
|
||||
|
||||
#check and get amazon EC2 env variables
|
||||
if [ -n "$EC2_HOME" ]; then
|
||||
$installdir/bin/setConfig -d Installation EC2_HOME $EC2_HOME
|
||||
|
||||
if [ -n "$EC2_HOME" ]; then
|
||||
$installdir/bin/setConfig -d Installation JAVA_HOME $JAVA_HOME
|
||||
fi
|
||||
|
||||
$installdir/bin/setConfig -d Installation EC2_PATH $PATH:/home/ec2/bin:/opt/aws/bin
|
||||
#check and get amazon env variables
|
||||
aws=`which aws 2>/dev/null`
|
||||
if [ -z "aws" ]; then
|
||||
$installdir/bin/MCSgetCredentials.sh >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
#log install message
|
||||
|
@@ -22,7 +22,6 @@ if {[info exists env(USER)]} {
|
||||
|
||||
|
||||
if { $PASSWORD == "ssh" } {
|
||||
set USERNAME ""
|
||||
set PASSWORD ""
|
||||
}
|
||||
|
||||
|
@@ -176,7 +176,7 @@ if [ ! -z "$syslog_conf" ] ; then
|
||||
fi
|
||||
fi
|
||||
|
||||
$SUDO etc/init.d/rsyslog restart > /dev/null 2>&1
|
||||
$SUDO /etc/init.d/rsyslog restart > /dev/null 2>&1
|
||||
$SUDO /etc/init.d/syslog restart > /dev/null 2>&1
|
||||
$SUDO /etc/init.d/syslog-ng restart > /dev/null 2>&1
|
||||
|
||||
@@ -212,7 +212,7 @@ if [ ! -z "$syslog_conf" ] ; then
|
||||
$SUDO rm -f "$syslog_conf"
|
||||
fi
|
||||
|
||||
$SUDO etc/init.d/rsyslog restart > /dev/null 2>&1
|
||||
$SUDO /etc/init.d/rsyslog restart > /dev/null 2>&1
|
||||
$SUDO /etc/init.d/syslog restart > /dev/null 2>&1
|
||||
$SUDO /etc/init.d/syslog-ng restart > /dev/null 2>&1
|
||||
|
||||
|
@@ -5964,9 +5964,23 @@ namespace oam
|
||||
catch(...) {}
|
||||
|
||||
writeLog("addUMdisk - Create new Volume for um" + itoa(moduleID), LOG_TYPE_DEBUG);
|
||||
|
||||
cout << " Create AWS Volume for UM #" << itoa(moduleID) << endl;
|
||||
|
||||
int retry = 0;
|
||||
for ( ; retry < 5 ; retry++ )
|
||||
{
|
||||
volumeName = createEC2Volume(UMVolumeSize, "um");
|
||||
if ( volumeName == "failed" ) {
|
||||
writeLog("addModule: create volume failed", LOG_TYPE_CRITICAL);
|
||||
|
||||
if ( volumeName == "failed" || volumeName.empty() )
|
||||
retry = retry;
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
if ( retry >= 5 )
|
||||
{
|
||||
cout << " *** ERROR: Failed to create a Volume for um1 " << moduleID << endl;
|
||||
exceptionControl("addUMdisk", API_FAILURE);
|
||||
}
|
||||
|
||||
@@ -5977,13 +5991,25 @@ namespace oam
|
||||
|
||||
//attach volumes to local instance
|
||||
writeLog("addUMdisk - Attach new Volume to local instance: " + volumeName, LOG_TYPE_DEBUG);
|
||||
if (!attachEC2Volume(volumeName, device, localInstance)) {
|
||||
writeLog("addUMdisk: volume failed to attach to local instance", LOG_TYPE_CRITICAL);
|
||||
|
||||
retry = 0;
|
||||
for ( ; retry < 5 ; retry++ )
|
||||
{
|
||||
if (!attachEC2Volume(volumeName, device, localInstance))
|
||||
detachEC2Volume(volumeName);
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
if ( retry >= 5 )
|
||||
{
|
||||
cout << " *** ERROR: Volume " << volumeName << " failed to attach to local instance" << endl;
|
||||
exceptionControl("addUMdisk", API_FAILURE);
|
||||
}
|
||||
|
||||
//format attached volume
|
||||
writeLog("addUMdisk - Format new Volume for: " + volumeName, LOG_TYPE_DEBUG);
|
||||
cout << " Formatting disk for UM #" << itoa(moduleID) << ", please wait..." << endl;
|
||||
|
||||
string cmd;
|
||||
int user;
|
||||
|
@@ -176,7 +176,7 @@ bool waitForStop()
|
||||
//------------------------------------------------------------------------------
|
||||
void handleSigTerm(int i)
|
||||
{
|
||||
std::cout << "Received SIGTERM to terminate MariaDB Columnstore Console..." << std::endl;
|
||||
std::cout << "Received SIGTERM to terminate MariaDB ColumnStore Console..." << std::endl;
|
||||
|
||||
}
|
||||
|
||||
@@ -336,9 +336,9 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
else
|
||||
{
|
||||
cout << endl << "MariaDB Columnstore Admin Console" << endl;
|
||||
cout << endl << "MariaDB ColumnStore Admin Console" << endl;
|
||||
cout << " enter 'help' for list of commands" << endl;
|
||||
cout << " enter 'exit' to exit the MariaDB Columnstore Command Console" << endl;
|
||||
cout << " enter 'exit' to exit the MariaDB ColumnStore Command Console" << endl;
|
||||
cout << " use up/down arrows to recall commands" << endl << endl;
|
||||
|
||||
// output current active alarm stats
|
||||
@@ -707,7 +707,7 @@ int processCommand(string* arguments)
|
||||
// close the log file
|
||||
writeLog("End of a command session!!!");
|
||||
logFile.close();
|
||||
cout << "Exiting the MariaDB Columnstore Admin Console" << endl;
|
||||
cout << "Exiting the MariaDB ColumnStore Admin Console" << endl;
|
||||
|
||||
exit (0);
|
||||
}
|
||||
@@ -2148,7 +2148,7 @@ int processCommand(string* arguments)
|
||||
break;
|
||||
}
|
||||
|
||||
cout << endl << "This command stops the processing of applications on all Modules within the MariaDB Columnstore System" << endl;
|
||||
cout << endl << "This command stops the processing of applications on all Modules within the MariaDB ColumnStore System" << endl;
|
||||
|
||||
try
|
||||
{
|
||||
@@ -2265,7 +2265,7 @@ int processCommand(string* arguments)
|
||||
bool bDBRMReady = dbrm.isDBRMReady();
|
||||
getFlags(arguments, gracefulTemp, ackTemp, suspendAnswer, bNeedsConfirm);
|
||||
|
||||
cout << endl << "This command stops the processing of applications on all Modules within the MariaDB Columnstore System" << endl;
|
||||
cout << endl << "This command stops the processing of applications on all Modules within the MariaDB ColumnStore System" << endl;
|
||||
|
||||
try
|
||||
{
|
||||
@@ -2367,7 +2367,7 @@ int processCommand(string* arguments)
|
||||
cmd = "pdsh -a '/" + startup::StartUp::installDir() + "/bin/columnstore stop' > /tmp/cc-stop.pdsh 2>&1";
|
||||
system(cmd.c_str());
|
||||
if (oam.checkLogStatus("/tmp/cc-stop.pdsh", "exit") ) {
|
||||
cout << endl << "ERROR: Stopping MariaDB Columnstore Service failure, check /tmp/cc-stop.pdsh. exit..." << endl;
|
||||
cout << endl << "ERROR: Stopping MariaDB ColumnStore Service failure, check /tmp/cc-stop.pdsh. exit..." << endl;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -2412,7 +2412,7 @@ int processCommand(string* arguments)
|
||||
cmd = "pdsh -a '" + startup::StartUp::installDir() + "/bin/columnstore stop' > /tmp/cc-stop.pdsh 2>&1";
|
||||
system(cmd.c_str());
|
||||
if (oam.checkLogStatus("/tmp/cc-stop.pdsh", "exit") ) {
|
||||
cout << endl << "ERROR: Stopping MariaDB Columnstore Service failure, check /tmp/cc-stop.pdsh. exit..." << endl;
|
||||
cout << endl << "ERROR: Stopping MariaDB ColumnStore Service failure, check /tmp/cc-stop.pdsh. exit..." << endl;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -2508,7 +2508,7 @@ int processCommand(string* arguments)
|
||||
cmd = "pdsh -a '" + startup::StartUp::installDir() + "/bin/columnstore restart' > /tmp/cc-restart.pdsh 2>&1";
|
||||
system(cmd.c_str());
|
||||
if (oam.checkLogStatus("/tmp/cc-restart.pdsh", "exit") ) {
|
||||
cout << endl << "ERROR: Restart MariaDB Columnstore Service failure, check /tmp/cc-restart.pdsh. exit..." << endl;
|
||||
cout << endl << "ERROR: Restart MariaDB ColumnStore Service failure, check /tmp/cc-restart.pdsh. exit..." << endl;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -2727,7 +2727,7 @@ int processCommand(string* arguments)
|
||||
cmd = "pdsh -a '" + startup::StartUp::installDir() + "/bin/columnstore restart' > /tmp/cc-restart.pdsh 2>&1";
|
||||
system(cmd.c_str());
|
||||
if (oam.checkLogStatus("/tmp/cc-restart.pdsh", "exit") ) {
|
||||
cout << endl << "ERROR: Restart MariaDB Columnstore Service failue, check /tmp/cc-restart.pdsh. exit..." << endl;
|
||||
cout << endl << "ERROR: Restart MariaDB ColumnStore Service failue, check /tmp/cc-restart.pdsh. exit..." << endl;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -3414,7 +3414,7 @@ int processCommand(string* arguments)
|
||||
|
||||
if ( MySQLRep == "y" && MySQLPasswordConfig == oam::UnassignedName ) {
|
||||
cout << endl;
|
||||
string prompt = "MariaDB Columnstore Replication is enabled, is there a 'MariaDB Columnstore' Password configured in " + HOME + "/.my.cnf (y,n): ";
|
||||
string prompt = "MariaDB ColumnStore Replication is enabled, is there a 'MariaDB ColumnStore' Password configured in " + HOME + "/.my.cnf (y,n): ";
|
||||
MySQLPasswordConfig = dataPrompt(prompt);
|
||||
}
|
||||
|
||||
@@ -3582,7 +3582,7 @@ int processCommand(string* arguments)
|
||||
string configFileName;
|
||||
oam.getSystemConfig("SystemLogConfigFile", configFileName);
|
||||
|
||||
cout << endl << "MariaDB Columnstore System Log Configuration Data" << endl << endl;
|
||||
cout << endl << "MariaDB ColumnStore System Log Configuration Data" << endl << endl;
|
||||
|
||||
cout << "System Logging Configuration File being used: " << configFileName << endl << endl;
|
||||
|
||||
@@ -3903,7 +3903,7 @@ int processCommand(string* arguments)
|
||||
BRM::DBRM dbrm;
|
||||
getFlags(arguments, gracefulTemp, ackTemp, suspendAnswer, bNeedsConfirm);
|
||||
|
||||
cout << endl << "This command suspends the DDL/DML writes to the MariaDB Columnstore Database" << endl;
|
||||
cout << endl << "This command suspends the DDL/DML writes to the MariaDB ColumnStore Database" << endl;
|
||||
try
|
||||
{
|
||||
|
||||
@@ -3984,7 +3984,7 @@ int processCommand(string* arguments)
|
||||
break;
|
||||
}
|
||||
|
||||
// stop writes to MariaDB Columnstore Database
|
||||
// stop writes to MariaDB ColumnStore Database
|
||||
oam.SuspendWrites(gracefulTemp, ackTemp);
|
||||
}
|
||||
catch (exception& e)
|
||||
@@ -4002,11 +4002,11 @@ int processCommand(string* arguments)
|
||||
case 33: // resumeDatabaseWrites
|
||||
{
|
||||
if ( arguments[1] != "y" ) {
|
||||
if (confirmPrompt("This command resumes the DDL/DML writes to the MariaDB Columnstore Database"))
|
||||
if (confirmPrompt("This command resumes the DDL/DML writes to the MariaDB ColumnStore Database"))
|
||||
break;
|
||||
}
|
||||
|
||||
// resume writes to MariaDB Columnstore Database
|
||||
// resume writes to MariaDB ColumnStore Database
|
||||
|
||||
try{
|
||||
SystemProcessStatus systemprocessstatus;
|
||||
@@ -4031,7 +4031,7 @@ int processCommand(string* arguments)
|
||||
}
|
||||
}
|
||||
oam.setSystemStatus(ACTIVE);
|
||||
cout << endl << "Resume MariaDB Columnstore Database Writes Request successfully completed" << endl;
|
||||
cout << endl << "Resume MariaDB ColumnStore Database Writes Request successfully completed" << endl;
|
||||
}
|
||||
catch (exception& e)
|
||||
{
|
||||
@@ -4593,7 +4593,7 @@ int processCommand(string* arguments)
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
cout << "ERROR: Problem setting AmazonElasticModule in the MariaDB Columnstore System Configuration file" << endl;
|
||||
cout << "ERROR: Problem setting AmazonElasticModule in the MariaDB ColumnStore System Configuration file" << endl;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -4707,7 +4707,7 @@ int processCommand(string* arguments)
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
cout << "ERROR: Problem setting AmazonElasticModule in the MariaDB Columnstore System Configuration file" << endl;
|
||||
cout << "ERROR: Problem setting AmazonElasticModule in the MariaDB ColumnStore System Configuration file" << endl;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -4920,16 +4920,6 @@ int processCommand(string* arguments)
|
||||
}
|
||||
catch(...) {}
|
||||
|
||||
if ( cloud == "amazon-vpc" )
|
||||
{
|
||||
string AmazonSubNetID = oam::UnassignedName;
|
||||
try{
|
||||
oam.getSystemConfig("AmazonSubNetID", AmazonSubNetID);
|
||||
|
||||
cout << "AmazonSubNetID = " << AmazonSubNetID << endl;
|
||||
}
|
||||
catch(...) {}
|
||||
}
|
||||
}
|
||||
|
||||
cout << endl;
|
||||
@@ -4946,7 +4936,7 @@ int processCommand(string* arguments)
|
||||
catch(...) {}
|
||||
|
||||
if ( MySQLRep == "y" ) {
|
||||
string warning = "MariaDB Columnstore Replication Feature is already enabled";
|
||||
string warning = "MariaDB ColumnStore Replication Feature is already enabled";
|
||||
// confirm request
|
||||
if (confirmPrompt(warning))
|
||||
break;
|
||||
@@ -4972,7 +4962,7 @@ int processCommand(string* arguments)
|
||||
|
||||
if ( MySQLPasswordConfig == oam::UnassignedName ) {
|
||||
cout << endl;
|
||||
string prompt = "Is there a 'MariaDB Columnstore' Password configured on the MariaDB Columnstore Front-end Modules in " + HOME + "/.my.cnf (y,n): ";
|
||||
string prompt = "Is there a 'MariaDB ColumnStore' Password configured on the MariaDB ColumnStore Front-end Modules in " + HOME + "/.my.cnf (y,n): ";
|
||||
MySQLPasswordConfig = dataPrompt(prompt);
|
||||
}
|
||||
|
||||
@@ -4994,7 +4984,7 @@ int processCommand(string* arguments)
|
||||
try
|
||||
{
|
||||
oam.enableMySQLRep(password);
|
||||
cout << endl << " Successful Enabling of MariaDB Columnstore Replication " << endl << endl;
|
||||
cout << endl << " Successful Enabling of MariaDB ColumnStore Replication " << endl << endl;
|
||||
|
||||
//display Primary UM Module / Master Node
|
||||
string PrimaryUMModuleName;
|
||||
@@ -5003,7 +4993,7 @@ int processCommand(string* arguments)
|
||||
}
|
||||
catch(...) {}
|
||||
|
||||
cout << " MariaDB Columnstore Replication Master Node is " << PrimaryUMModuleName << endl << endl;
|
||||
cout << " MariaDB ColumnStore Replication Master Node is " << PrimaryUMModuleName << endl << endl;
|
||||
}
|
||||
catch (exception& e)
|
||||
{
|
||||
@@ -5626,7 +5616,7 @@ int processCommand(string* arguments)
|
||||
|
||||
if ( localModule != parentOAMModule ) {
|
||||
// exit out since not on Parent OAM Module
|
||||
cout << endl << "**** addModule Failed : only should be run on the Parent OAM Module, which is '" << parentOAMModule << "'" << endl;
|
||||
cout << endl << "**** removeModule Failed : only should be run on the Parent OAM Module, which is '" << parentOAMModule << "'" << endl;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -5653,7 +5643,7 @@ int processCommand(string* arguments)
|
||||
|
||||
if ( arguments[3] != "y") {
|
||||
cout << endl << "!!!!! DESTRUCTIVE COMMAND !!!!!" << endl;
|
||||
string warning = "This command does a remove a module from the MariaDB Columnstore System";
|
||||
string warning = "This command does a remove a module from the MariaDB ColumnStore System";
|
||||
// confirm request
|
||||
if (confirmPrompt(warning))
|
||||
break;
|
||||
@@ -5718,7 +5708,7 @@ int processCommand(string* arguments)
|
||||
|
||||
if ( arguments[2] != "y") {
|
||||
cout << endl << "!!!!! DESTRUCTIVE COMMAND !!!!!" << endl;
|
||||
string warning = "This command does a stop and remove a module from the MariaDB Columnstore System";
|
||||
string warning = "This command does a stop and remove a module from the MariaDB ColumnStore System";
|
||||
// confirm request
|
||||
if (confirmPrompt(warning))
|
||||
break;
|
||||
@@ -5926,7 +5916,7 @@ int processCommand(string* arguments)
|
||||
catch(...) {}
|
||||
|
||||
if ( MySQLRep == "n" ) {
|
||||
string warning = "MariaDB Columnstore Replication Feature is already disable";
|
||||
string warning = "MariaDB ColumnStore Replication Feature is already disable";
|
||||
// confirm request
|
||||
if (confirmPrompt(warning))
|
||||
break;
|
||||
@@ -5940,7 +5930,7 @@ int processCommand(string* arguments)
|
||||
|
||||
if ( MySQLPasswordConfig == oam::UnassignedName ) {
|
||||
cout << endl;
|
||||
string prompt = "Is there a 'MariaDB Columnstore' Password configured on the MariaDB Columnstore Front-end Modules in " + HOME + "/.my.cnf (y,n): ";
|
||||
string prompt = "Is there a 'MariaDB ColumnStore' Password configured on the MariaDB ColumnStore Front-end Modules in " + HOME + "/.my.cnf (y,n): ";
|
||||
MySQLPasswordConfig = dataPrompt(prompt);
|
||||
}
|
||||
|
||||
@@ -5962,7 +5952,7 @@ int processCommand(string* arguments)
|
||||
try
|
||||
{
|
||||
oam.disableMySQLRep();
|
||||
cout << endl << " Successful Disable of MariaDB Columnstore Replication " << endl;
|
||||
cout << endl << " Successful Disable of MariaDB ColumnStore Replication " << endl;
|
||||
}
|
||||
catch (exception& e)
|
||||
{
|
||||
@@ -6719,7 +6709,7 @@ int processCommand(string* arguments)
|
||||
{
|
||||
// confirm request
|
||||
if ( arguments[2] != "y" ) {
|
||||
if (confirmPrompt("This command stops the processing of applications on a Module within the MariaDB Columnstore System"))
|
||||
if (confirmPrompt("This command stops the processing of applications on a Module within the MariaDB ColumnStore System"))
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -6845,7 +6835,7 @@ int processCommand(string* arguments)
|
||||
|
||||
// confirm request
|
||||
if ( arguments[2] != "y" ) {
|
||||
if (confirmPrompt("This command starts the processing of applications on a Module within the MariaDB Columnstore System"))
|
||||
if (confirmPrompt("This command starts the processing of applications on a Module within the MariaDB ColumnStore System"))
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -6991,7 +6981,7 @@ int ProcessSupportCommand(int CommandID, std::string arguments[])
|
||||
{
|
||||
// give warning for Process-Monitor
|
||||
if ( arguments[1] == "ProcessManager" ) {
|
||||
if (confirmPrompt("ProcessManager is the Interface for the Console and should only be removed as part of a MariaDB Columnstore Package installation"))
|
||||
if (confirmPrompt("ProcessManager is the Interface for the Console and should only be removed as part of a MariaDB ColumnStore Package installation"))
|
||||
break;
|
||||
}
|
||||
else
|
||||
@@ -6999,7 +6989,7 @@ int ProcessSupportCommand(int CommandID, std::string arguments[])
|
||||
if ( arguments[3] != "y" ) {
|
||||
getFlags(arguments, gracefulTemp, ackTemp, suspendAnswer, bNeedsConfirm);
|
||||
// confirm request
|
||||
if (confirmPrompt("This command stops the processing of an application on a Module within the MariaDB Columnstore System"))
|
||||
if (confirmPrompt("This command stops the processing of an application on a Module within the MariaDB ColumnStore System"))
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -7054,7 +7044,7 @@ int ProcessSupportCommand(int CommandID, std::string arguments[])
|
||||
if (arguments[3] != "y")
|
||||
{
|
||||
// confirm request
|
||||
if (confirmPrompt("This command restarts the processing of an application on a Module within the MariaDB Columnstore System"))
|
||||
if (confirmPrompt("This command restarts the processing of an application on a Module within the MariaDB ColumnStore System"))
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -7119,7 +7109,7 @@ int ProcessSupportCommand(int CommandID, std::string arguments[])
|
||||
string password = arguments[1];
|
||||
if ( arguments[2] != "y") {
|
||||
cout << endl << "!!!!! DESTRUCTIVE COMMAND !!!!!" << endl;
|
||||
string warning = "This command stops the Processing of applications and reboots all modules within the MariaDB Columnstore System";
|
||||
string warning = "This command stops the Processing of applications and reboots all modules within the MariaDB ColumnStore System";
|
||||
// confirm request
|
||||
if (confirmPrompt(warning))
|
||||
break;
|
||||
@@ -7211,7 +7201,7 @@ int ProcessSupportCommand(int CommandID, std::string arguments[])
|
||||
// close the log file
|
||||
writeLog("End of a command session!!!");
|
||||
logFile.close();
|
||||
cout << endl << "Exiting the MariaDB Columnstore Command Console" << endl;
|
||||
cout << endl << "Exiting the MariaDB ColumnStore Command Console" << endl;
|
||||
exit (0);
|
||||
}
|
||||
}
|
||||
@@ -7242,7 +7232,7 @@ int ProcessSupportCommand(int CommandID, std::string arguments[])
|
||||
string password = arguments[2];
|
||||
if ( arguments[3] != "y") {
|
||||
cout << endl << "!!!!! DESTRUCTIVE COMMAND !!!!!" << endl;
|
||||
string warning = "This command reboots a node within the MariaDB Columnstore System";
|
||||
string warning = "This command reboots a node within the MariaDB ColumnStore System";
|
||||
// confirm request
|
||||
if (confirmPrompt(warning))
|
||||
break;
|
||||
@@ -7281,7 +7271,7 @@ int ProcessSupportCommand(int CommandID, std::string arguments[])
|
||||
// close the log file
|
||||
writeLog("End of a command session!!!");
|
||||
logFile.close();
|
||||
cout << endl << "Exiting the MariaDB Columnstore Command Console" << endl;
|
||||
cout << endl << "Exiting the MariaDB ColumnStore Command Console" << endl;
|
||||
exit (0);
|
||||
}
|
||||
}
|
||||
@@ -7315,7 +7305,7 @@ int ProcessSupportCommand(int CommandID, std::string arguments[])
|
||||
{
|
||||
if ( arguments[1] != "y" ) {
|
||||
// confirm request
|
||||
if (confirmPrompt("This command stops the dbrm processes within the MariaDB Columnstore System"))
|
||||
if (confirmPrompt("This command stops the dbrm processes within the MariaDB ColumnStore System"))
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -7349,7 +7339,7 @@ int ProcessSupportCommand(int CommandID, std::string arguments[])
|
||||
{
|
||||
if ( arguments[1] != "y" ) {
|
||||
// confirm request
|
||||
if (confirmPrompt("This command restarts the dbrm processes within the MariaDB Columnstore System"))
|
||||
if (confirmPrompt("This command restarts the dbrm processes within the MariaDB ColumnStore System"))
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -7383,7 +7373,7 @@ int ProcessSupportCommand(int CommandID, std::string arguments[])
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
cout << "ERROR: Problem getting systemStartupOffline from the MariaDB Columnstore System Configuration file" << endl;
|
||||
cout << "ERROR: Problem getting systemStartupOffline from the MariaDB ColumnStore System Configuration file" << endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -7415,7 +7405,7 @@ int ProcessSupportCommand(int CommandID, std::string arguments[])
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
cout << "ERROR: Problem setting systemStartupOffline in the MariaDB Columnstore System Configuration file" << endl;
|
||||
cout << "ERROR: Problem setting systemStartupOffline in the MariaDB ColumnStore System Configuration file" << endl;
|
||||
exit(-1);
|
||||
}
|
||||
cout << endl << " Successful setting of systemStartupOffline to '" << systemStartupOffline << "'" << endl << endl;
|
||||
@@ -7426,7 +7416,7 @@ int ProcessSupportCommand(int CommandID, std::string arguments[])
|
||||
{
|
||||
if ( arguments[1] != "y" ) {
|
||||
// confirm request
|
||||
if (confirmPrompt("This command stops the PrimProc processes within the MariaDB Columnstore System"))
|
||||
if (confirmPrompt("This command stops the PrimProc processes within the MariaDB ColumnStore System"))
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -7460,7 +7450,7 @@ int ProcessSupportCommand(int CommandID, std::string arguments[])
|
||||
{
|
||||
if ( arguments[1] != "y" ) {
|
||||
// confirm request
|
||||
if (confirmPrompt("This command restarts the PrimProc processes within the MariaDB Columnstore System"))
|
||||
if (confirmPrompt("This command restarts the PrimProc processes within the MariaDB ColumnStore System"))
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -7480,7 +7470,7 @@ int ProcessSupportCommand(int CommandID, std::string arguments[])
|
||||
{
|
||||
if ( arguments[1] != "y" ) {
|
||||
// confirm request
|
||||
if (confirmPrompt("This command stops the ExeMgr processes within the MariaDB Columnstore System"))
|
||||
if (confirmPrompt("This command stops the ExeMgr processes within the MariaDB ColumnStore System"))
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -7514,7 +7504,7 @@ int ProcessSupportCommand(int CommandID, std::string arguments[])
|
||||
{
|
||||
if ( arguments[1] != "y" ) {
|
||||
// confirm request
|
||||
if (confirmPrompt("This command restarts the ExeMgr processes within the MariaDB Columnstore System"))
|
||||
if (confirmPrompt("This command restarts the ExeMgr processes within the MariaDB ColumnStore System"))
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -7546,11 +7536,11 @@ int ProcessSupportCommand(int CommandID, std::string arguments[])
|
||||
try
|
||||
{
|
||||
oam.distributeConfigFile(name);
|
||||
cout << endl << " Successful Distribution of MariaDB Columnstore Config File" << endl << endl;
|
||||
cout << endl << " Successful Distribution of MariaDB ColumnStore Config File" << endl << endl;
|
||||
}
|
||||
catch (exception& e)
|
||||
{
|
||||
cout << endl << "**** Distribution of MariaDB Columnstore Config File Failed : " << e.what() << endl;
|
||||
cout << endl << "**** Distribution of MariaDB ColumnStore Config File Failed : " << e.what() << endl;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -8083,13 +8073,13 @@ void printSystemStatus()
|
||||
if ( moduletypeconfig.ModuleCount > 1 )
|
||||
{
|
||||
if ( PrimaryUMModuleName != oam::UnassignedName )
|
||||
cout << "Primary Front-End MariaDB Columnstore Module is '" << PrimaryUMModuleName << "'" << endl;
|
||||
cout << "Primary Front-End MariaDB ColumnStore Module is '" << PrimaryUMModuleName << "'" << endl;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( PrimaryUMModuleName != oam::UnassignedName )
|
||||
cout << "Primary Front-End MariaDB Columnstore Module is '" << PrimaryUMModuleName << "'" << endl;
|
||||
cout << "Primary Front-End MariaDB ColumnStore Module is '" << PrimaryUMModuleName << "'" << endl;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8111,7 +8101,7 @@ void printSystemStatus()
|
||||
catch(...) {}
|
||||
|
||||
if ( MySQLRep == "y" )
|
||||
cout << "MariaDB Columnstore Replication Feature is enabled" << endl << endl;
|
||||
cout << "MariaDB ColumnStore Replication Feature is enabled" << endl << endl;
|
||||
}
|
||||
catch (exception& e)
|
||||
{
|
||||
@@ -8174,7 +8164,7 @@ void printProcessStatus(std::string port)
|
||||
}
|
||||
}
|
||||
|
||||
cout << endl << "MariaDB Columnstore Process statuses" << endl << endl;
|
||||
cout << endl << "MariaDB ColumnStore Process statuses" << endl << endl;
|
||||
cout << "Process Module Status Last Status Change Process ID" << endl;
|
||||
cout << "------------------ ------ --------------- ------------------------ ----------" << endl;
|
||||
try
|
||||
|
@@ -436,7 +436,7 @@ int sendReplicationRequest(int IserverTypeInstall, std::string password, std::st
|
||||
returnStatus = sendMsgProcMon( (*pt).DeviceName, msg1, requestID, 600 );
|
||||
|
||||
if ( returnStatus != API_SUCCESS) {
|
||||
cout << endl << "ERROR: Error return in running the MariaDB Columnstore Master DB Distribute, check /tmp/master-dist*.logs on " << masterModule << endl;
|
||||
cout << endl << "ERROR: Error return in running the MariaDB ColumnStore Master DB Distribute, check /tmp/master-dist*.logs on " << masterModule << endl;
|
||||
return returnStatus;
|
||||
}
|
||||
|
||||
@@ -448,7 +448,7 @@ int sendReplicationRequest(int IserverTypeInstall, std::string password, std::st
|
||||
returnStatus = sendMsgProcMon( (*pt).DeviceName, msg, requestID, 30 );
|
||||
|
||||
if ( returnStatus != API_SUCCESS) {
|
||||
cout << endl << "ERROR: Error return in running the MariaDB Columnstore Master replication, check /tmp/master-rep*.logs on " << masterModule << endl;
|
||||
cout << endl << "ERROR: Error return in running the MariaDB ColumnStore Master replication, check /tmp/master-rep*.logs on " << masterModule << endl;
|
||||
return returnStatus;
|
||||
}
|
||||
|
||||
@@ -479,7 +479,7 @@ int sendReplicationRequest(int IserverTypeInstall, std::string password, std::st
|
||||
returnStatus = sendMsgProcMon( (*pt).DeviceName, msg, requestID, 30 );
|
||||
|
||||
if ( returnStatus != API_SUCCESS) {
|
||||
cout << endl << "ERROR: Error return in running the MariaDB Columnstore Slave replication, check /tmp/slave-rep*.logs on " << (*pt).DeviceName << endl;
|
||||
cout << endl << "ERROR: Error return in running the MariaDB ColumnStore Slave replication, check /tmp/slave-rep*.logs on " << (*pt).DeviceName << endl;
|
||||
return returnStatus;
|
||||
}
|
||||
|
||||
@@ -677,12 +677,12 @@ void checkMysqlPort( std::string& mysqlPort, Config* sysConfig )
|
||||
int size = oldFile.tellg();
|
||||
if ( size != 0 ) {
|
||||
if ( noPrompting ) {
|
||||
cout << endl << "The MariaDB Columnstore port of '" + mysqlPort + "' is already in-use" << endl;
|
||||
cout << endl << "The MariaDB ColumnStore port of '" + mysqlPort + "' is already in-use" << endl;
|
||||
cout << "For No-prompt install, use the command line argument of 'port' to enter a different number" << endl;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
cout << "The MariaDB Columnstore port of '" + mysqlPort + "' is already in-use on local server" << endl;
|
||||
cout << "The MariaDB ColumnStore port of '" + mysqlPort + "' is already in-use on local server" << endl;
|
||||
|
||||
while(true)
|
||||
{
|
||||
@@ -697,7 +697,7 @@ void checkMysqlPort( std::string& mysqlPort, Config* sysConfig )
|
||||
|
||||
if ( atoi(mysqlPort.c_str()) < 1000 || atoi(mysqlPort.c_str()) > 9999)
|
||||
{
|
||||
cout << " ERROR: Invalid MariaDB Columnstore Port ID supplied, must be between 1000-9999" << endl;
|
||||
cout << " ERROR: Invalid MariaDB ColumnStore Port ID supplied, must be between 1000-9999" << endl;
|
||||
}
|
||||
else
|
||||
break;
|
||||
@@ -755,7 +755,7 @@ void checkSystemMySQLPort(std::string& mysqlPort, Config* sysConfig, std::string
|
||||
int size = oldFile.tellg();
|
||||
if ( size != 0 ) {
|
||||
if ( noPrompting ) {
|
||||
cout << endl << "The MariaDB Columnstore port of '" + mysqlPort + "' is already in-use" << endl;
|
||||
cout << endl << "The MariaDB ColumnStore port of '" + mysqlPort + "' is already in-use" << endl;
|
||||
cout << "For No-prompt install, use the command line argument of 'port' to enter a different number" << endl;
|
||||
exit(1);
|
||||
}
|
||||
@@ -786,7 +786,7 @@ void checkSystemMySQLPort(std::string& mysqlPort, Config* sysConfig, std::string
|
||||
int rtnCode = system(cmd.c_str());
|
||||
if (WEXITSTATUS(rtnCode) == 0) {
|
||||
if ( noPrompting ) {
|
||||
cout << endl << "The MariaDB Columnstore port of '" + mysqlPort + "' is already in-use on " << remoteModuleName << endl;
|
||||
cout << endl << "The MariaDB ColumnStore port of '" + mysqlPort + "' is already in-use on " << remoteModuleName << endl;
|
||||
cout << "For No-prompt install, use the command line argument of 'port' to enter a different number" << endl;
|
||||
cout << "exiting..." << endl;
|
||||
exit(1);
|
||||
@@ -804,7 +804,7 @@ void checkSystemMySQLPort(std::string& mysqlPort, Config* sysConfig, std::string
|
||||
|
||||
if ( inUse )
|
||||
{
|
||||
cout << endl << "The MariaDB Columnstore port of '" + mysqlPort + "' is already in-use on " << inUseServer << endl;
|
||||
cout << endl << "The MariaDB ColumnStore port of '" + mysqlPort + "' is already in-use on " << inUseServer << endl;
|
||||
|
||||
while(true)
|
||||
{
|
||||
@@ -819,7 +819,7 @@ void checkSystemMySQLPort(std::string& mysqlPort, Config* sysConfig, std::string
|
||||
|
||||
if ( atoi(mysqlPort.c_str()) < 1000 || atoi(mysqlPort.c_str()) > 9999)
|
||||
{
|
||||
cout << " ERROR: Invalid MariaDB Columnstore Port ID supplied, must be between 1000-9999" << endl;
|
||||
cout << " ERROR: Invalid MariaDB ColumnStore Port ID supplied, must be between 1000-9999" << endl;
|
||||
}
|
||||
else
|
||||
break;
|
||||
|
@@ -180,7 +180,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
cout << "ERROR: Problem getting ServerTypeInstall from the MariaDB Columnstore System Configuration file" << endl;
|
||||
cout << "ERROR: Problem getting ServerTypeInstall from the MariaDB ColumnStore System Configuration file" << endl;
|
||||
exit(1);
|
||||
}
|
||||
IserverTypeInstall = atoi(serverTypeInstall.c_str());
|
||||
@@ -205,7 +205,7 @@ int main(int argc, char *argv[])
|
||||
case (oam::INSTALL_COMBINE_DM_UM_PM): // combined #1 - dm/um/pm on a single server
|
||||
{
|
||||
if ( !writeConfig(sysConfig) ) {
|
||||
cout << "ERROR: Failed trying to update MariaDB Columnstore System Configuration file" << endl;
|
||||
cout << "ERROR: Failed trying to update MariaDB ColumnStore System Configuration file" << endl;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
@@ -214,7 +214,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
cout << "ERROR: Problem setting RotatingDestination in the MariaDB Columnstore System Configuration file" << endl;
|
||||
cout << "ERROR: Problem setting RotatingDestination in the MariaDB ColumnStore System Configuration file" << endl;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
@@ -225,7 +225,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
cout << "ERROR: Problem getting DB Storage Data from the MariaDB Columnstore System Configuration file" << endl;
|
||||
cout << "ERROR: Problem getting DB Storage Data from the MariaDB ColumnStore System Configuration file" << endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -240,7 +240,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
cout << "ERROR: Problem setting NumBlocksPct in the MariaDB Columnstore System Configuration file" << endl;
|
||||
cout << "ERROR: Problem setting NumBlocksPct in the MariaDB ColumnStore System Configuration file" << endl;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
@@ -266,7 +266,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
cout << "ERROR: Problem setting TotalUmMemory in the MariaDB Columnstore System Configuration file" << endl;
|
||||
cout << "ERROR: Problem setting TotalUmMemory in the MariaDB ColumnStore System Configuration file" << endl;
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
@@ -286,7 +286,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
cout << "ERROR: Problem setting NumBlocksPct in the MariaDB Columnstore System Configuration file" << endl;
|
||||
cout << "ERROR: Problem setting NumBlocksPct in the MariaDB ColumnStore System Configuration file" << endl;
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
@@ -297,13 +297,13 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
cout << "ERROR: Problem reading NumBlocksPct/TotalUmMemory in the MariaDB Columnstore System Configuration file" << endl;
|
||||
cout << "ERROR: Problem reading NumBlocksPct/TotalUmMemory in the MariaDB ColumnStore System Configuration file" << endl;
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
if ( !writeConfig(sysConfig) ) {
|
||||
cout << "ERROR: Failed trying to update MariaDB Columnstore System Configuration file" << endl;
|
||||
cout << "ERROR: Failed trying to update MariaDB ColumnStore System Configuration file" << endl;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
@@ -330,7 +330,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
cout << "ERROR: Problem setting TotalUmMemory in the MariaDB Columnstore System Configuration file" << endl;
|
||||
cout << "ERROR: Problem setting TotalUmMemory in the MariaDB ColumnStore System Configuration file" << endl;
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
@@ -349,13 +349,13 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
cout << "ERROR: Problem reading NumBlocksPct/TotalUmMemory in the MariaDB Columnstore System Configuration file" << endl;
|
||||
cout << "ERROR: Problem reading NumBlocksPct/TotalUmMemory in the MariaDB ColumnStore System Configuration file" << endl;
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
if ( !writeConfig(sysConfig) ) {
|
||||
cout << "ERROR: Failed trying to update MariaDB Columnstore System Configuration file" << endl;
|
||||
cout << "ERROR: Failed trying to update MariaDB ColumnStore System Configuration file" << endl;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
@@ -365,7 +365,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
if ( !writeConfig(sysConfig) ) {
|
||||
cout << "ERROR: Failed trying to update MariaDB Columnstore System Configuration file" << endl;
|
||||
cout << "ERROR: Failed trying to update MariaDB ColumnStore System Configuration file" << endl;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
@@ -418,7 +418,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
cout << "ERROR: Problem reading the MariaDB Columnstore System Configuration file" << endl;
|
||||
cout << "ERROR: Problem reading the MariaDB ColumnStore System Configuration file" << endl;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
@@ -700,17 +700,17 @@ int main(int argc, char *argv[])
|
||||
if ( IserverTypeInstall == oam::INSTALL_COMBINE_DM_UM_PM )
|
||||
{
|
||||
//run the mysql / mysqld setup scripts
|
||||
cout << endl << "Running the MariaDB Columnstore setup scripts" << endl << endl;
|
||||
cout << endl << "Running the MariaDB ColumnStore setup scripts" << endl << endl;
|
||||
|
||||
// call the mysql setup scripts
|
||||
mysqlSetup();
|
||||
sleep(5);
|
||||
}
|
||||
|
||||
cout << "System Install successfully completed, starting MariaDB Columnstore" << endl;
|
||||
cout << "System Install successfully completed, starting MariaDB ColumnStore" << endl;
|
||||
|
||||
//
|
||||
// perform start of MariaDB Columnstore of other servers in the system
|
||||
// perform start of MariaDB ColumnStore of other servers in the system
|
||||
//
|
||||
list1 = childmodulelist.begin();
|
||||
|
||||
@@ -733,9 +733,9 @@ int main(int argc, char *argv[])
|
||||
//start on local module
|
||||
int rtnCode = system(idbstartcmd.c_str());
|
||||
if (rtnCode != 0)
|
||||
cout << "Error starting MariaDB Columnstore local module" << endl;
|
||||
cout << "Error starting MariaDB ColumnStore local module" << endl;
|
||||
else
|
||||
cout << "Start MariaDB Columnstore request successful" << endl;
|
||||
cout << "Start MariaDB ColumnStore request successful" << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -745,7 +745,7 @@ int main(int argc, char *argv[])
|
||||
if ( calpont_rpm1 != "dummy.rpm" ) {
|
||||
|
||||
//run the mysql / mysqld setup scripts
|
||||
cout << endl << "Running the MariaDB Columnstore setup scripts" << endl << endl;
|
||||
cout << endl << "Running the MariaDB ColumnStore setup scripts" << endl << endl;
|
||||
|
||||
// call the mysql setup scripts
|
||||
mysqlSetup();
|
||||
@@ -754,9 +754,9 @@ int main(int argc, char *argv[])
|
||||
//start on local module
|
||||
int rtnCode = system(idbstartcmd.c_str());
|
||||
if (WEXITSTATUS(rtnCode) != 0)
|
||||
cout << "Error starting MariaDB Columnstore local module" << endl;
|
||||
cout << "Error starting MariaDB ColumnStore local module" << endl;
|
||||
else
|
||||
cout << "Start MariaDB Columnstore request successful" << endl;
|
||||
cout << "Start MariaDB ColumnStore request successful" << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -765,7 +765,7 @@ int main(int argc, char *argv[])
|
||||
//
|
||||
|
||||
//run the mysql / mysqld setup scripts
|
||||
cout << endl << "Running the MariaDB Columnstore setup scripts" << endl << endl;
|
||||
cout << endl << "Running the MariaDB ColumnStore setup scripts" << endl << endl;
|
||||
|
||||
// call the mysql setup scripts
|
||||
mysqlSetup();
|
||||
@@ -781,7 +781,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
// check for system going ACTIVE
|
||||
sleep(5);
|
||||
cout << endl << "MariaDB Columnstore Database Platform Starting, please wait .";
|
||||
cout << endl << "MariaDB ColumnStore Database Platform Starting, please wait .";
|
||||
cout.flush();
|
||||
|
||||
if ( waitForActive() ) {
|
||||
@@ -801,19 +801,19 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
cout << endl << "MariaDB Columnstore Install Successfully Completed, System is Active" << endl << endl;
|
||||
cout << endl << "MariaDB ColumnStore Install Successfully Completed, System is Active" << endl << endl;
|
||||
|
||||
cout << "Enter the following command to define MariaDB Columnstore Alias Commands" << endl << endl;
|
||||
cout << "Enter the following command to define MariaDB ColumnStore Alias Commands" << endl << endl;
|
||||
|
||||
cout << ". " + installDir + "/bin/columnstoreAlias" << endl << endl;
|
||||
|
||||
cout << "Enter 'mcsmysql' to access the MariaDB Columnstore SQL console" << endl;
|
||||
cout << "Enter 'mcsadmin' to access the MariaDB Columnstore Admin console" << endl << endl;
|
||||
cout << "Enter 'mcsmysql' to access the MariaDB ColumnStore SQL console" << endl;
|
||||
cout << "Enter 'mcsadmin' to access the MariaDB ColumnStore Admin console" << endl << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
cout << " FAILED" << endl;
|
||||
cout << endl << "ERROR: MariaDB Columnstore Process failed to start, check log files in /var/log/mariadb/columnstore" << endl;
|
||||
cout << endl << "ERROR: MariaDB ColumnStore Process failed to start, check log files in /var/log/mariadb/columnstore" << endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -4816,14 +4816,10 @@ int ProcessManager::addModule(oam::DeviceNetworkList devicenetworklist, std::str
|
||||
sysConfig->setConfig(Section, "Port", "8622");
|
||||
}
|
||||
|
||||
bool setMysqlRep = false;
|
||||
|
||||
if ( moduleType == "um" ||
|
||||
( moduleType == "pm" && config.ServerInstallType() == oam::INSTALL_COMBINE_DM_UM_PM ) ||
|
||||
( moduleType == "pm" && PMwithUM == "y") ) {
|
||||
|
||||
setMysqlRep = true;
|
||||
|
||||
listPT = devicenetworklist.begin();
|
||||
for( ; listPT != devicenetworklist.end() ; listPT++)
|
||||
{
|
||||
@@ -5313,22 +5309,6 @@ int ProcessManager::addModule(oam::DeviceNetworkList devicenetworklist, std::str
|
||||
sleep(30);
|
||||
}
|
||||
|
||||
//check and add MySQL Replication slave
|
||||
string MySQLRep;
|
||||
try {
|
||||
oam.getSystemConfig("MySQLRep", MySQLRep);
|
||||
}
|
||||
catch(...) {
|
||||
MySQLRep = "n";
|
||||
}
|
||||
|
||||
if ( MySQLRep == "n" && setMysqlRep ) {
|
||||
try {
|
||||
oam.setSystemConfig("MySQLRep", "y");
|
||||
}
|
||||
catch(...) {}
|
||||
}
|
||||
|
||||
//distribute config file
|
||||
distributeConfigFile("system");
|
||||
|
||||
|
@@ -147,20 +147,7 @@ int main(int argc, char *argv[])
|
||||
{}
|
||||
|
||||
bool build40 = false;
|
||||
if ( !CoreFileFlag.empty() )
|
||||
build40 = true;
|
||||
|
||||
//build 4.0.1 flag
|
||||
string AmazonSubNetID;
|
||||
try {
|
||||
AmazonSubNetID = sysConfigNew->getConfig(InstallSection, "AmazonSubNetID");
|
||||
}
|
||||
catch(...)
|
||||
{}
|
||||
|
||||
bool build401 = false;
|
||||
if ( !AmazonSubNetID.empty() )
|
||||
build401 = true;
|
||||
bool build401 = true;
|
||||
|
||||
//set install config flag
|
||||
try {
|
||||
@@ -1283,18 +1270,13 @@ int main(int argc, char *argv[])
|
||||
//
|
||||
if (build3) {
|
||||
//setup cloud parameters
|
||||
string x509Cert;
|
||||
string x509PriKey;
|
||||
string UMStorageType;
|
||||
string rpw;
|
||||
string PMInstanceType;
|
||||
string UMInstanceType;
|
||||
string UMSecurityGroup;
|
||||
string UMVolumeSize;
|
||||
string PMVolumeSize;
|
||||
string AmazonAutoTagging;
|
||||
string AmazonRegion;
|
||||
string AmazonZone;
|
||||
string AmazonVPCNextPrivateIP;
|
||||
string AmazonDeviceName;
|
||||
string UMVolumeType;
|
||||
@@ -1305,20 +1287,14 @@ int main(int argc, char *argv[])
|
||||
|
||||
try {
|
||||
cloud = sysConfigOld->getConfig(InstallSection, "Cloud");
|
||||
x509Cert = sysConfigOld->getConfig(InstallSection, "AmazonX509Certificate");
|
||||
x509PriKey = sysConfigOld->getConfig(InstallSection, "AmazonX509PrivateKey");
|
||||
UMStorageType = sysConfigOld->getConfig(InstallSection, "UMStorageType");
|
||||
rpw = sysConfigOld->getConfig(InstallSection, "rpw");
|
||||
PMInstanceType = sysConfigOld->getConfig(InstallSection, "PMInstanceType");
|
||||
UMInstanceType = sysConfigOld->getConfig(InstallSection, "UMInstanceType");
|
||||
UMSecurityGroup = sysConfigOld->getConfig(InstallSection, "UMSecurityGroup");
|
||||
UMVolumeSize = sysConfigOld->getConfig(InstallSection, "UMVolumeSize");
|
||||
PMVolumeSize = sysConfigOld->getConfig(InstallSection, "PMVolumeSize");
|
||||
AmazonAutoTagging = sysConfigOld->getConfig(InstallSection, "AmazonAutoTagging");
|
||||
AmazonRegion = sysConfigOld->getConfig(InstallSection, "AmazonRegion");
|
||||
AmazonZone = sysConfigOld->getConfig(InstallSection, "AmazonZone");
|
||||
AmazonVPCNextPrivateIP = sysConfigOld->getConfig(InstallSection, "AmazonVPCNextPrivateIP");
|
||||
AmazonSubNetID = sysConfigOld->getConfig(InstallSection, "AmazonSubNetID");
|
||||
AmazonDeviceName = sysConfigOld->getConfig(InstallSection, "AmazonDeviceName");
|
||||
UMVolumeType = sysConfigOld->getConfig(InstallSection, "UMVolumeType");
|
||||
UMVolumeIOPS = sysConfigOld->getConfig(InstallSection, "UMVolumeIOPS");
|
||||
@@ -1355,13 +1331,10 @@ int main(int argc, char *argv[])
|
||||
cloud = oam::UnassignedName;
|
||||
if ( cloud == "amazon")
|
||||
cloud = "amazon-ec2";
|
||||
if ( AmazonSubNetID.empty() )
|
||||
AmazonSubNetID = oam::UnassignedName;
|
||||
if ( AmazonVPCNextPrivateIP.empty() )
|
||||
AmazonVPCNextPrivateIP = oam::UnassignedName;
|
||||
|
||||
try {
|
||||
sysConfigNew->setConfig(InstallSection, "AmazonSubNetID", AmazonSubNetID);
|
||||
sysConfigNew->setConfig(InstallSection, "AmazonVPCNextPrivateIP", AmazonVPCNextPrivateIP);
|
||||
}
|
||||
catch(...)
|
||||
@@ -1373,18 +1346,13 @@ int main(int argc, char *argv[])
|
||||
|
||||
try {
|
||||
sysConfigNew->setConfig(InstallSection, "Cloud", cloud);
|
||||
sysConfigNew->setConfig(InstallSection, "AmazonX509Certificate", x509Cert);
|
||||
sysConfigNew->setConfig(InstallSection, "AmazonX509PrivateKey", x509PriKey);
|
||||
sysConfigNew->setConfig(InstallSection, "UMStorageType", UMStorageType);
|
||||
sysConfigNew->setConfig(InstallSection, "rpw", rpw);
|
||||
sysConfigNew->setConfig(InstallSection, "PMInstanceType", PMInstanceType);
|
||||
sysConfigNew->setConfig(InstallSection, "UMInstanceType", UMInstanceType);
|
||||
sysConfigNew->setConfig(InstallSection, "UMSecurityGroup", UMSecurityGroup);
|
||||
sysConfigNew->setConfig(InstallSection, "UMVolumeSize", UMVolumeSize);
|
||||
sysConfigNew->setConfig(InstallSection, "PMVolumeSize", PMVolumeSize);
|
||||
sysConfigNew->setConfig(InstallSection, "AmazonAutoTagging", AmazonAutoTagging);
|
||||
sysConfigNew->setConfig(InstallSection, "AmazonRegion", AmazonRegion);
|
||||
sysConfigNew->setConfig(InstallSection, "AmazonZone", AmazonZone);
|
||||
sysConfigNew->setConfig(InstallSection, "AmazonDeviceName", AmazonDeviceName);
|
||||
|
||||
sysConfigNew->setConfig(InstallSection, "UMVolumeType", UMVolumeType);
|
||||
|
Reference in New Issue
Block a user