Skip to content

Commit

Permalink
97 updates (#25)
Browse files Browse the repository at this point in the history
* NOTE: that this quickstart updates now supports only broker 9.7 and later
* Updated resources to broker 9.7 requirements
* Updated templates with scaling parameters
* Updated documentation for broker 9.7
  • Loading branch information
bczoma authored Oct 19, 2020
1 parent 0407875 commit 2df7a8c
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 45 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ script:
echo '#!/bin/bash
SOLACE_DOCKER_IMAGE_REFERENCE="solace/solace-pubsub-standard:latest"
ADMIN_PASSWORD="admin-password"
MAX_CONNECTIONS=100 # Broker system scaling: the maximum supported number of client connection
MAX_QUEUE_MESSAGES_MILLION=100 # Broker system scaling: the maximum number of queue messages, in millions
GITHUB_BRANCH=BRANCH_REF
if [ ! -d /var/lib/solace ]; then
mkdir /var/lib/solace
Expand All @@ -45,7 +47,7 @@ script:
exit 1
fi
chmod +x /var/lib/solace/install-solace.sh
/var/lib/solace/install-solace.sh -p $ADMIN_PASSWORD -i $SOLACE_DOCKER_IMAGE_REFERENCE
/var/lib/solace/install-solace.sh -p $ADMIN_PASSWORD -i $SOLACE_DOCKER_IMAGE_REFERENCE -n $MAX_CONNECTIONS -q $MAX_QUEUE_MESSAGES_MILLION
fi' > automation_script
- sed -i "s:BRANCH_REF:${TRAVIS_REPO_SLUG}/${TRAVIS_BRANCH}:g" automation_script
- cat automation_script
Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

This repository explains how to install a Solace PubSub+ Software Event Broker in various configurations onto Google Compute Engine (GCE) Linux Virtual Machines. This guide is intended for development and demo purposes.

The recommended event broker version is 9.4 or later.
The supported event broker version is 9.7 or later. For earlier broker releases use [this GitHub version of the QuickStart](//github.com/SolaceProducts/pubsubplus-gcp-quickstart/tree/v1.0.0).

## Description of the Solace PubSub+ Software Event Broker

Expand Down Expand Up @@ -50,7 +50,7 @@ Repeat these instructions for all instances required, and follow the specific re

> Tip: For an HA deployment, after the first Compute Engine instance has been created, go to its "VM instance details" by clicking on its name. Then use the "CREATE SIMILAR" button to create a new instance with most of the configuration details that will be described next pre-populated.
Determine the PubSub+ resource requirements based on the targeted [connection scaling](//docs.solace.com/Solace-SW-Broker-Set-Up/SW-Broker-Rel-Compat.htm#Connecti)
Determine the PubSub+ container image resource requirements consulting the [System Resource Requirements](//docs.solace.com/Configuring-and-Managing/SW-Broker-Specific-Config/System-Resource-Requirements.htm#res-req-container), adjusted to the targeted System Scaling parameters [Maximum Possible Concurrent Client Connections](//docs.solace.com/Configuring-and-Managing/SW-Broker-Specific-Config/System-Scaling-Parameters.htm#max-client-connections) and [Maximum Possible Queue Messages](//docs.solace.com/Configuring-and-Managing/SW-Broker-Specific-Config/System-Scaling-Parameters.htm#max-queue-messages).

At a minimum, select standard 2 vCPU machine type, and at least 2 GB of memory, a CentOS 7 OS, and a disk with a size of at least 30 GB deployed on Centos7 OS:

Expand Down Expand Up @@ -78,7 +78,7 @@ Take note of the configured IP addresses: `<PrimaryIP>`, `<BackupIP>` and `<Moni

![alt text](/images/gce_launch_2.png "GCE Image creation 2")

Cut and paste the following code according to your deployment configuration into the panel, the value of the variable `SOLACE_DOCKER_IMAGE_REFERENCE` if required to the reference from [Step 1](#step-1-optional-obtain-a-reference-to-the-docker-image-of-the-solace-pubsub-message-broke-to-be-deployed ), and replace `ADMIN_PASSWORD` with the desired password for the management `admin` user.
Cut and paste the following code according to your deployment configuration into the panel, the value of the variable `SOLACE_DOCKER_IMAGE_REFERENCE` if required to the reference from [Step 1](#step-1-optional-obtain-a-reference-to-the-docker-image-of-the-solace-pubsub-message-broke-to-be-deployed ), and replace `ADMIN_PASSWORD` with the desired password for the management `admin` user and also adjust `MAX_CONNECTIONS` and `MAX_QUEUE_MESSAGES_MILLION` as required within the limits of the [PubSub+ edition you are using](https://docs.solace.com/Configuring-and-Managing/SW-Broker-Specific-Config/System-Scaling-Parameters.htm).

**Note:** For an HA deployment, additional environment variables are required (see the script section "Add here environment variables..." near the beginning), which is discussed below.

Expand All @@ -88,6 +88,8 @@ Cut and paste the following code according to your deployment configuration into
# Update following variables as needed:
SOLACE_DOCKER_IMAGE_REFERENCE="solace/solace-pubsub-standard:latest" # Default to pull latest PubSub+ standard from docker hub
ADMIN_PASSWORD="admin-password" # Update to a real password
MAX_CONNECTIONS=100 # Broker system scaling: the maximum supported number of client connections
MAX_QUEUE_MESSAGES_MILLION=100 # Broker system scaling: the maximum number of queue messages, in millions
GITHUB_BRANCH="SolaceProducts/solace-gcp-quickstart/master"
##################################
# Add here environment variables for HA deployment, not required for single-node deployment.
Expand All @@ -112,7 +114,7 @@ if [ ! -d /var/lib/solace ]; then
exit 1
fi
chmod +x /var/lib/solace/install-solace.sh
/var/lib/solace/install-solace.sh -p $ADMIN_PASSWORD -i $SOLACE_DOCKER_IMAGE_REFERENCE
/var/lib/solace/install-solace.sh -p $ADMIN_PASSWORD -i $SOLACE_DOCKER_IMAGE_REFERENCE -n $MAX_CONNECTIONS -q $MAX_QUEUE_MESSAGES_MILLION
fi
```

Expand Down
58 changes: 18 additions & 40 deletions scripts/install-solace.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
SOLACE_DOCKER_IMAGE_REF="solace/solace-pubsub-standard:latest"
USERNAME=admin
PASSWORD=admin
MAX_CONNECTIONS=100
MAX_QUEUE_MESSAGES_MILLION=100
LOG_FILE=install.log
SWAP_FILE=swap
#cloud init vars
#array of all available cloud init variables to attempt to detect and pass to docker image creation
#see https://docs.solace.com/Configuring-and-Managing/SW-Broker-Specific-Config/Cloud-And-Machine-Tasks/Initializing-Config-Keys-With-Cloud-Init.htm
cloud_init_vars=( routername nodetype service_semp_port system_scaling_maxconnectioncount configsync_enable redundancy_activestandbyrole redundancy_enable redundancy_group_password redundancy_matelink_connectvia service_redundancy_firstlistenport )
cloud_init_vars=( routername nodetype service_semp_port system_scaling_maxconnectioncount system_scaling_maxqueuemessagecount configsync_enable redundancy_activestandbyrole redundancy_enable redundancy_group_password redundancy_matelink_connectvia service_redundancy_firstlistenport )

# check if routernames contain any dashes or underscores and abort execution, if that is the case.
if [[ $routername == *"-"* || $routername == *"_"* || $baseroutername == *"-"* || $baseroutername == *"_"* ]]; then
Expand Down Expand Up @@ -46,6 +47,14 @@ do
USERNAME="$2"
shift # past argument
;;
-n|--maxconn)
MAX_CONNECTIONS="$2"
shift # past argument
;;
-q|--maxqueuemillion)
MAX_QUEUE_MESSAGES_MILLION="$2"
shift # past argument
;;
*)
# unknown option
;;
Expand Down Expand Up @@ -162,44 +171,12 @@ fi
echo "`date` INFO: Successfully loaded ${SOLACE_DOCKER_IMAGE_REF} to local docker repo" &>> ${LOG_FILE}
echo "`date` INFO: Solace message broker image and tag: `docker images | grep solace | awk '{print $1,":",$2}'`" &>> ${LOG_FILE}
# Common for all scalings
shmsize="1g"
ulimit_nofile="2448:422192"
SWAP_SIZE="2048"
echo "`date` INFO:Set up swap" &>> ${LOG_FILE}
# -----------------------------------------
# Decide which scaling tier applies based on system memory
# and set maxconnectioncount, ulimit, devshm and swap accordingly
MEM_SIZE=`cat /proc/meminfo | grep MemTotal | tr -dc '0-9'`
if [ ${MEM_SIZE} -lt 4000000 ]; then
# 100 if mem<4GiB
maxconnectioncount="100"
shmsize="1g"
ulimit_nofile="2448:6592"
SWAP_SIZE="1024"
elif [ ${MEM_SIZE} -lt 12000000 ]; then
# 1000 if 4GiB<=mem<12GiB
maxconnectioncount="1000"
shmsize="2g"
ulimit_nofile="2448:10192"
SWAP_SIZE="2048"
elif [ ${MEM_SIZE} -lt 29000000 ]; then
# 10000 if 12GiB<=mem<28GiB
maxconnectioncount="10000"
shmsize="2g"
ulimit_nofile="2448:42192"
SWAP_SIZE="2048"
elif [ ${MEM_SIZE} -lt 58000000 ]; then
# 100000 if 28GiB<=mem<56GiB
maxconnectioncount="100000"
shmsize="3380m"
ulimit_nofile="2448:222192"
SWAP_SIZE="2048"
else
# 200000 if 56GiB<=mem
maxconnectioncount="200000"
shmsize="3380m"
ulimit_nofile="2448:422192"
SWAP_SIZE="2048"
fi
echo "`date` INFO: Based on memory size of ${MEM_SIZE}KiB, determined maxconnectioncount: ${maxconnectioncount}, shmsize: ${shmsize}, ulimit_nofile: ${ulimit_nofile}, SWAP_SIZE: ${SWAP_SIZE}" &>> ${LOG_FILE}
echo "`date` INFO: Using shmsize: ${shmsize}, ulimit_nofile: ${ulimit_nofile}, SWAP_SIZE: ${SWAP_SIZE}" &>> ${LOG_FILE}
echo "`date` INFO: Creating Swap space" &>> ${LOG_FILE}
mkdir /var/lib/solace
Expand Down Expand Up @@ -241,7 +218,8 @@ docker create \
--ulimit nofile=${ulimit_nofile} \
--net=host \
--restart=always \
--env "system_scaling_maxconnectioncount=${maxconnectioncount}" \
--env "system_scaling_maxconnectioncount=${MAX_CONNECTIONS}" \
--env "system_scaling_maxqueuemessagecount=${MAX_QUEUE_MESSAGES_MILLION}" \
${SOLACE_CLOUD_INIT} \
--name=solace ${SOLACE_IMAGE_ID}
Expand Down

0 comments on commit 2df7a8c

Please sign in to comment.