Skip to content

Latest commit

 

History

History
133 lines (103 loc) · 4.92 KB

how_xenon_upgrades.md

File metadata and controls

133 lines (103 loc) · 4.92 KB

Table of Contents

How to upgrade xenon without affecting MySQL service

Cluster information

Assume:

  1. Cluster has 3 nodes :
xenon-1: 192.168.0.2:8801 LEADER
xenon-2: 192.168.0.3:8801 FOLLOWER
xenon-3: 192.168.0.4:8801 FOLLOWER
  1. The relevant paths:
# The directory of the xenon binary
export XENON_BIN=/opt/xenon
# The path of the config file
export XENON_CONF=/etc/xenon/xenon.json
# The path of the peers file
export XENON_PEERS=/data/raft/peers.json
# The path of the log file
export XENON_LOG=/data/log/xenon.log

Step1. Stop the xenon process for all nodes

Executing follow command on xenon-1:

# avoid leader degrade and remove vip during command execution
pkill -9 xenon && ssh 192.168.0.3 "pkill -9 xenon" && ssh 192.168.0.4 "pkill -9 xenon"

Step2. Remove peers.json for all nodes

Executing follow command on all nodes:

rm ${XENON_PEERS} -f

Step3. Upgrade xenon

Replace the latest xenon and xenoncli for all nodes.

Step4. Start xenon on xenon-1

Executing follow command on xenon-1:

# 
${XENON_BIN}/xenon -c ${XENON_CONF} -r LEADER >> ${XENON_LOG} 2>&1 &

Step5. Start xenon on xenon-2

Executing follow command on xenon-2:

${XENON_BIN}/xenon -c ${XENON_CONF} >> ${XENON_LOG} 2>&1 &

Step6. Add peers for xenon-1

Executing follow command on xenon-1:

${XENON_BIN}/xenoncli cluster add 192.168.0.3:8801

Step7. Add peers for xenon-2

Executing follow command on xenon-2:

${XENON_BIN}/xenoncli cluster add 192.168.0.2:8801

Step8. Start xenon on xenon-3

Executing follow command on xenon-3:

${XENON_BIN}/xenon -c ${XENON_CONF} >> ${XENON_LOG} 2>&1 &

Step9. Add peers for xenon-1 and xenon-2

Executing follow command on xenon-1(LEADER):

${XENON_BIN}/xenoncli cluster add 192.168.0.4:8801

Step10. Add peers for xenon-3

Executing follow command on xenon-3:

${XENON_BIN}/xenoncli cluster add 192.168.0.2:8801,192.168.0.3:8801

Step11. Check cluster status

${XENON_BIN}/xenoncli cluster status

Output:

+-------------------+--------------------------------+---------+---------+--------------------------+---------------------+----------------+------------------+
|        ID         |              Raft              | Mysqld  | Monitor |          Backup          |        Mysql        | IO/SQL_RUNNING |     MyLeader     |
+-------------------+--------------------------------+---------+---------+--------------------------+---------------------+----------------+------------------+
| 192.168.0.2:8801  | [ViewID:1  EpochID:2]@LEADER   | RUNNING | ON      | state:[NONE]␤            | [ALIVE] [READWRITE] | [true/true]    | 192.168.0.2:8801 |
|                   |                                |         |         | LastError:               |                     |                |                  |
+-------------------+--------------------------------+---------+---------+--------------------------+---------------------+----------------+------------------+
| 192.168.0.3:8801  | [ViewID:1  EpochID:2]@FOLLOWER | RUNNING | ON      | state:[NONE]␤            | [ALIVE] [READONLY]  | [true/true]    | 192.168.0.2:8801 |
|                   |                                |         |         | LastError:               |                     |                |                  |
+-------------------+--------------------------------+---------+---------+--------------------------+---------------------+----------------+------------------+
| 192.168.0.4:8801  | [ViewID:1  EpochID:2]@FOLLOWER | RUNNING | ON      | state:[NONE]␤            | [ALIVE] [READONLY]  | [true/true]    | 192.168.0.2:8801 |
|                   |                                |         |         | LastError:               |                     |                |                  |
+-------------------+--------------------------------+---------+---------+--------------------------+---------------------+----------------+------------------+