当前位置:网站首页>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.133
With 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:8088
Check 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}
边栏推荐
- C graphical tutorial (Fourth Edition)_ Chapter 18 enumerator and iterator: enumerator samplep340
- 如何在微信小程序中获取用户位置?
- Harmonic current detection based on synchronous coordinate transformation
- Gan totem column bridgeless boost PFC (single phase) seven PFC duty cycle feedforward
- Public and private account sending prompt information (user microservice -- message microservice)
- Swift Error Handling
- 剑指 Offer 16. 数值的整数次方
- Everything comes to him who waits
- Swift5.7 extend some to generic parameters
- Kotlin notes - popular knowledge points asterisk (*)
猜你喜欢
Swift bit operation exercise
[data mining review questions]
ncnn神经网络计算框架在香橙派OrangePi 3 LTS开发板中的使用介绍
【Colab】【使用外部数据的7种方法】
电压环对 PFC 系统性能影响分析
如何在微信小程序中获取用户位置?
低代码平台国际化多语言(i18n)技术方案
Huffman coding experiment report
How to get user location in wechat applet?
Solve the problem of VI opening files with ^m at the end
随机推荐
[problem exploration and solution of one or more filters or listeners failing to start]
01 three solutions to knapsack problem (greedy dynamic programming branch gauge)
(latest version) WiFi distribution multi format + installation framework
Analysis of the influence of voltage loop on PFC system performance
2022-01-27 research on the minimum number of redis partitions
【习题六】【数据库原理】
Swift Error Handling
2022-01-27 redis cluster technology research
[comprehensive question] [Database Principle]
It feels great to know you learned something, isn‘t it?
Pytext training times error: typeerror:__ init__ () got an unexpected keyword argument 'serialized_ options'
[combinatorics] permutation and combination (the combination number of multiple sets | the repetition of all elements is greater than the combination number | the derivation of the combination number
电压环对 PFC 系统性能影响分析
Powerful avatar making artifact wechat applet
The solution to change the USB flash disk into a space of only 2m
Xctf mobile--app1 problem solving
C graphical tutorial (Fourth Edition)_ Chapter 13 entrustment: delegatesamplep245
An example of newtonjason
GCN thinking - word2vec directly calculates text classification
Redhat5 installing socket5 proxy server