“Technology sharing” 10 minutes to quickly play Kunlun cluster


This document is for reference only. For details, please see:


When all libraries and dependencies are installed, compared with manual installation of Kunlun cluster, it takes 30 minutes to an hour to install, and one click quick installation takes only 10 minutes to play.

Before installation, ensure that the installation environment meets the following requirements:

1. The machine where all nodes are located must be Linux with bash, SED, gzip, python2, python2 Dev and other tools or libraries installed. The python 2 executable is set to python2.

2. The machine where all cluster nodes are located has correctly set up a user. The node will start with this user. This user can run sudo without a password.

3. For the machine where the storage node is installed, the following Library (Ubuntu 20.04 here) needs to be installed in advance: libncurses5 libaio dev.

4. For the machine where the compute node is installed, the following libraries (Ubuntu 20.04 here) need to be installed in advance: libncurses5 libicu66 Python setuptools GCC.

5. For the installation action, you need to put the binary distribution package (percona-8.0.18-bin-rel.tgz, postgresql-11.5-rel.tgz, cluster_mgr_rel.tgz) into the current directory in advance. In addition, the network between the tool running machine and the machine where the node is located cannot be too slow because the distribution package needs to be delivered to these machines.

Taking Ubuntu as an example, you can install the corresponding libraries through sudo apt get install, such as installing python2:

The picture shows that python2 has been installed in this environment, so it is suggested that python2 is the latest version.

You can view the installed libraries through apt list — installed.

Because there are too many installed libraries listed, it is a better way to filter the specified libraries with grep.

After completing the above requirements, you can start to quickly install Kunlun cluster with one click

The following installation is a personal environment based installation of Kunlun cluster (for reference only)

1. Pull Kunlun scripts package on gitee through git clone:

git clone https://gitee.com/zettadb/kun…

2. CD enters Kunlun_ Under scripts / cluster:

cd kunlun_scripts/cluster

3. Get the latest version of the download package: take 0.8.3 as an example (version 0.8.4 will be launched in the near future, please look forward to it)

(1) Enter the official website of zetuohttp://downloads.zettadb.com/, click product download.

(2) Click releases / 0.8.3/release binaries to obtain the download addresses of the three installation packages, which can be obtained by right clicking – copy link address:

(3) In Ubuntu, use WGet to obtain three download packages to the current cluster Directory:

4. Edit and modify the configuration file install.json: VI install.json (see Step 5 for configuration details)

5. Now there are three servers. Configure the cluster nodes on the three servers through the configuration file install.json:, and

(1) Set machines: under this setting, if a server cannot create a default directory because of permissions, or a server cannot use the default user, the script will use the user and basedir configured in machines

(2) Set meta node (MySQL):

(3) Set comp node (PostgreSQL):

(4) Set data node (MySQL):

(5) Set clustermgr: (generally the master node of meta node)

In the process of configuration, we should:

Three MySQL nodes are used to form a 3-copy meta shard

Add six MySQL nodes to form two data Shards. Each shard has three copies

Three PostgreSQL nodes are used to form three independent nodes to process client requests

Of course, if there is only one computer, you can also set all nodes to one IP address. The ports are different. The data of each node is different_ Dir should be in different directories.

6. One click cluster installation: use generate_ Scripts.py generates scripts. Action is install, config is the configuration file just edited, install.json, and defuser is set as the default working user.

Defuser: most or all machines can use this user. If there is no default user, use the user of machines in the configuration file (specified by yourself)

(1) sudo python2 generate_scripts.py action=install config=install.json defuser=kunlun

(2) bash install/commands.sh

If you are required to enter a password in this step, set the current account to automatically verify login. After setting, SSH severname.com

Ubuntu can refer to:https://www.iteye.com/blog/qu…

CentOS can refer to:https://blog.csdn.net/zyj4931…

(3) Wait patiently for two or three minutes, as long as it doesn’t appear!!! FAILURES!!! Or other errors indicate that the installation is successful

7. One click stop: defbase is the default working directory and action is stop.

Defbase: most or all machines can create the default working directory. If the default working directory cannot be created, use the basedir of machines in the configuration file (specified by yourself)

(1) python2 generate_scripts.py action=stop config=install.json defbase=/kunlun

(2) bash stop/commands.sh

8. One click cluster start: the action is start.

(1) sudo python2 generate_scripts.py action=start config=install.json

(2) bash start/commands.sh

9. One click Clear cluster: the action is clean.

(1) sudo python2 generate_scripts.py action=clean config=install.json

(2) bash clean/commands.sh

Before using this command, the working directory cannot be cleared first, otherwise the script cannot find the working directory and execute this command. After using it, the working directory can be eliminated

If you need technical support, you can search kunlundb Linda through wechat, add customer service and communicate online.

Long press the QR code and scan the code to add customer service Linda

Recommended Today

Swift advanced (XV) extension

The extension in swift is somewhat similar to the category in OC Extension can beenumeration、structural morphology、class、agreementAdd new features□ you can add methods, calculation attributes, subscripts, (convenient) initializers, nested types, protocols, etc What extensions can’t do:□ original functions cannot be overwritten□ you cannot add storage attributes or add attribute observers to existing attributes□ cannot add parent […]