These instructions apply to users upgrading from software versions 2.5 or later. For assistance with the upgrade process, contact the NS1 support team by submitting a ticket or emailing support@ns1.com.
Before you begin
Determine which version of the NS1 DDI software each container is running.
Use one of the methods below to identify which version of the software you are running on each container:
- Option A
Log into the Service Control Center (SCC) portal (available to operator users running software version 3.2 or later) to view the current software version running on each DDI container. After logging into the SCC portal, on the Health Overview page, select a service definition from the list and click View Nodes. Select a node from the list. The version number for the selected container is displayed under Node Details in the sidebar. - Option B
Operator users running software version 3.2 or later can execute the command below to determine the current software versions running on each container:curl -X GET -H "X-NSONE-Key: $API_KEY" https://{{ns1-api-fqdn}}/v1/ops/node
Example response:[
{
"nodes": [
{
"hostname": "c6e90590fbc1",
"sync": true,
"type": "core",
"uuid": "f52a990b-eeb6-446b-93ca-25f165c948f4",
"current_lag_ms": 6,
"failure_count": 0,
"health": {
"API Health": 0,
"API Processes": 0,
"Gatewayd Health Check": 0,
"Metrics Processes": 0,
"Primary Data Service Port": 0,
"Primary Data Service Processes": 0,
"Proxy Service": 0,
"Secondary Data Service Port": 0,
"Webserver Processes": 0
},
"healthy": true,
"healthy_count": 133,
"last_health": 1606239117546,
"node_specific_cfg": false,
"seconds_since_last_health_check": 2,
"valid": true,
"version": "3.3.0"
},
{
"hostname": "45dce6e9e417",
"sync": true,
"type": "data",
"uuid": "07a8c141-9365-4045-8371-e310705b9be2",
"current_lag_ms": 3,
"failure_count": 0,
"health": {
"Database Seeded Status": 0,
"In-Memory Database Port": 0,
"In-Memory Database Processes": 0,
"Main Database Port": 0,
"Main Database Processes": 0,
"Main Database Replication Lag": 0,
"Messaging Service Port": 0,
"Operational Metrics Processes": 0,
"Proxy Service": 0
},
"healthy": true,
"healthy_count": 135,
"last_health": 1606239111846,
"node_specific_cfg": false,
"seconds_since_last_health_check": 7,
"valid": true,
"version": "3.3.0"
}
],
"service_def": 0
}
] - Option C
Operator users without access to the SCC portal can execute the following command to view the current software version for each container:docker-compose -p ddi exec <CONTAINER_NAME> supd version
Back up the database.
Execute the command below to locate the primary DATA container:
docker-compose -p exec <CONTAINER_NAME> stc status
Example response:
root@77d115c84b14:/# stc status
=== Active sentinels ===
ID LEADER
00519454 false
ad3e2432 true
f9e28597 false
=== Active proxies ===
No active proxies
=== Keepers ===
UID HEALTHY PG LISTENADDRESS PG HEALTHY PG WANTEDGENERATION PG CURRENTGENERATION
data1 true 127.0.0.1:15432 true 2 2
data2 true 127.0.0.1:15433 true 2 2
data3 true 127.0.0.1:15434 true 4 4
=== Cluster Info ===
Master Keeper: data3
===== Keepers/DB tree =====
data3 (master)
├─data2
└─data1
From the response, locate the primary data container. (In the example above, the primary is data3
. This indicates that the cluster ID of the primary container is 3
.) On that container, run the following command to generate a backup:
docker-compose -p exec <PRIMARY_DATA_CONTAINER_NAME> supd backup_db
This generates a timestamped backup of the Postgres database and saves it to the container at /ns1/data/backup
. Save a copy of this file in a safe location. This is copied to the external volumes for that DATA container.
Download the latest DDI containers.
Go to https://my.nsone.net/#/downloads where you can view the latest DDI software version and changelog. Note that if you are not logged in already, you will be prompted to log into the Managed DNS platform in order to access this page. Download each container one-by-one by clicking the “copy” icon next to the name and description of each container. This copies the corresponding cURL command with an auto-generated API key that you can use to download that container image. The format of the cURL command is as follows:
curl -L -H "X-NSONE-Key: $PORTAL_SESSION_KEY" -o $FILE_NAME -O ‘https://my.nsone.net/v1/products/privatedns?version=$VERSION&resource=$RESOURCE=docker’
Do this for each container, including the DATA, CORE, DNS, DIST, DHCP, XFR, and MONITOR containers.
Instructions for upgrading the software
If using docker-compose, the
container_name
referenced in the calls below is the name of the corresponding service (under “services”).-
Take inventory of all containers (including secondary/standby containers) installed in your deployment and their upstream data paths.
-
Execute the command below to stop and remove each existing DATA container installed in your environment, but do not remove the volumes.
docker-compose -p ddi stop <DATA_CONTAINER_NAME>
- Start the new DATA containers using the same volume mounts as vCurrent. Note: If using docker-compose, this is the name of the corresponding service (under “services”).
TAG=$VERSION_TAG docker-compose -p ddi up -d <DATA_CONTAINER_NAME>
- After approximately 60 seconds, confirm the new DATA containers are healthy. Run the following docker ps to list all containers along with their health status.
docker ps or docker-compose -p ddi ps
- Execute supd upgrade for the primary DATA container only. (See above for instructions on identifying the primary container and its cluster ID. This is the unique integer ID of the data container (1-5).)
docker-compose -p exec <PRIMARY_DATA_CONTAINER_NAME> supd upgrade <previous_version> <new_version>
where<new_version>
is the same as the$VERSION_TAG
used in step 3.
- Stop the vCurrent CORE container, but do not remove the volume.
docker-compose -p ddi stop <CORE_container_name>
- Start the new CORE containers using the same volume mounts as vCurrent. Note: If using docker-compose, this is the name of the corresponding service (under “services”).
TAG=$VERSION_TAG docker-compose -p ddi up -d <core_container_name>
- After approximately 60 seconds, confirm the new CORE containers are healthy. Run the following docker ps to list all containers along with their health status.
docker ps or docker-compose -p ddi ps
- Execute the command below to stop each of the XFR containers.
docker-compose -p ddi stop <XFR_CONTAINER_NAME>
- Execute the command below to list all containers.
docker volume ls
Example response:
$ docker volume ls
DRIVER VOLUME NAME
local ddi_ns1cd1
local ddi_ns1cd2
local ddi_ns1cd3
local ddi_ns1core
local ddi_ns1dhcp
local ddi_ns1dns
local ddi_ns1monitor
local ddi_ns1xfr - Execute the command below to remove the XFR container volume. Repeat this for all XFR containers.
docker volume rm -f <VOLUME_NAME>
- Start the new XFR containers. Note: If using docker-compose, this is the name of the corresponding service (under “services”).
TAG=$VERSION_TAG docker-compose -p ddi up -d <XFR_CONTAINER_NAME>
- After approximately 60 seconds, confirm that the new XFR containers are healthy using the following docker ps command:
docker ps or docker-compose -p ddi ps
- Stop only half of the vCurrent DIST, DNS, DHP, and MONITOR containers.
docker-compose -p ddi stop <CONTAINER_NAME>
- Remove the volumes of the DIST and DNS containers (first half), but do not remove the DHCP or MONITOR container volumes. (Refer to step 10 for the command that generates a list of containers.)
docker rm -v <CONTAINER_NAME>
- Start the new (first half) DIST, DATA, DHCP, and MONITOR containers by executing the command below for each container.
TAG=$VERSION_TAG docker-compose -p ddi up -d <CONTAINER_NAME>
- After approximately 60 seconds, confirm that the new DIST, DATA, DHCP, and MONITOR containers are healthy using the following docker ps command:
docker ps or docker-compose -p ddi ps
- Repeat steps 14-17 for the remaining DIST, DATA, DHCP, and MONITOR containers.
- Refer to the Service Control Center (SCC) portal (Health Overview > View Nodes > Node Details) to verify the container software versions were upgraded.