Links

Upgrade the Model9 management server on zCX

Prerequisites

Upload the s390x installation zip to the zCX instance using scp or any other tool in binary mode. Copy the s390x installation zip from the zCX instance to the alpine container:
docker cp model9-v2.7.0_build_caf1b68-server-s390x.zip dummy:/root/model9-v2.7.0_build_caf1b68-server-s390x.zip

Step 1: Stop Model9

Use the following command to stop version 2.6.x:
docker stop model9-v2.6.x
docker rm model9-v2.6.x

Step 2: Prepare the installation artifacts.

Go into the alpine container and open the model9 artifact:
# Create a new docker volume for initdb
docker volume create model9db_initdb
# Stopping the old alpine container
docker stop dummy
docker rm dummy
# Running an alpine container and mounting the model9 docker volume
docker run -d --rm --name dummy \
-v model9:/root \
-v model9db_initdb:/docker-entrypoint-initdb.d \
s390x/alpine tail -f /dev/null
docker exec -it dummy sh
cd /root
unzip /root/model9-v2.7.0_build_caf1b68-server-s390x.zip 'model9*' 'conf/docker-entrypoint-initdb.d/*'
# Verify the existence of the diag directory. Create it if needed.
mkdir diag
# Update the docker-entrypoint-initdb.d directory
cp conf/docker-entrypoint-initdb.d/* /docker-entrypoint-initdb.d
# Backup the /conf directory.
tar -czf conf-backup.tar.gz conf
# Exit from the alpine container.
exit
Copy the docker container images from the alpine docker container (The one that was used during the initial installation):
docker cp dummy:/root/model9-v2.7.0_build_caf1b68-s390x.docker ./
docker cp dummy:/root/postgres-14.5-s390x.docker.gz ./

Step 3: Load the new release artifacts

Load the new release docker containers:
docker load -i model9-v2.7.0_build_caf1b68-s390x.docker
docker load -i postgres-14.5-s390x.docker.gz

Step 4: Backup the server before the upgrade

Backup the local configuration and database volume:
fileStamp=$(date +%Y-%m-%d)
docker cp dummy:/root/conf-backup.tar.gz ./conf-$fileStamp.tar.gz
docker exec -it model9db pg_dump -p 5432 -U postgres -d model9 -f /tmp/model9db-$fileStamp.dump
docker cp model9db:/tmp/model9db-$fileStamp.dump ./model9db-$fileStamp.dump
docker exec -ti model9db rm /tmp/model9db-$fileStamp.dump

Step 5: Update the Postgres DB

Update the model9db volumes:

# Stop Postgres container
docker stop model9db
# Remove Postgres container
docker rm model9db
# Start Postgres docker container:
docker run -p 127.0.0.1:5432:5432 \
-v model9db:/var/lib/postgresql/data:z \
-v model9db_initdb:/docker-entrypoint-initdb.d:z \
--name model9db --restart unless-stopped \
--network model9network \
-e POSTGRES_PASSWORD=model9 -e POSTGRES_DB=model9 -d s390x/postgres:14.5

Run DB tuning script

docker exec -i model9db psql -U postgres -f /docker-entrypoint-initdb.d/postgresqlTune.sql

Step 6: Start the Model9 management server

Run the new release container using the following command:
docker run -d -p 0.0.0.0:8443:443 -p 0.0.0.0:8080:80 \
--sysctl net.ipv4.tcp_keepalive_time=600 \
--sysctl net.ipv4.tcp_keepalive_intvl=30 \
--sysctl net.ipv4.tcp_keepalive_probes=10 \
-v model9:/model9:z -h $(hostname) --restart unless-stopped \
-e "TZ=America/New_York" \
-e "EXTRA_JVM_ARGS=-Xmx2048m" \
--network model9network \
--name model9-v2.7.0 model9:v2.7.0.caf1b68
By default, Model9 uses ports 80 and 443 for the management server. On ZCX these ports are not available for use or you wish to use different ports update the -p parameters to use different ports. For example, in order to use port 8080 and port 8443 update the parameters as follows:
-p 0.0.0.0:8443:443 -p 0.0.0.0:8080:80