Introduction to online upgrade of sequoiadb version

Time:2020-11-24

1. Preface

During the development of sequoiadb database, a formal release version is basically released every six months. And each new release version has a great improvement in performance compared with the old version, and the database will also add many new functions in the new version, hoping to improve the ease of use of database development.

In the development process of sequoiadb, more and more developers are aware of it and are interested in it. Now more and more users are learning and studying sequoiadb. After fully testing sequoiadb, more and more enterprise users decide to deploy sequoiadb in the enterprise’s production environment. Taking advantage of sequoiadb’s distributed storage, it can provide high concurrency and low latency data operation services.

In many enterprise customers of sequoiadb, the production system using sequoiadb database is an important system within the enterprise, which must support 24 * 7 external service. Therefore, even when the database version is upgraded, it must also meet the technical requirements of database service on-line.

Through the introduction of sequoiadb online upgrade principle and detailed upgrade steps, this paper provides an operational database online upgrade scheme document for the majority of sequoiadb users, hoping to provide help for users who are about to upgrade the version of sequoiadb.

2. Background

2.1 introduction to server resources

Introduction to online upgrade of sequoiadb version

2.2 operating system and database software version

Introduction to online upgrade of sequoiadb version

2.3 data cluster deployment and deployment architecture

Introduction to online upgrade of sequoiadb version

3. Version upgrade compatibility

Introduction to online upgrade of sequoiadb version

4. Sequoiadb supports online upgrade principle

In sequoiadb cluster, if the deployment environment is that all node groups are redundant, users can upgrade the database versions on each server one by one.
The online upgrade method is shown in the figure below:

Introduction to online upgrade of sequoiadb version

Users first select a server, stop all sequoiadb processes and all database services of the current machine. You can refer to the usage of the sdbstop command, and then directly use the new version of the database installation package to replace and install the old version. After the new version of the database is installed, it will automatically start all sequoiadb related processes of this machine. Once the upgraded database service is successfully started, the database version upgrade of this server is completed.

Users can perform the same operation on the remaining servers in the same way until all servers have completed the version upgrade and all database services have been successfully started.

5. Online upgrade steps of sequoiadb version

5.1 environmental information collection before upgrading

Before upgrading the version of sequoiadb cluster, users should have a general understanding of the basic situation of sequoiadb cluster and collect the database information.

Check that the installation path of the sequoiadb database has been assigned by the operating system to the system users of the database. This step recommends that the user execute this step on all the machines where the sequoiadb service is deployed.

Switch to root

su - root

View the installation path of the sequoiadb database and the users assigned by the operating system
cat /etc/default/sequoiadb
Taking the author’s environment as an example, the printed contents are as follows:

NAME=sdbcm
SDBADMIN_USER=sdbadmin
INSTALL_DIR=/opt/sequoiadb
MD5=d60fdabd78e05f0ad482b938f1df1d72

Through the / etc / default / sequoiadb file, users can quickly understand the basic situation of sequoiadb
Users can understand the deployment of sequoiadb database cluster through the SDB shell console
Switch to sdbadmin user

su - sdbadmin

Enter the SDB shell console

/opt/sequoiadb/bin/sdb

Connect to database coord node

> db = new Sdb("localhost", 11810)

View sequoiadb cluster deployment

> db.list(7)

Taking the author’s environment as an example, the printed content is as follows (the document has been omitted due to its long length)

{
  "Group": [
    {
      "dbpath": "/opt/sequoiadb/database/catalog/11800",
      "HostName": "sdb1",
      "Service": [
        {
          "Type": 0,
          "Name": "11800"
        },
        {
          "Type": 1,
          "Name": "11801"
        },
        {
          "Type": 2,
          "Name": "11802"
        },
        {
          "Type": 3,
          "Name": "11803"
        }
      ],
      "NodeID": 1
    },
……
……
……
    {
      "HostName": "sdb3",
      "dbpath": "/opt/sequoiadb/database/data/11930",
      "Service": [
        {
          "Type": 0,
          "Name": "11930"
        },
        {
          "Type": 1,
          "Name": "11931"
        },
        {
          "Type": 2,
          "Name": "11932"
        }
      ],
      "NodeID": 1008
    }
  ],
  "GroupID": 1002,
  "GroupName": "group3",
  "PrimaryNode": 1008,
  "Role": 0,
  "Status": 1,
  "Version": 4,
  "_id": {
    "$oid": "580c1fc9a378cafcebe4e956"
  }
}

From the printed information, users can basically know how many servers sequoiadb has used, how many data groups have been established, how many nodes each data group contains, and what the data storage path and port number of the nodes are db.list (7) Command.

According to the demonstration environment, the author sorts out the information as follows:

Introduction to online upgrade of sequoiadb version

5.2 database version upgrade
The upgrade step must be performed one by one server. You cannot perform the upgrade database version step on all servers at the same time.
Taking upgrading 01 server as an example, the author records the steps of upgrading sequoiadb version on a server in detail.
Switch sdbadmin user

su - sdbadmin

Stop the sdbcm service of the current server

/opt/sequoiadb/bin/sdbcmtop

All current server services are stopped by sequodb

/opt/sequoiadb/bin/sdbstop
/opt/sequoiadb/bin/sdbstop -p 11780

Check the current server to see if all sequoiadb servers are stopped

/opt/sequoiadb/bin/sdblist -t all -m run

If the sequoiadb service is still running, executing the sdblist command will print the running service information of sequoiadb on the screen, such as

sdbom(11780) (31966)
Total: 1

After confirming that all sequoiadbs are stopped, upgrade the sequoiadb version to the current server
Switch root permissions

su - root

Granting executable rights to sequoiadb execution software

chmod a+x /opt/sequoiadb-2.6-linux_x86_64-enterprise-installer.run

Execute the sequoiadb new version installation command

/opt/sequoiadb-2.6-linux_x86_64-enterprise-installer.run

Let the user choose the language of installation, here choose 1, English

Please select the installation language
[1] English - English
[2] Simplified Chinese - Simplified Chinese
Please choose an option [1] : 1

Then, a bunch of license contents will be displayed to let the user choose to ignore the selection 1 directly. If you want to know more about it, select 2 to view it

License Agreement for Evaluation of Programs

[1] Agree The License: For More License's Detail, Please Check The License File After Installation
[2] Read The License
Please choose an option [1] : 1

Let the user choose whether to agree with this license. Here, select y (yes)

Do you accept this license? [y/n]: y

The software detects that sequoiadb has been installed on this machine, so the user can choose whether to upgrade the version. Here, select y (yes)

An existing installation has been detected in /opt/sequoiadb. Change to upgrade mode? [Y/n]: y

The installation software is ready. Do you want to continue with the installation? Here, select y (yes)

Setup is now ready to begin installing SequoiaDB Server on your computer.

Do you want to continue? [Y/n]: Y

Then the software will be formally installed, and the following contents will appear

Please wait while Setup installs SequoiaDB Server on your computer.

 Installing
 0% ______________ 50% ______________ 100%
 Begin to upgrade package ......
**************************  check list *************************************
Check: configure file /etc/default/sequoiadb is exists ...... ok
Check: get install directory and user in /etc/default/sequoiadb ...... ok
Check: install dir /opt/sequoiadb is not empty ...... ok
Check: compatibility between version 1.12.5 Enterprise and 2.6 Enterprise ...... ok
Check: disk space is enough ...... ok
Check: user sdbadmin is exist, and get group ......  ok
Check: relevant processes are stoped ...... ok
#########################################

As long as the following information appears on the screen, the sequoiadb software version upgrade has been successful

Setup has finished installing SequoiaDB Server on your computer.

5.3 sequoiadb version upgrade check
After the version of sequoiadb is upgraded, sdbcm will automatically start all sequoiadb services of the current machine. Users can check and confirm through the sdblist command. Before the user executes the command, the author suggests that the user should switch the system user first

su - sdbadmin

Check the sequoiadb database service startup.

/opt/sequoiadb/bin/sdblist -t all -m local

For example, for the author’s environment, the printed content is:

sequoiadb(11920) (12808) D
sequoiadb(11930) (12811) D
sdbom(11780) (12792)
sequoiadb(11910) (12812) D
sequoiadb(11810) (12805) S
sequoiadb(11800) (12780) C
sdbcm(11790) (12770)
sdbcmd (12768)
Total: 8

If some nodes do not start normally, the following information will be printed

sequoiadb(11920) (12808) D
sequoiadb(11930) (12811) D
sdbom(11780) (12792)
sequoiadb(11910) (12812) D
sequoiadb(11810) (-) S
sequoiadb(11800) (12780) C
sdbcm(11790) (12770)
sdbcmd (12768)
Total: 8

If sequoiadb (11810) (-) s is displayed, it indicates that the node exists in the server, but the node is not started.
After the sequoiadb version is upgraded, although all processes have been started, the user still needs to confirm that the started node has recovered to normal and can provide services normally.

When checking whether the node is restored to normal, the user only needs to check the status of the catalog node and data node, that is

sequoiadb(11920) (12808) D
sequoiadb(11930) (12811) D
sequoiadb(11910) (12812) D
sequoiadb(11800) (12780) C

User enters sequoiadb shell

/opt/sequoiadb/bin/sdb

Select one of the nodes and check the connection

> var db = new Sdb("localhost", 11910);
> db.snapshot(6, {}, {"ServiceStatus":null});
> db.close();

As long as the content {“ServiceStatus”: true} printed by snapshot (6) is equal to true, it means that the service of this node has recovered and is in normal operation state. If it is false, it means that the node status has not been restored. Generally, ServiceStatus = false means that the node is in full synchronization state.

Repeat this action and check the rest localhost:11920 , localhost:11930 , localhost:11800 Whether the node status is normal. If the status of a node is abnormal, you need to wait patiently for the node to complete the data check or data synchronization until the node status returns to normal, and the current server’s sequoiadb version upgrade is finished.

> var db = new Sdb("localhost", 11920);
> db.snapshot(6, {}, {"ServiceStatus":null});
> db.close();
> var db = new Sdb("localhost", 11920);
> db.snapshot(6, {}, {"ServiceStatus":null});
> db.close();
> var db = new Sdb("localhost", 11800);
> db.snapshot(6, {}, {"ServiceStatus":null});
> db.close();

When the user completes the sequoiadb version upgrade of the current server, the user can execute the same command on two other servers to start the sequoiadb version upgrade until all servers in the database cluster are upgraded.

6. Summary

During the deployment of sequoiadb cluster, three servers are used to do data redundancy with each other to ensure the data security of the whole database cluster. Moreover, the database processes of each server are independent of each other, and there is no data dependence among them. When upgrading the database version, the user can make use of the feature of three copies of data redundancy, and upgrade the sequoiadb database version on each server one by one through the rolling upgrade of the whole database cluster, so as to complete the database version upgrade of all servers.

Download the latest version of sequoiadb database 2.6
Sequoiadb database technology blog
Sequoiadb Tsuga database community