3

Ubuntu VPS安装netdata简记

 2 years ago
source link: https://hellodk.cn/post/16
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Ubuntu VPS安装netdata简记

Ubuntu VPS安装netdata简记。

首先安装预备环境(依赖包)

apt-get install zlib1g-dev gcc make git autoconf autogen automake pkg-config uuid-dev

然后去github获取netdata

wget https://github.com/netdata/netdata/archive/master.zip

(预先mkdir /temp ,我在/temp下安装)

然后unzip master.zip

cd到netdata-master目录

执行./netdata-installer.sh,脚本弹出提示回车便是。命令行跑完一般就能得到congratulations well done installation completed之类的提示。默认监听端口是19999,浏览器打开http://your_ip:19999即可进入。

——————分割线——————
下面修改监听端口和设置开机自启:

修改监听端口前需要停止进程。使用systemctl stop netdata.service即可关闭进程。然后vim /etc/netdata/netdata.conf 这个配置文件,修改[web] 中的 # default port 19999,(这里注释:井号后面的内容都是注释内容,但是注释内容的默认值却都是默认值,要想使得你想要的端口生效,去掉井号使你的端口号生效),修改方法:将井号去除,19999改为你想要的端口号,我改为了19919。

下面一步一步执行:

1、终止 netdata 进程,或者使用systemctl stop netdata.service

killall netdata

2、将netdata.service 复制到 systemd 服务目录

cp system/netdata.service /etc/systemd/system/

3、systemd重新加载服务

systemctl daemon-reload

4、启用开机自启

systemctl enable netdata

5、启动netdata

service netdata start

检查服务状态,使用systemctl status netdata.service -l -l 参数是获得更详细的输出
检查是否已开启,使用systemctl is-active netdata.service
检查是否已设置为开机自启,使用systemctl is-enabled netdata.service


end.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK