Upgrading DxEMSSQL Containers
Summary
DxEMSSQL containers must be rebuilt to update the software. Depending on your platform, you'll either update the deployment or re-create the containers.
Information
DxEMSSQL containers are comprised of DxEnterprise and SQL Server installed in a single container. If either product needs to be updated, the container needs to be rebuilt. Instructions for building DxEMSSQL images can be found in the DxEnterprise guides section.
Kubernetes
After you've push a new image to your repository, you can update your StatefulSet by running the command kubectl rollout restart statefulset/dxemssql
. There are other methods for updating pods, so be sure to reference Kubernetes documentation for more information.
Some Kubernetes configuration options affect how a deployment/StatefulSet updates its pods. Some of these configurations include:
Ensure that you take these configuration options into account when updating your cluster.
Docker
To update your DxEMSSQL image running in Docker, do the following:
-
Gather the following information about the container using the command
docker inspect
.-
Execute
docker inspect <CONTAINER_NAME>
. This command will list information about the container's configuration, including mounted volumes and mapped ports. -
Under Config > Env, save the value of the DX_HOSTNAME variable. If this environment variable doesn't exist, save the value of Hostname under Config instead. DX_HOSTNAME takes precedence over Hostname.
-
Under Mounts, save the name of any volume mounts, including the
/etc/dh2i
volume mount. This is the storage for DH2i's software configuration files, and will be reused by the new container. -
Under Network Settings, save the listed port mappings. These mappings must be included in the new docker run command so that pre-existing configurations will function correctly.
cautionContainers may have custom configurations that are necessary for the container to function, including settings for network adapters, custom entrypoints, and custom permissions. It is up to you to determine what (if any) additional configuration settings you need to save from your container configuration.
-
-
Stop the container using the command
docker stop <container_name>
.infoYour availability group will automatically failover to a synchronous secondary if this container is the primary. If you want to do this step manually, run the command
docker exec <container_name> dxcli vhost-start-node <vhost_name> <container_name>
beforedocker stop
. -
Delete the container using the command
docker rm <container_name>
.dangerRemoving a container that has data stored in locations other than the volume mounts will destroy that data. If other applications in the container do not have volume mounts and have data that needs to be persisted, see step 2 of this section for instructions on using
docker commit
to save the container state. -
Pull the updated DxEMSSQL image from your repository using the command
docker pull <image_name>
. -
Start a new container using the same volume mounts, hostname, port mappings, and environment variables (along with any other necessary customizations) using the
docker run
command with the updated image's name.