InfluxDB服务后台运行
之前用以下命令启动InfluxDB,当关闭Xshell以后服务也就中断了,每次都要启动一下,实在是麻烦。
influxd -config /etc/influxdb/influxdb.conf
今天打算用不挂断运行命令:nohup Command &
nohup influxd -config /etc/influxdb/influxdb.conf &
结果就遇到报错了
ubuntu@VM-0-5-ubuntu:~$ nohup influxd -config /etc/influxdb/influxdb.conf &
[1] 10490
ubuntu@VM-0-5-ubuntu:~$ nohup: ignoring input and appending output to 'nohup.out'
[1]+ Exit 1 nohup influxd -config /etc/influxdb/influxdb.conf
启动失败,只能切换root账号
ubuntu切换root账号
1、输入命令su结果又报错Authentication failure
ubuntu@VM-0-5-ubuntu:~$ su
Password:
su: Authentication failure
搜索了一下发现,出现原因是没有给root账号设置密码。
2、给root账号设置密码sudo passwd root
ubuntu@VM-0-5-ubuntu:~$ sudo passwd root
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
3、输入命令su root,正确输入密码后切换账号成功
ubuntu@VM-0-5-ubuntu:~$ su root
Password:
root@VM-0-5-ubuntu:/home/ubuntu#
再次启动InfluxDB服务
root@VM-0-5-ubuntu:~# nohup influxd -config /etc/influxdb/influxdb.conf &
[1] 13884
root@VM-0-5-ubuntu:~# nohup: ignoring input and appending output to 'nohup.out'
查看进程ps ef|grep influx