新增influxdb用户
useradd -rs /bin/false influxdb
创建用户目录
mkdir /home/influxdb
chown influxdb /home/influxdb
创建influxdb2.service
/lib/systemd/system目录下
vi influxdb2.service
内容如下:
[Unit]
Description=InfluxDB 2.0 service file.
Documentation=https://v2.docs.influxdata.com/v2.0/get-started/
After=network-online.target
[Service]
User=influxdb
Group=influxdb
ExecStart=/usr/local/bin/influxd
Restart=on-failure
[Install]
WantedBy=multi-user.target
启动
systemctl start influxdb2
状态
systemctl status influxdb2
开机启动
systemctl enable influxdb2
网友评论