当前位置:网站首页>2022-02-11 practice of using freetsdb to build an influxdb cluster
2022-02-11 practice of using freetsdb to build an influxdb cluster
2022-07-03 12:55:00 【a tracer】
Catalog
freetsdb Official instructions for setting up a cluster :
Local virtual machine deployment freetsdb:
With 192.168.58.132 For example , The configuration file :
Check the formation of the cluster :
Abstract :
Record the use of freetsdb Building clusters .
Environmental preparation :
- At least three independent virtual machines
- Compilation and installation freetsdb
freetsdb Official instructions for setting up a cluster :
## Deploy
FreeTSDB Native support for distributed cluster capabilities ,FreeTSDB Cluster deployment mainly involves META Nodes and DATA node ,META Nodes store metadata necessary for system operation ,DATA The node stores the actual timing data . This document will be in 3 META node 、2 DATA Take the cluster of nodes as an example to demonstrate how to build FreeTSDB colony .
### Deploy META node
Based on the consideration of availability and resource cost ,META Nodes are recommended as 3 node .
#### To configure META Grounding that
##### Step 1: modify /etc/hosts file , Configure host name information .
Will each META Node name ( such as cluster-meta-node-01) And the corresponding address information ( such as <Meta_1_IP>) Configuration in each META Nodes and DATA Node /etc/hosts In file .
```
<Meta_1_IP> cluster-meta-node-01
<Meta_2_IP> cluster-meta-node-02
<Meta_3_IP> cluster-meta-node-03
```
After configuring the host name information , In each META Nodes and each DATA On the node, execute the following ping command , Ensure the correctness of configuration and network connectivity .
>
> ping -qc 1 cluster-meta-node-01
>
> ping -qc 1 cluster-meta-node-02
>
> ping -qc 1 cluster-meta-node-03
##### Step 2: Configure and start META service
In each META Node , Execute the following commands respectively .
###### I. Download installation package
such as , stay Linux On the system , Use the following command to download freetsdb-v0.0.2-beta.1 Installation package .
```
wget https://github.com/freetsdb/freetsdb/releases/download/v0.0.2-beta.1/freetsdb-v0.0.2-beta.1_linux_amd64.tar.gz
tar -zxvf freetsdb-v0.0.2-beta.1_linux_amd64.tar.gz
```
###### II. Modify the configuration
Modify the configuration file ./freetsdb-meta.conf, And will hostname Set as the host name of this computer ( such as <cluster-meta-node-0x>)
```
# Hostname advertised by this host for remote addresses. This must be resolvable by all
other nodes in the cluster
hostname="<cluster-meta-node-0x>"
```
###### III. start-up META service
stay Linux shell Command line , Execute the following command .
```
sudo ./freetsd-meta -config ./freetsd-meta.conf
```
###### Step 3: take META Nodes join the cluster
In one of them META Node ( such as cluster-meta-node-01), Execute the following command , Will have configured META Nodes join the cluster .
```
freetsd-ctl add-meta cluster-meta-node-01:8091
freetsd-ctl add-meta cluster-meta-node-02:8091
freetsd-ctl add-meta cluster-meta-node-03:8091
```
When executed correctly ,add-meta The execution output of the command is as follows :
```
Added meta node x at cluster-meta-node-0x:8091
```
Will all META After the node joins the cluster , It can be executed “freetsd-ctl show” To view the cluster META Node information .
>
> ```
> freetsd-ctl show
>
> ```
>
> The expected output is:
>
> ```
> Data Nodes:
>
> Meta Nodes:
> 1 cluster-meta-node-01:8091
> 2 cluster-meta-node-02:8091
> 3 cluster-meta-node-03:8091
>
> ```
### Deploy DATA node
This document will be in 2 individual DATA Take the cluster deployment of nodes as an example , Show me how to add DATA node .
#### To configure DATA node
##### Step 1: modify /etc/hosts file , To configure DATA Host name information of the node .
Will each DATA Node name ( such as cluster-data-node-01) And the corresponding address information ( such as <Data_1_IP>) Configuration in each META Nodes and DATA Node /etc/hosts In file .
```
<Data_1_IP> cluster-data-node-01
<Data_2_IP> cluster-data-node-02
```
After configuring the host name information , In each META Nodes and DATA On the node, execute the following ping command , Ensure the correctness of configuration and network connectivity .
>
> ping -qc 1 cluster-meta-node-01
>
> ping -qc 1 cluster-meta-node-02
>
> ping -qc 1 cluster-meta-node-03
>
> ping -qc 1 cluster-data-node-01
>
> ping -qc 1 cluster-data-node-02
##### Step 2: Configure and start DATA service
In each DATA Node , Execute the following commands respectively .
###### I. Download installation package
such as , stay Linux On the system , Use the following command to download freetsdb-v0.0.2-beta.1 Installation package .
```
wget https://github.com/freetsdb/freetsdb/releases/download/v0.0.2-beta.1/freetsdb-v0.0.2-beta.1_linux_amd64.tar.gz
tar -zxvf freetsdb-v0.0.2-beta.1_linux_amd64.tar.gz
```
###### II. Edit the data node configuration files
Modify the configuration file ./freetsdb.conf, And will hostname Set as the host name of this computer ( such as <cluster-data-node-0x>)
```
# Change this option to true to disable reporting.
reporting-disabled = false
bind-address = ":8088"
hostname="<cluster-data-node-0x>"
```
###### III. start-up DATA service
stay Linux shell Command line , Execute the following command .
```
sudo ./freetsd -config ./freetsd.conf
```
#### take DATA Nodes join the cluster
In one of them META Node ( such as cluster-meta-node-01), Execute the following command , Will have configured DATA Nodes join the cluster .
```
freetsd-ctl add-data cluster-data-node-01:8088
freetsd-ctl add-data cluster-data-node-02:8088
```
When executed correctly ,add-data The execution output of the command is as follows :
```
Added data node y at cluster-data-node-0x:8088
```
Will all DATA After the node joins the cluster , It can be executed “freetsd-ctl show” To view the cluster DATA Node information .
>
> ```
> freetsd-ctl show
> ```
>
> The expected output is:
>
> ```
> Data Nodes:
> 4 cluster-data-node-01:8088
> 5 cluster-data-node-02:8088
>
> Meta Nodes:
> 1 cluster-meta-node-01:8091
> 2 cluster-meta-node-02:8091
> 3 cluster-meta-node-03:8091
> ```
congratulations ,FreeTSDB The cluster has been built , Welcome to FreeTSDB The wonderful world of .
```
# Turn off firewall
systemctl stop firewalld.service
systemctl disable firewalld.service
```
```
# Add new machines
./freetsd-ctl add-meta 192.168.58.132:8091
./freetsd-ctl add-data 192.168.58.131:8088
```
Local virtual machine deployment freetsdb:
Prepare at least three virtual machines , To add contrast , Use four virtual machines , ip The addresses are :
192.168.58.128
192.168.58.131
192.168.58.132
192.168.58.133With 192.168.58.132 For example , The configuration file :
complete 58.132 Configuration folder on : freetsdb-v0.0.2-58.132- Other document resources -CSDN download
meta To configure :
freetsd-meta.conf
bind-address = ":8089"
hostname = "192.168.58.132"
[meta]
enabled = true
dir = "/var/lib/freetsdb/meta"
bind-address = ":8089"
http-bind-address = ":8091"
https-enabled = false
https-certificate = ""
retention-autocreate = true
election-timeout = "1s"
heartbeat-timeout = "1s"
leader-lease-timeout = "500ms"
commit-timeout = "50ms"
cluster-tracing = false
raft-promotion-enabled = true
logging-enabled = true
pprof-enabled = false
lease-duration = "1m0s"
data To configure :
freetsd.conf
reporting-disabled = false
bind-address = ":8088"
hostname = "192.168.58.132"
[data]
enabled = true
dir = "/var/lib/freetsdb/data"
engine = "tsm1"
wal-dir = "/var/lib/freetsdb/wal"
wal-logging-enabled = true
query-log-enabled = true
cache-max-memory-size = 1073741824
cache-snapshot-memory-size = 26214400
cache-snapshot-write-cold-duration = "10m0s"
compact-full-write-cold-duration = "24h0m0s"
max-points-per-block = 0
data-logging-enabled = true
[cluster]
force-remote-mapping = false
write-timeout = "5s"
shard-writer-timeout = "5s"
max-remote-write-connections = 3
shard-mapper-timeout = "5s"
[retention]
enabled = true
check-interval = "30m0s"
[shard-precreation]
enabled = true
check-interval = "10m0s"
advance-period = "30m0s"
[admin]
enabled = true
bind-address = ":8083"
https-enabled = false
https-certificate = "/etc/ssl/freetsdb.pem"
Version = ""
[monitor]
store-enabled = true
store-database = "_internal"
store-interval = "10s"
[subscriber]
enabled = true
[http]
enabled = true
bind-address = ":8086"
auth-enabled = false
log-enabled = true
write-tracing = false
pprof-enabled = false
https-enabled = false
https-certificate = "/etc/ssl/freetsdb.pem"
json-write-enabled = false
[[graphite]]
enabled = false
bind-address = ":2003"
database = "graphite"
protocol = "tcp"
batch-size = 5000
batch-pending = 10
batch-timeout = "1s"
consistency-level = "one"
separator = "."
udp-read-buffer = 0
[collectd]
enabled = false
bind-address = ":25826"
database = "collectd"
retention-policy = ""
batch-size = 5000
batch-pending = 10
batch-timeout = "10s"
read-buffer = 0
typesdb = "/usr/share/collectd/types.db"
[opentsdb]
enabled = false
bind-address = ":4242"
database = "opentsdb"
retention-policy = ""
consistency-level = "one"
tls-enabled = false
certificate = "/etc/ssl/freetsdb.pem"
batch-size = 1000
batch-pending = 5
batch-timeout = "1s"
log-point-errors = true
[[udp]]
enabled = false
bind-address = ":8089"
database = "udp"
retention-policy = ""
batch-size = 5000
batch-pending = 10
read-buffer = 0
batch-timeout = "1s"
precision = ""
udp-payload-size = 0
[continuous_queries]
log-enabled = true
enabled = true
run-interval = "1s"
[hinted-handoff]
enabled = true
dir = "/var/lib/freetsdb/hh"
max-size = 1073741824
max-age = "168h0m0s"
retry-rate-limit = 0
retry-interval = "1s"
retry-max-interval = "1m0s"
purge-interval = "1h0m0s"
Other virtual machines need to modify the corresponding hostname For the native ip.
function :
start-up meta
nohup ./freetsd-meta -config ./freetsd-meta.conf > freetsd-meta.log &
start-up data:
nohup ./freetsd -config ./freetsd.conf > freetsd.log &
Building clusters :
add to meta:
Deploy anywhere meta On the machine , perform :
./freetsd-ctl add-meta 192.168.58.128:8091
./freetsd-ctl add-meta 192.168.58.131:8091
./freetsd-ctl add-meta 192.168.58.132:8091
./freetsd-ctl add-meta 192.168.58.133:8091
./freetsd-ctl add-data 192.168.58.128:8088
./freetsd-ctl add-data 192.168.58.131:8088
./freetsd-ctl add-data 192.168.58.132:8088
./freetsd-ctl add-data 192.168.58.133:8088Check the formation of the cluster :
./freetsd-ctl show
Meta Nodes:
{1 192.168.58.128:8091 192.168.58.128:8089}
{5 192.168.58.132:8091 192.168.58.132:8089}
{6 192.168.58.133:8091 192.168.58.133:8089}
{8 192.168.58.131:8091 192.168.58.131:8089}
Data Nodes:
{2 192.168.58.128:8086 192.168.58.128:8088}
{7 192.168.58.133:8086 192.168.58.133:8088}
{10 192.168.58.132:8086 192.168.58.132:8088}
{11 192.168.58.131:8086 192.168.58.131:8088}
边栏推荐
- 最新版抽奖盲盒运营版
- GCN thinking - word2vec directly calculates text classification
- Swift5.7 extend some to generic parameters
- Deeply understand the mvcc mechanism of MySQL
- [exercice 7] [principe de la base de données]
- Swift Error Handling
- Two solutions of leetcode101 symmetric binary tree (recursion and iteration)
- 【数据库原理及应用教程(第4版|微课版)陈志泊】【第六章习题】
- Kotlin notes - popular knowledge points asterisk (*)
- Brief introduction to mvcc
猜你喜欢

Dojo tutorials:getting started with deferrals source code and example execution summary

Brief introduction to mvcc

电压环对 PFC 系统性能影响分析

Day 1 of kotlin learning: simple built-in types of kotlin

When the R language output rmarkdown is in other formats (such as PDF), an error is reported, latex failed to compile stocks Tex. solution

ncnn神经网络计算框架在香橙派OrangePi 3 LTS开发板中的使用介绍

Grid connection - Analysis of low voltage ride through and island coexistence

Glide question you cannot start a load for a destroyed activity

4. 无线体内纳米网:电磁传播模型和传感器部署要点

2021 autumn Information Security Experiment 1 (password and hiding technology)
随机推荐
【数据库原理及应用教程(第4版|微课版)陈志泊】【第六章习题】
The latest version of blind box mall thinkphp+uniapp
十條職場規則
【计网】第三章 数据链路层(2)流量控制与可靠传输、停止等待协议、后退N帧协议(GBN)、选择重传协议(SR)
Ali & ant self developed IDE
studio All flavors must now belong to a named flavor dimension. Learn more
Four problems and isolation level of MySQL concurrency
ORM use of node -serialize
Tensorflow binary installation & Failure
Deeply understand the mvcc mechanism of MySQL
GaN图腾柱无桥 Boost PFC(单相)七-PFC占空比前馈
Do you feel like you've learned something and forgotten it?
Harmonic current detection based on synchronous coordinate transformation
How to get user location in wechat applet?
[ArcGIS user defined script tool] vector file generates expanded rectangular face elements
Quickly learn member inner classes and local inner classes
2022-01-27 research on the minimum number of redis partitions
Analysis of a music player Login Protocol
When the R language output rmarkdown is in other formats (such as PDF), an error is reported, latex failed to compile stocks Tex. solution
社交社区论坛APP超高颜值UI界面