Skip to content

Commit

Permalink
9.4 release (#44)
Browse files Browse the repository at this point in the history
* Supporting release 9.4

* Update template parameters

* Now using the latest default ports

* Added mounted volume ownership change

* Added TCP for WAN optimization

* Fix ports 8080 and 80 as HTTP for LB

* Updated for deprecated config key

* Updated template defaults with new S3 location

* Update AMI machine IDs
  • Loading branch information
bczoma authored Feb 5, 2020
1 parent 769b74f commit 2fde6ce
Show file tree
Hide file tree
Showing 9 changed files with 312 additions and 221 deletions.
16 changes: 9 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,14 @@ script:
- aws cloudformation validate-template --template-body file://templates/solace.template
- aws cloudformation validate-template --template-body file://templates/nodecreate.template
- yaml-lint -n templates/
- sed -i "s@SolaceDockerImageParameterValue@$SOLACE_DOCKER_URL_PARAMETER_VALUE@g" ci/solace-aws-ha-3az-prod-travistest.json
- sed -i "s@MessageBrokerNodeInstanceTypeParameterValue@$MESSAGEBROKERNODEINSTANCETYPE@g" ci/solace-aws-ha-3az-prod-travistest.json
- sed -i "s@SolaceStackRegionNAME@$AWS_DEFAULT_REGION@g" ci/solace-aws-ha-3az-prod-travistest.json
- #sed -i "s@SolaceDockerImageParameterValue@${SOLACE_DOCKER_URL_PARAMETER_VALUE}@g" ci/solace-aws-ha-3az-prod-travistest.json
- sed -i "s@SolaceDockerImageParameterValue@solace/solace-pubsub-standard:latest@g" ci/solace-aws-ha-3az-prod-travistest.json
- sed -i "s@EventBrokerNodeInstanceTypeParameterValue@${MESSAGEBROKERNODEINSTANCETYPE}@g" ci/solace-aws-ha-3az-prod-travistest.json
- sed -i "s@SolaceStackRegionNAME@${AWS_DEFAULT_REGION}@g" ci/solace-aws-ha-3az-prod-travistest.json
- aws s3 mb s3://solace-cf-quickstart-travistest || echo "s3 bucket already existed"
- aws s3 sync . s3://solace-cf-quickstart-travistest/solace/messagebroker/latest --acl public-read
- aws s3 sync . s3://solace-cf-quickstart-travistest/solace/eventbroker/latest --acl public-read
- export TESTSTACKPREFIX="T$(date +%s)"; export TESTSTACKNAME="$TESTSTACKPREFIX-sol-aws-travistest";
- aws cloudformation create-stack --stack-name $TESTSTACKNAME --template-body file://templates/solace-master.template --parameters file://ci/solace-aws-ha-3az-prod-travistest.json --on-failure DELETE --capabilities CAPABILITY_IAM
- aws cloudformation create-stack --stack-name $TESTSTACKNAME --template-body file://templates/solace-master.template --parameters file://ci/solace-aws-ha-3az-prod-travistest.json --on-failure DO_NOTHING --capabilities CAPABILITY_IAM
- echo "Waiting for stack create complete"
- "travis_wait 30 sleep 1800 &"
- until aws cloudformation describe-stacks --stack-name $TESTSTACKNAME | grep -m 1 -E 'CREATE_COMPLETE|DELETE_IN_PROGRESS'; do sleep 10; done
Expand All @@ -57,12 +58,13 @@ after_success:
- echo "YAML linted"
- echo "Cloudformation tested"
- echo "Messaging tested"
- if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_BRANCH" = "master" ]; then aws s3 sync . s3://solace-products/solace-aws-ha-quickstart/latest --acl public-read; fi
- if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_BRANCH" = "master" ]; then aws s3 sync . s3://solace-products/pubsubplus-aws-ha-quickstart/latest --acl public-read; fi

after_script:
- aws s3 rb s3://solace-cf-quickstart-travistest --force
- #aws s3 rb s3://solace-cf-quickstart-travistest --force
- aws cloudformation delete-stack --stack-name $TESTSTACKNAME
- echo "Waiting for stack delete complete"
- stackid="$(aws cloudformation describe-stacks --stack-name $TESTSTACKNAME | grep StackId | awk -F '"' '{print $4}')"
- if [ -n "$stackid" ]; then until aws cloudformation describe-stacks --stack-name $stackid | grep -m 1 "DELETE_COMPLETE"; do sleep 10; done; fi
- for volume in $(aws ec2 describe-volumes --region ${AWS_DEFAULT_REGION} --filters Name="status",Values="available" --query 'Volumes[*].VolumeId' --output text) ; do aws ec2 delete-volume --volume-id $volume --region ${AWS_DEFAULT_REGION} ; done

100 changes: 50 additions & 50 deletions README.md

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions ci/solace-aws-ha-3az-prod-travistest.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@
"ParameterValue": "24"
},
{
"ParameterKey": "MessageBrokerNodeInstanceType",
"ParameterValue": "MessageBrokerNodeInstanceTypeParameterValue"
"ParameterKey": "EventBrokerNodeInstanceType",
"ParameterValue": "EventBrokerNodeInstanceTypeParameterValue"
},
{
"ParameterKey": "MessageBrokerNodeStorage",
"ParameterValue": "0"
"ParameterKey": "EventBrokerNodeStorage",
"ParameterValue": "20"
},
{
"ParameterKey": "MonitorNodeInstanceType",
Expand All @@ -57,6 +57,6 @@
},
{
"ParameterKey": "QSS3KeyPrefix",
"ParameterValue": "solace/messagebroker/latest/"
"ParameterValue": "solace/eventbroker/latest/"
}
]
6 changes: 3 additions & 3 deletions scripts/gen-cluster-hosts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# instance.
#
# The assumption is that the Cloudformation Stack deploys 2 autoscaling groups.
# MessageBroker (/tmp/routers)
# EventBroker (/tmp/routers)
# MonitorNodes (/tmp/monitors)
#
# The complete list of hosts for this stack is saved
Expand Down Expand Up @@ -85,9 +85,9 @@ done
# The different models will have slightly different labels for the
# nodes associated with each group ... but it's simple to handle both cases.
#pwd
grep -q -e "-MessageBroker.*Stack-" ${SOLACE_HOSTS_FILE}
grep -q -e "-EventBroker.*Stack-" ${SOLACE_HOSTS_FILE}
if [ $? -eq 0 ] ; then
grep -e "-MessageBroker.*Stack-" ${SOLACE_HOSTS_FILE} \
grep -e "-EventBroker.*Stack-" ${SOLACE_HOSTS_FILE} \
| awk '{print $1" ROUTERNODE"NR-1" "$2" "$3" "$4}' > /tmp/routers
else
cp ${SOLACE_HOSTS_FILE} /tmp/routers
Expand Down
147 changes: 89 additions & 58 deletions scripts/install-solace.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ logging_format=""
logging_group=""
logging_stream=""

verbose=0

while getopts "c:d:p:s:u:v:f:g:r:" opt; do
case "$opt" in
c) config_file=$OPTARG
Expand All @@ -68,7 +66,6 @@ done
shift $((OPTIND-1))
[ "$1" = "--" ] && shift

verbose=1
echo "config_file=$config_file , solace_directory=$solace_directory , admin_password_file=$admin_password_file , \
solace_uri=$solace_uri , disk_size=$disk_size , volume=$disk_volume , logging_format=$logging_format , \
logging_group=$logging_group , logging_stream=$logging_stream , Leftovers: $@"
Expand Down Expand Up @@ -103,6 +100,7 @@ fi
## Try to load solace_uri as a docker registry uri
echo "`date` Testing ${solace_uri} for docker registry uri:"
if [ -z "`docker pull ${solace_uri}`" ] ; then
# If NOT in this branch then load was successful
echo "`date` INFO: Found that ${solace_uri} was not a docker registry uri, retrying if it is a download link"
if [[ ${solace_uri} == *"solace.com/download"* ]]; then
REAL_LINK=${solace_uri}
Expand Down Expand Up @@ -189,18 +187,27 @@ chmod 0600 /var/lib/solace/swap
swapon -f /var/lib/solace/swap
grep -q 'solace\/swap' /etc/fstab || sudo sh -c 'echo "/var/lib/solace/swap none swap sw 0 0" >> /etc/fstab'
echo "`date` INFO: Applying TCP for WAN optimizations" &>> ${LOG_FILE}
echo '
net.core.rmem_max = 134217728
net.core.wmem_max = 134217728
net.ipv4.tcp_rmem = 4096 25165824 67108864
net.ipv4.tcp_wmem = 4096 25165824 67108864
net.ipv4.tcp_mtu_probing=1' | sudo tee /etc/sysctl.d/98-solace-sysctl.conf
sudo sysctl -p /etc/sysctl.d/98-solace-sysctl.conf
cd ${solace_directory}
host_name=`hostname`
host_info=`grep ${host_name} ${config_file}`
local_role=`echo $host_info | grep -o -E 'Monitor|MessageBrokerPrimary|MessageBrokerBackup'`
local_role=`echo $host_info | grep -o -E 'Monitor|EventBrokerPrimary|EventBrokerBackup'`
primary_stack=`cat ${config_file} | grep MessageBrokerPrimary | rev | cut -d "-" -f1 | rev | tr '[:upper:]' '[:lower:]'`
backup_stack=`cat ${config_file} | grep MessageBrokerBackup | rev | cut -d "-" -f1 | rev | tr '[:upper:]' '[:lower:]'`
primary_stack=`cat ${config_file} | grep EventBrokerPrimary | rev | cut -d "-" -f1 | rev | tr '[:upper:]' '[:lower:]'`
backup_stack=`cat ${config_file} | grep EventBrokerBackup | rev | cut -d "-" -f1 | rev | tr '[:upper:]' '[:lower:]'`
monitor_stack=`cat ${config_file} | grep Monitor | rev | cut -d "-" -f1 | rev | tr '[:upper:]' '[:lower:]'`
# Get the IP addressed for node
for role in Monitor MessageBrokerPrimary MessageBrokerBackup
for role in Monitor EventBrokerPrimary EventBrokerBackup
do
role_info=`grep ${role} ${config_file}`
role_name=${role_info%% *}
Expand All @@ -209,10 +216,10 @@ do
Monitor )
MONITOR_IP=${role_ip}
;;
MessageBrokerPrimary )
EventBrokerPrimary )
PRIMARY_IP=${role_ip}
;;
MessageBrokerBackup )
EventBrokerBackup )
BACKUP_IP=${role_ip}
;;
esac
Expand All @@ -224,21 +231,31 @@ case $local_role in
ROUTER_NAME="monitor${monitor_stack}"
REDUNDANCY_CFG=""
;;
MessageBrokerPrimary )
EventBrokerPrimary )
NODE_TYPE="message_routing"
ROUTER_NAME="primary${primary_stack}"
REDUNDANCY_CFG="--env redundancy_matelink_connectvia=${BACKUP_IP} --env redundancy_activestandbyrole=primary --env configsync_enable=yes"
is_primary="true"
;;
MessageBrokerBackup )
EventBrokerBackup )
NODE_TYPE="message_routing"
ROUTER_NAME="backup${backup_stack}"
REDUNDANCY_CFG="--env redundancy_matelink_connectvia=${PRIMARY_IP} --env redundancy_activestandbyrole=backup --env configsync_enable=yes"
;;
esac
if [ $disk_size == "0" ]; then
SPOOL_MOUNT="-v internalSpool:/usr/sw/internalSpool -v adbBackup:/usr/sw/adb -v softAdb:/usr/sw/internalSpool/softAdb"
# Setup password file permissions
chown -R 1000001 $(dirname ${admin_password_file})
chmod 700 $(dirname ${admin_password_file})
if [[ ${disk_size} == "0" ]]; then
#Create new volumes that the PubSub+ Message Broker container can use to consume and store data.
docker volume create --name=jail
docker volume create --name=var
docker volume create --name=softAdb
docker volume create --name=diagnostics
docker volume create --name=internalSpool
SPOOL_MOUNT="-v jail:/usr/sw/jail -v var:/usr/sw/var -v softAdb:/usr/sw/internalSpool/softAdb -v diagnostics:/var/lib/solace/diags -v internalSpool:/usr/sw/internalSpool"
else
echo "`date` Create primary partition on new disk"
(
Expand All @@ -252,56 +269,70 @@ else
mkfs.xfs ${disk_volume}1 -m crc=0
UUID=`blkid -s UUID -o value ${disk_volume}1`
echo "UUID=${UUID} /opt/pubsubplus xfs defaults 0 0" >> /etc/fstab
echo "UUID=${UUID} /opt/pubsubplus xfs defaults,uid=1000001 0 0" >> /etc/fstab
mkdir /opt/pubsubplus
mkdir /opt/pubsubplus/jail
mkdir /opt/pubsubplus/var
mkdir /opt/pubsubplus/softAdb
mkdir /opt/pubsubplus/diagnostics
mkdir /opt/pubsubplus/internalSpool
mount -a
SPOOL_MOUNT="-v /opt/pubsubplus:/usr/sw/internalSpool -v /opt/pubsubplus:/usr/sw/adb -v /opt/pubsubplus:/usr/sw/internalSpool/softAdb"
chown 1000001 -R /opt/pubsubplus/
SPOOL_MOUNT="-v /opt/pubsubplus/jail:/usr/sw/jail -v /opt/pubsubplus/var:/usr/sw/var -v /opt/pubsubplus/softAdb:/usr/sw/internalSpool/softAdb -v /opt/pubsubplus/diagnostics:/var/lib/solace/diags -v /opt/pubsubplus/internalSpool:/usr/sw/internalSpool"
fi
# Start up the SolOS docker instance with HA config keys
echo "`date` INFO: Executing 'docker create'"
#Define a create script
tee ~/docker-create <<-EOF
#!/bin/bash
docker create \
--uts=host \
--shm-size=${shmsize} \
--ulimit core=-1 \
--ulimit memlock=-1 \
--ulimit nofile=${ulimit_nofile} \
--net=host \
--restart=always \
-v jail:/usr/sw/jail \
-v var:/usr/sw/var \
-v /mnt/pubsubplus/secrets:/run/secrets \
${SPOOL_MOUNT} \
--log-driver=awslogs \
--log-opt awslogs-group=${logging_group} \
--log-opt awslogs-stream=${logging_stream} \
--env "system_scaling_maxconnectioncount=${maxconnectioncount}" \
--env "logging_debug_output=all" \
--env "logging_debug_format=${logging_format}" \
--env "logging_command_output=all" \
--env "logging_command_format=${logging_format}" \
--env "logging_system_output=all" \
--env "logging_system_format=${logging_format}" \
--env "logging_event_output=all" \
--env "logging_event_format=${logging_format}" \
--env "logging_kernel_output=all" \
--env "logging_kernel_format=${logging_format}" \
--env "nodetype=${NODE_TYPE}" \
--env "routername=${ROUTER_NAME}" \
--env "username_admin_globalaccesslevel=admin" \
--env "username_admin_passwordfilepath=$(basename ${admin_password_file})" \
--env "service_ssh_port=2222" \
${REDUNDANCY_CFG} \
--env "redundancy_group_passwordfilepath=$(basename ${admin_password_file})" \
--env "redundancy_enable=yes" \
--env "redundancy_group_node_primary${primary_stack}_nodetype=message_routing" \
--env "redundancy_group_node_primary${primary_stack}_connectvia=${PRIMARY_IP}" \
--env "redundancy_group_node_backup${backup_stack}_nodetype=message_routing" \
--env "redundancy_group_node_backup${backup_stack}_connectvia=${BACKUP_IP}" \
--env "redundancy_group_node_monitor${monitor_stack}_nodetype=monitoring" \
--env "redundancy_group_node_monitor${monitor_stack}_connectvia=${MONITOR_IP}" \
--name=solace ${SOLACE_IMAGE_ID}
--uts=host \
--shm-size=${shmsize} \
--ulimit core=-1 \
--ulimit memlock=-1 \
--ulimit nofile=${ulimit_nofile} \
--net=host \
--restart=always \
-v /mnt/pubsubplus/secrets:/run/secrets \
${SPOOL_MOUNT} \
--log-driver awslogs \
--log-opt awslogs-group=${logging_group} \
--log-opt awslogs-stream=${logging_stream} \
--env "system_scaling_maxconnectioncount=${maxconnectioncount}" \
--env "logging_debug_output=all" \
--env "logging_debug_format=${logging_format}" \
--env "logging_command_output=all" \
--env "logging_command_format=${logging_format}" \
--env "logging_system_output=all" \
--env "logging_system_format=${logging_format}" \
--env "logging_event_output=all" \
--env "logging_event_format=${logging_format}" \
--env "logging_kernel_output=all" \
--env "logging_kernel_format=${logging_format}" \
--env "nodetype=${NODE_TYPE}" \
--env "routername=${ROUTER_NAME}" \
--env "username_admin_globalaccesslevel=admin" \
--env "username_admin_passwordfilepath=$(basename ${admin_password_file})" \
--env "service_ssh_port=2222" \
--env "service_webtransport_port=8008" \
--env "service_webtransport_tlsport=1443" \
--env "service_semp_tlsport=1943" \
${REDUNDANCY_CFG} \
--env "redundancy_authentication_presharedkey_key=`cat ${admin_password_file} | awk '{x=$0;for(i=length;i<51;i++)x=x "0";}END{print x}' | base64`" \
--env "redundancy_enable=yes" \
--env "redundancy_group_node_primary${primary_stack}_nodetype=message_routing" \
--env "redundancy_group_node_primary${primary_stack}_connectvia=${PRIMARY_IP}" \
--env "redundancy_group_node_backup${backup_stack}_nodetype=message_routing" \
--env "redundancy_group_node_backup${backup_stack}_connectvia=${BACKUP_IP}" \
--env "redundancy_group_node_monitor${monitor_stack}_nodetype=monitoring" \
--env "redundancy_group_node_monitor${monitor_stack}_connectvia=${MONITOR_IP}" \
--name=solace ${SOLACE_IMAGE_ID}
EOF
#Make the file executable
chmod +x ~/docker-create
echo "`date` INFO: Creating the Solace container"
~/docker-create
# Start the solace service and enable it at system start up.
chkconfig --add solace-pubsubplus
Expand Down
Loading

0 comments on commit 2fde6ce

Please sign in to comment.