openGemini cluster deployment guide, get started easily!

Cluster deployment can deploy all three components of openGemini on one node, or the components can be deployed on multiple nodes.

Download the binary package and refer to installation and deployment.

https://docs.opengemini.org/zh/guide/quick_start/get_started.html

Deploy pseudo cluster

All components of the openGemini cluster are deployed on the same node. This cluster deployment method is called pseudo-cluster deployment. Currently, the community provides the deployment script install_cluster.sh.

> sh scripts/install_cluster.sh

hint

Execute this command to directly launch an openGemini cluster locally without modifying the configuration file, including 1 ts-sql, 3 ts-meta and 2 ts-store components. However, the cluster only monitors and runs on the local loopback address 127.0.0.1, which can be used for local function testing and learning, and cannot provide external access services.

If you want the cluster to listen to the local IP and make it accessible to external nodes, the configuration is relatively complicated. Although it is feasible, it is not recommended in a production environment. Also take the deployment of a cluster consisting of 1 ts-sql, 3 ts-meta and 2 ts-store as an example.

Assign port

All nodes listen to the local IP address, such as 192.168.0.1, so the same port cannot be used between all components and needs to be reassigned. The following allocations can be made (reference):

Configuration file modification

The cluster configuration items of openGemini are concentrated in the openGemini.conf file. When we configure the cluster, if we deploy only one ts-meta, one ts-sql and one ts-store on the same node, or combine two of them or For a component, if the same component is not deployed on the same node (because there is no IP and port conflict), you can consider sharing a configuration file openGemini.conf for all components on the node.

Obviously, you cannot share one when deploying a pseudo-cluster, because there are 3 ts-meta and 2 ts-store on the same node. Because there will be IP conflicts, we recommend that each component corresponds to a configuration file. The specific steps are as follows:

> cp –rf openGemini.conf sql.conf> cp –rf openGemini.conf meta-1.conf> cp –rf openGemini.conf meta-2.conf> cp –rf openGemini.conf meta-3.conf> cp –rf openGemini.conf store-1.conf> cp –rf openGemini.conf store-2.conf

Modify sql.conf and only modify the following parts. The local IP address is 192.168.0.1 as an example.

[common]meta-join = ["192.168.0.1:8092", "192.168.0.1:8094", "192.168.0.1:8096"][http]bind-address = "192.168.0.1:8086"[logging]# 建议修改目录path = "/path/openGemini/logs"

Modify meta-1.conf, only modify the following parts

[common]meta-join = ["192.168.0.1:8092", "192.168.0.1:8094", "192.168.0.1:8096"][meta]bind-address = "192.168.0.1:8088"http-bind-address = "192.168.0.1:8091"rpc-bind-address = "192.168.0.1:8092"// 预防/tmp空间不足,建议替换/tmp目录dir = "/path/to/openGemini/data/meta/1"[logging]# 建议修改目录path = "/path/openGemini/logs"[gossip]bind-address = "192.168.0.1"meta-bind-port = 8010members = ["192.168.0.1:8010", "192.168.0.1:8012", "192.168.0.1:8013"

Modify meta-2.conf, only modify the following parts

[common]meta-join = ["192.168.0.1:8092", "192.168.0.1:8094", "192.168.0.1:8096"][meta]bind-address = "192.168.0.1:8089"http-bind-address = "192.168.0.1:8093"rpc-bind-address = "192.168.0.1:8094"// 预防/tmp空间不足,建议替换/tmp目录dir = "/path/to/openGemini/data/meta/2"[logging]# 建议修改目录path = "/path/openGemini/logs"[gossip]bind-address = "192.168.0.1"meta-bind-port = 8012members = ["192.168.0.1:8010", "192.168.0.1:8012", "192.168.0.1:8013"]

Modify meta-3.conf, only modify the following parts

[common]meta-join = ["192.168.0.1:8092", "192.168.0.1:8094", "192.168.0.1:8096"][meta]bind-address = "192.168.0.1:8090"http-bind-address = "192.168.0.1:8095"rpc-bind-address = "192.168.0.1:8096"// 为防/tmp空间不足,建议替换/tmp目录dir = "/path/to/openGemini/data/meta/3"[logging]# 建议修改目录path = "/path/openGemini/logs"[gossip]bind-address = "192.168.0.1"meta-bind-port = 8013members = ["192.168.0.1:8010", "192.168.0.1:8012", "192.168.0.1:8013"]

Modify store-1.conf and only modify the following parts. To prevent insufficient /tmp space, it is recommended to replace the /tmp directory.

[common]meta-join = ["192.168.0.1:8092", "192.168.0.1:8094", "192.168.0.1:8096"][data]store-ingest-addr = "192.168.0.1:8400"store-select-addr = "192.168.0.1:8401"store-data-dir = "/path/to/openGemini/data/1"store-wal-dir = "/path/to/openGemini/data/1"store-meta-dir = "/path/to/openGemini/data/meta/1"[logging]# 建议修改目录path = "/path/openGemini/logs"[gossip]bind-address = "192.168.0.1"store-bind-port = 8011members = ["192.168.0.1:8010", "192.168.0.1:8012", "192.168.0.1:8013"]

Modify store-2.conf, only modify the following parts

[common]meta-join = ["192.168.0.1:8092", "192.168.0.1:8094", "192.168.0.1:8096"][data]store-ingest-addr = "192.168.0.1:8402"store-select-addr = "192.168.0.1:8403"store-data-dir = "/path/to/openGemini/data/2"store-wal-dir = "/path/to/openGemini/data/2"store-meta-dir = "/path/to/openGemini/data/meta/2"[logging]# 建议修改目录path = "/path/openGemini/logs"[gossip]bind-address = "192.168.0.1"store-bind-port = 8014members = ["192.168.0.1:8010", "192.168.0.1:8012", "192.168.0.1:8013"]

If you still need to add ts-store, you can change the port according to this configuration and then pull it up.

Pull up the cluster

Edit script

> cp –rf scripts/install_cluster.sh  scripts/cluster.sh> vim scripts/cluster.sh

Delete or comment lines 27-38 of the cluster.sh script

# generate configfor((i = 1; i <= 3; i++))dorm -rf config/openGemini-$i.confcp config/openGemini.conf config/openGemini-$i.confsed -i "s/{{meta_addr_1}}/${nodes[1]}/g" config/openGemini-$i.confsed -i "s/{{meta_addr_2}}/${nodes[2]}/g" config/openGemini-$i.confsed -i "s/{{meta_addr_3}}/${nodes[3]}/g" config/openGemini-$i.confsed -i "s/{{addr}}/${nodes[$i]}/g" config/openGemini-$i.confsed -i "s/{{id}}/$i/g" config/openGemini-$i.confdone

Then modify the configuration file and related log directory in the startup command.

nohup build/ts-meta -config config/openGemini -1.conf -pidfile /tmp/openGemini/pid/meta1.pid > /tmp/openGemini/logs/1/meta_extra1.log 2>&1 &

Change to

nohup build/ts-meta -config config/meta-1.conf -pidfile /path/openGemini/pid/meta1.pid > /path/openGemini/logs/1/meta_extra1.log 2>&1 &

and so on

After the modification is completed, execute the command to start the pseudo cluster.

> sh scripts/cluster.sh

Standard cluster deployment

At present, there is no automated script for cluster deployment, and it can only be deployed manually. Interested children are welcome to contribute to the community!

The openGemini cluster deployment is as shown in the figure. The cluster includes ts-meta(3x), ts-sql(2x), ts-store(2x):

In this deployment method, no two identical components are deployed on the same node, and there is no port competition, so all components on the same node can share a configuration file.


Taking Node1:192.168.0.1 as an example, you only need to modify the configuration file openGemini.conf as follows:

[common]meta-join = ["192.168.0.1:8092", "192.168.0.2:8092", "192.168.0.3:8092"][meta]bind-address = "192.168.0.1:8088"http-bind-address = "192.168.0.1:8091"rpc-bind-address = "192.168.0.1:8092"# 建议修改目录dir = "/path/openGemini/data/meta/1"[http]bind-address = "192.168.0.1:8086"[data]store-ingest-addr = "192.168.0.1:8400"store-select-addr = "192.168.0.1:8401"# 建议修改目录store-data-dir = "/path/openGemini/data/1"store-wal-dir = "/path/openGemini/data/1"store-meta-dir = "/path/openGemini/data/meta/1"[logging]# 建议修改目录path = "/path/openGemini/logs"[gossip]bind-address = "192.168.0.1"store-bind-port = 8011meta-bind-port = 8010members = ["192.168.0.1:8010", "192.168.0.2:8010", "192.168.0.3:8010"

The configuration files of Node2 and Node3 remain unchanged in two places:

[common]meta-join = ["192.168.0.1:8092", "192.168.0.2:8092", "192.168.0.3:8092"][gossip]store-bind-port = 8011meta-bind-port = 8010members = ["192.168.0.1:8010", "192.168.0.2:8010", "192.168.0.3:8010"]

The IP addresses in other places can be replaced with Node2's IP 192.168.0.2 and Node3's IP 192.168.0.3 respectively. The ports do not need to be modified.

Tip: openGemini has requirements for the component startup sequence when pulling up the cluster.

First start the ts-meta component on all three nodes (command example):

> nohup ts-meta --config openGemini.conf -pidfile meta.pid > meta_extra.log 2>&1 

Then start the ts-store component (command example):

> nohup ts-store --config openGemini.conf -pidfile store.pid > store_extra.log 2>&1 &

Finally start the ts-sql component (command example):

> nohup ts-sql --config openGemini.conf -pidfile sql.pid > sql_extra.log 2>&1 &

Client connection, refer to  ts-cli command line

https://docs.opengemini.org/zh/guide/quick_start/get_started.html#%E5%91%BD%E4%BB%A4%E8%A1%8C-ts-cli

Summarize

This article introduces you in detail how to easily deploy a cluster in openGemini in three steps: ① Deploy a pseudo cluster - ② Pull up the cluster - ③ Standard cluster deployment. This guide is simple and easy to understand and is very suitable for novices. I believe reading this article will help you deploy clusters efficiently and reliably.

If you encounter difficulties in using openGemini, you are welcome to ask the community for help.


openGemini official website: http://www.openGemini.org

openGemini open source address: https://github.com/openGemini

openGemini public account:

Welcome to pay attention~ We sincerely invite you to join the openGemini community to build, govern and share the future together!

The author of the open source framework NanUI switched to selling steel, and the project was suspended. The first free list in the Apple App Store is the pornographic software TypeScript. It has just become popular, why do the big guys start to abandon it? TIOBE October list: Java has the biggest decline, C# is approaching Java Rust 1.73.0 Released A man was encouraged by his AI girlfriend to assassinate the Queen of England and was sentenced to nine years in prison Qt 6.6 officially released Reuters: RISC-V technology becomes the key to the Sino-US technology war New battlefield RISC-V: Not controlled by any single company or country, Lenovo plans to launch Android PC
{{o.name}}
{{m.name}}

Guess you like

Origin my.oschina.net/u/3234792/blog/10116746