Upgrade Instructions 6.0.0 - Upgrading Consul

Migrating from consul 0.7.x to 0.9.0

1) Find the leader and servers in the consul cluster.

root@qa3-services1:~# curl http://qa3-services1.host.ooflex.net:8500/v1/status/leader
"10.20.15.35:8300" 
            

2) Find the peers i.e the servers that can affect the quorum and participate in leader election :

root@qa3-services1:~# curl http://qa3-services1.host.ooflex.net:8500/v1/status/peers
["10.20.15.164:8300","10.20.15.35:8300","10.20.15.73:8300"] 
            

3) Do not upgrade the leader first, start with the servers, then upgrade the leader, and then upgrade the clients. In order to upgrade a consul server, change the docker-compose.yml file and update the image tag.

root@qa3-services2:~# head -23 /flex/docker-compose.yml
version: "2"
services:
  consul:
    image: registry.ooflex.net/consul:0.9.0update
    container_name: consul
    volumes:
      - /flex/consul:/flex/consul
    ports:
      - "8300:8300"
      - "8301:8301"
      - "8301:8301/udp"
      - "8302:8302"
      - "8400:8400"
      - "8500:8500"
      - "53:8600/udp"
    environment:
      - IP=10.20.15.73
      - CONSUL=10.20.15.164
      - SERVICE_IGNORE=true
    network_mode: "host"   
           

4) Run the following commands to pull the latest image, and then perform the upgrade for the first server:

cd /flex
docker-compose pull consul
docker-compose up -d --no-deps consul 
            

5) Check the version of consul by running the following command:

            root@qa3-services2:/flex# docker-compose exec consul consul members | grep server
qa3-services1            10.20.15.35:8301   alive   server  0.7.5  2         dc1
qa3-services2            10.20.15.73:8301   alive   server  0.9.0  2         dc1
qa3-services3            10.20.15.164:8301  alive   server  0.7.5  2         dc1  
        

6) Perform a similar upgrade for the second server, in this example it is (10.20.15.164). Once the upgrade is complete, run the following command to see the version of consul that is running:

              root@qa3-services3:/flex# docker-compose exec consul consul members | grep server
qa3-services1            10.20.15.35:8301   alive   server  0.7.5  2         dc1
qa3-services2            10.20.15.73:8301   alive   server  0.9.0  2         dc1
qa3-services3            10.20.15.164:8301  alive   server  0.9.0  2         dc1     
           

7) Perform the upgrade on the leader node and check the member status:

root@qa3-services1:/flex# docker-compose exec consul consul members | grep server
qa3-services1            10.20.15.35:8301   alive   server  0.9.0  2         dc1
qa3-services2            10.20.15.73:8301   alive   server  0.9.0  2         dc1
qa3-services3            10.20.15.164:8301  alive   server  0.9.0  2         dc1         
            

8) Once the servers have been upgraded, upgrade all the clients. You can use the ansible playbook to perform the rolling update. Once the upgrade is done, you can check the version of consul running across the cluster, using the following command. A successful upgrade is as follows :

               root@qa3-master2:/flex# docker-compose exec consul consul members
Node                     Address            Status  Type    Build  Protocol  DC
qa3-adobepremierepanel1  10.20.15.46:8301   alive   client  0.9.0  2         dc1
qa3-adobepremierepanel2  10.20.15.116:8301  alive   client  0.9.0  2         dc1
qa3-authentication1      10.20.15.59:8301   alive   client  0.9.0  2         dc1
qa3-authentication2      10.20.15.94:8301   alive   client  0.9.0  2         dc1
qa3-authorisation1       10.20.15.50:8301   alive   client  0.9.0  2         dc1
qa3-authorisation2       10.20.15.118:8301  alive   client  0.9.0  2         dc1
qa3-dataaggregation1     10.20.15.48:8301   alive   client  0.9.0  2         dc1
qa3-dataaggregation2     10.20.15.122:8301  alive   client  0.9.0  2         dc1
qa3-divarchive1          10.20.15.14:8301   alive   client  0.9.0  2         dc1
qa3-divarchive2          10.20.15.72:8301   alive   client  0.9.0  2         dc1
qa3-event1               10.20.15.44:8301   alive   client  0.9.0  2         dc1
qa3-event2               10.20.15.95:8301   alive   client  0.9.0  2         dc1
qa3-fastobject1          10.20.15.24:8301   alive   client  0.9.0  2         dc1
qa3-fastobject2          10.20.15.83:8301   alive   client  0.9.0  2         dc1
qa3-imageproxy1          10.20.15.31:8301   alive   client  0.9.0  2         dc1
qa3-imageproxy2          10.20.15.125:8301  alive   client  0.9.0  2         dc1
qa3-index1               10.20.15.41:8301   alive   client  0.9.0  2         dc1
qa3-index2               10.20.15.82:8301   alive   client  0.9.0  2         dc1
qa3-job1                 10.20.15.8:8301    alive   client  0.9.0  2         dc1
qa3-job2                 10.20.15.75:8301   alive   client  0.9.0  2         dc1
qa3-mam1                 10.20.15.23:8301   alive   client  0.9.0  2         dc1
qa3-mam2                 10.20.15.121:8301  alive   client  0.9.0  2         dc1
qa3-master1              10.20.15.39:8301   alive   client  0.9.0  2         dc1
qa3-master2              10.20.15.108:8301  alive   client  0.9.0  2         dc1
qa3-merge1               10.20.15.43:8301   alive   client  0.9.0  2         dc1
qa3-merge2               10.20.15.87:8301   alive   client  0.9.0  2         dc1
qa3-metadata1            10.20.15.20:8301   alive   client  0.9.0  2         dc1
qa3-metadata2            10.20.15.110:8301  alive   client  0.9.0  2         dc1
qa3-mtpanels1            10.20.15.29:8301   alive   client  0.9.0  2         dc1
qa3-mtpanels2            10.20.15.112:8301  alive   client  0.9.0  2         dc1
qa3-outboundtransfer1    10.20.15.21:8301   alive   client  0.9.0  2         dc1
qa3-outboundtransfer2    10.20.15.71:8301   alive   client  0.9.0  2         dc1
qa3-publish1             10.20.15.62:8301   alive   client  0.9.0  2         dc1
qa3-publish2             10.20.15.91:8301   alive   client  0.9.0  2         dc1
qa3-reviewer1            10.20.15.4:8301    alive   client  0.9.0  2         dc1
qa3-reviewer2            10.20.15.74:8301   alive   client  0.9.0  2         dc1
qa3-search1              10.20.15.22:8301   alive   client  0.9.0  2         dc1
qa3-search2              10.20.15.103:8301  alive   client  0.9.0  2         dc1
qa3-services1            10.20.15.35:8301   alive   server  0.9.0  2         dc1
qa3-services2            10.20.15.73:8301   alive   server  0.9.0  2         dc1
qa3-services3            10.20.15.164:8301  alive   server  0.9.0  2         dc1
qa3-storage1             10.20.15.40:8301   alive   client  0.9.0  2         dc1
qa3-stream1              10.20.15.54:8301   alive   client  0.9.0  2         dc1
qa3-stream2              10.20.15.113:8301  alive   client  0.9.0  2         dc1
qa3-tag1                 10.20.15.17:8301   alive   client  0.9.0  2         dc1
qa3-tag2                 10.20.15.88:8301   alive   client  0.9.0  2         dc1
qa3-transfer1            10.20.15.53:8301   alive   client  0.9.0  2         dc1
qa3-transfer2            10.20.15.85:8301   alive   client  0.9.0  2         dc1
qa3-workflow1            10.20.15.26:8301   alive   client  0.9.0  2         dc1
qa3-workflow2            10.20.15.109:8301  alive   client  0.9.0  2         dc1
qa3-zoomintvpanels1      10.20.15.34:8301   alive   client  0.9.0  2         dc1
qa3-zoomintvpanels2      10.20.15.79:8301   alive   client  0.9.0  2         dc1
           

As indicated by the build column, the version of consul being used is now 0.9.0

https://help.ooyala.com/sites/all/libraries/dita/en/media-logistics/flex/dev/60/upgrade_instructions_60_consul_upgrade.html

Was this article helpful?