As a powerful sequential database, once it is owned, there is no need for anything else. This paper introduces its green installation method.
- Environment preparation, download, decompress.
[dev5@7bdc6644c7c4 influxdb-1.7.8] cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)
[dev5@7bdc6644c7c4 influxdb-1.7.8] pwd
/home/dev5/tools/
[dev5@7bdc6644c7c4 influxdb-1.7.8] mkdir influxdb-1.7.8
[dev5@7bdc6644c7c4 influxdb-1.7.8] cd influxdb-1.7.8
[dev5@7bdc6644c7c4 influxdb-1.7.8] mkdir influx
[dev5@7bdc6644c7c4 influxdb-1.7.8] mkdir influx/wal influx/dat influx/meta
[dev5@7bdc6644c7c4 influxdb-1.7.8] wget https://repos.influxdata.com/centos/7Server/x86_64/stable/influxdb-1.7.8.x86_64.rpm
[dev5@7bdc6644c7c4 influxdb-1.7.8] rpm2cpio influxdb-1.7.8.x86_64.rpm | cpio -idmv
[dev5@7bdc6644c7c4 influxdb-1.7.8]$ pwd
/home/dev5/tools/influxdb-1.7.8
[dev5@7bdc6644c7c4 influxdb-1.7.8]$ ls
etc influx usr var
Modify the configuration file: vim etc/influxdb/influxdb.conf
- Point the metadata, data, and log directories to the influx / meta, influx / DAT, and influx / wal.
[meta]
# Where the metadata/raft database is stored
dir = "/home/dev5/tools/influxdb-1.7.8/influx/meta"
[data]
# The directory where the TSM storage engine stores TSM files.
dir = "/home/dev5/tools/influxdb-1.7.8/influx/dat"
# The directory where the TSM storage engine stores WAL files.
wal-dir = "/home/dev5/tools/influxdb-1.7.8/influx/wal"
If you are not prepared to pollute the system environment variables, prepare a startup script, startup-influxdb.sh.
#!/bin/sh
#
export PATH=/home/dev5/tools/influxdb-1.7.8/usr/bin:$PATH
#
nohup influxd -config /home/dev5/tools/influxdb-1.7.8/etc/influxdb/influxdb.conf &
The newly established influxdb does not have authentication capability. Before manual configuration, create a user first.
[dev5@7bdc6644c7c4 influxdb-1.7.8]$ export PATH=/home/dev5/tools/influxdb-1.7.8/usr/bin:$PATH
[dev5@7bdc6644c7c4 influxdb-1.7.8]$ influx
Connected to http://localhost:8086 version 1.7.8
InfluxDB shell version: 1.7.8
> create user admin with password 'deadbeef' with all privileges
> create user "x-msg-im" with password 'deadbeef' with all privileges
> exit
- Enable authentication: vim etc/influxdb/influxdb.conf
[http]
# Determines whether HTTP endpoint is enabled.
# enabled = true
# The bind address used by the HTTP service.
# bind-address = ":8086"
# Determines whether user authentication is enabled over HTTP/HTTPS.
auth-enabled = true
[dev5@7bdc6644c7c4 influxdb-1.7.8]$ ps -aef|grep influx
dev5 51622 1 0 13:04 pts/3 00:00:01 influxd -config /home/dev5/tools/influxdb-1.7.8/etc/influxdb/influxdb.conf
dev5 52055 39606 0 13:22 pts/3 00:00:00 grep --color=auto influx
[dev5@7bdc6644c7c4 influxdb-1.7.8]$ kill 51622
The default configuration will cause more runtime logs. We can disable it.
- vim etc/influxdb/influxdb.conf
# Whether queries should be logged before execution. Very useful for troubleshooting, but will
# log any sensitive data contained within a query.
# query-log-enabled = true
query-log-enabled = false
# Determines whether HTTP request logging is enabled.
# log-enabled = true
log-enabled = false
A usable green version of influxdb will be installed here, packaged and backed up. The real installation will run everywhere.