In the previous blog post, we introduced the key features, data reading and writing, and application scenarios of the necessary-influxdb for Internet-level monitoring systems:
The influxdb of the time-series database of Internet-level monitoring system
In this article, we introduce the construction of the INFLUXDB database cluster, and share the pits we encounter with the cluster!
First, the Environment preparation
- Within the same network segment, 3 CentOS nodes can ping each other
- 3 nodes CentOS configuration Hosts file that resolves host names to one another
- Azure virtual machine Enable root user
- influxdb-0.10.3-1.x86_64.rpm
- Set Port 8083 8086 8088 8091 exceptions
Two or one step-by-step construction of INFLUXDB cluster
1. Configure the Hosts file on each node's host to ensure that each node communicates directly with each other
2. Each node host is installed Influxdb rpm, but installation does not start Influxdb
3. Edit the Influxdb.conf file (. etc/influxdb/influxdb.conf) in sequence on the three node host
Main changes hostname, bind-address, http-bind-address three options
Modify the configuration file for three host nodes in turn
4. start the influxdb on the InfluxDB01 machine
[[email protected] influxdb]# sudo service influxdb start 5.
Configuring/etc/default/influxdb files on InfluxDB02Join the INFLUXDB01 node influxd_opts= "-join influxdb01:8091" 6.
InfluxDB02 machine Start Influxdb[[email protected] default]# sudo service influxdb start 7.
Configuring/etc/default/influxdb files on InfluxDB03Join the INFLUXDB01 node influxd_opts= "-join influxdb01:8091" 8.
InfluxDB03 machine Start Influxdb[[email protected] default]# sudo service influxdb start 9.
start influxdb on InfluxDB01Influx-host INFLUXDB01 10.
View Influxdb clusters
third, influxdb cluster, we encountered the pitINFLUXDB cluster mode, the data is synchronized between the nodes, that is, we can choose any one node to write, the data can be queried by other nodes. After we set up the cluster, the first problem we encountered was
data is out of sync. In fact, the data write pressure is not big! Data restarts the cluster after it is out of sync, still data is out of sync. When data is written, it must be in UTC time and is the UTC time format under UNIX. Data that is written in bulk is sometimes slow because the data must be sorted in descending order of time and then inserted in bulk. Stand-alone mode is more stable than cluster mode, while the newest cluster is not open source, commercial version is supported. The performance of many batch writes is good, but the concurrency number is limited, the number of batch data is best within 1000. Zhou 2017/7/12
Internet-level monitoring system prerequisites-influxdb clusters and stepped pits of the time series database