mirror of
https://github.com/LCTT/TranslateProject.git
synced 2024-12-29 21:41:00 +08:00
Merge remote-tracking branch 'LCTT/master'
This commit is contained in:
commit
ae577cc52c
@ -1,51 +1,47 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (robsean)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-11172-1.html)
|
||||
[#]: subject: (How to Upgrade Debian 9 (Stretch) to Debian 10 (Buster) via Command Line)
|
||||
[#]: via: (https://www.linuxtechi.com/upgrade-debian-9-to-debian-10-command-line/)
|
||||
[#]: author: (Pradeep Kumar https://www.linuxtechi.com/author/pradeep/)
|
||||
|
||||
如何通过命令行升级 Debian 9 (Stretch) 为 Debian 10 (Buster)
|
||||
如何通过命令行升级 Debian 9 为 Debian 10
|
||||
======
|
||||
|
||||
大家好!!!,很高兴见到你!我们已经在先前的文章中看到如何安装 [Debian 10(Buster)][1]。今天,我们将学习如何从 Debian 9 升级为 Debian 10,虽然我们已将看到 Debian 10 和它的特色a,让我们不要深入它。但是读者没有机会来读那篇文章,让我们给予一个快速更新 Debian 10 和它的新功能。
|
||||
我们已经在先前的文章中看到如何安装 [Debian 10(Buster)][1]。今天,我们将学习如何从 Debian 9 升级为 Debian 10,虽然我们已将看到 Debian 10 和它的特色,所以这里我们不会深入介绍。但是可能读者没有机会读到那篇文章,让我们快速了解一下 Debian 10 和它的新功能。
|
||||
|
||||
<https://www.linuxtechi.com/wp-content/uploads/2019/07/Upgrade-Debian-9-to-Debian-10.jpg>
|
||||
![](https://www.linuxtechi.com/wp-content/uploads/2019/07/Upgrade-Debian-9-to-Debian-10.jpg)
|
||||
|
||||
在差不多两年的开发后,Debian 小组最终发布一个稳定版本, Debian 10 的代码名称是Buster。Buster 是一个 LTS (长期支持支持)版本,因此未来将由 Debian 支持5年。
|
||||
在差不多两年的开发后,Debian 团队最终发布一个稳定版本,Debian 10 的代码名称是 Buster。Buster 是一个 LTS (长期支持支持)版本,因此未来将由 Debian 支持 5 年。
|
||||
|
||||
### Debian 10 (Buster) – 新的特色
|
||||
### Debian 10(Buster)新的特色
|
||||
|
||||
Debian 10 (Buster) 带来大量打包好的新的特色,对大多数的 Debian 粉丝是有益的。一些特色包括:
|
||||
Debian 10(Buster)回报给大多数 Debian 爱好者大量的新特色。一些特色包括:
|
||||
|
||||
* GNOME 桌面 3.30
|
||||
* AppArmor 默认启用
|
||||
* 默认启用 AppArmor
|
||||
* 支持 Linux 内核 4.19.0-4
|
||||
* 支持 OpenJDk 11.0
|
||||
* Moved from.15.2
|
||||
* 从 Nodejs 4 ~ 8 升级到 Nodejs 10.15.2
|
||||
* Iptables 替换为 NFTables
|
||||
|
||||
|
||||
|
||||
还有很多。
|
||||
等等。
|
||||
|
||||
### 从 Debian 9 到 Debian 10 的逐步升级指南
|
||||
|
||||
在我们开始升级 Debian 10前,让我们看看升级需要的必备条件:
|
||||
在我们开始升级 Debian 10 前,让我们看看升级需要的必备条件:
|
||||
|
||||
### 步骤 1) Debian 升级必备条件
|
||||
#### 步骤 1) Debian 升级必备条件
|
||||
|
||||
* 一个良好的网络连接
|
||||
* Root 用户权限
|
||||
* root 用户权限
|
||||
* 数据备份
|
||||
|
||||
备份你所有的应用程序代码库、数据文件、用户账号详细信息、配置文件是极其重要的,以便在升级出错时,你可以总是可以还原到先前的版本。
|
||||
|
||||
|
||||
备份你所有的应用程序代码库,数据文件,用户账号详细信息,配置文件是极其重要的,以便在升级期间出错时,你可以总是可以还原到先前的版本。
|
||||
|
||||
### 步骤 2) 升级 Debian 9 现有的软件包
|
||||
#### 步骤 2) 升级 Debian 9 现有的软件包
|
||||
|
||||
接下来的步骤是升级你所有现有的软件包,因为一些软件包被标志为保留不能升级,从 Debian 9 升级为 Debian 10 有失败或引发一些问题的可能性。所以,我们不冒任何风险,更好地升级软件包。使用下面的代码来升级软件包:
|
||||
|
||||
@ -53,24 +49,24 @@ Debian 10 (Buster) 带来大量打包好的新的特色,对大多数的 Debian
|
||||
root@linuxtechi:~$ sudo apt update && sudo apt upgrade -y
|
||||
```
|
||||
|
||||
### 步骤 3) 修改软件包存储库文件 (/etc/sources.list)
|
||||
#### 步骤 3) 修改软件包存储库文件 /etc/sources.list
|
||||
|
||||
接下来的步骤是修改软件包存储库文件 “/etc/sources.list” ,你需要用文本 “Buster” 替换 “Stretch”
|
||||
接下来的步骤是修改软件包存储库文件 `/etc/sources.list`,你需要用文本 `Buster` 替换 `Stretch`。
|
||||
|
||||
但是,在你更改任何东西前,确保如下创建一个 sources.list 文件的备份:
|
||||
但是,在你更改任何东西前,确保如下创建一个 `sources.list` 文件的备份:
|
||||
|
||||
```
|
||||
root@linuxtechi:~$ sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
|
||||
```
|
||||
|
||||
现在使用下面的 sed 命令来在软件包存储库文件中使用 ‘**buster**‘ 替换 ‘**stretch**‘ ,示例如下显示,
|
||||
现在使用下面的 `sed` 命令来在软件包存储库文件中使用 `buster` 替换 `stretch`,示例如下显示:
|
||||
|
||||
```
|
||||
root@linuxtechi:~$ sudo sed -i 's/stretch/buster/g' /etc/apt/sources.list
|
||||
root@linuxtechi:~$ sudo sed -i 's/stretch/buster/g' /etc/apt/sources.list.d/*.list
|
||||
```
|
||||
|
||||
一旦文本更新,你需要如下更新软件包存储库索引:
|
||||
更新后,你需要如下更新软件包存储库索引:
|
||||
|
||||
```
|
||||
root@linuxtechi:~$ sudo apt update
|
||||
@ -91,25 +87,25 @@ BUG_REPORT_URL="https://bugs.debian.org/"
|
||||
root@linuxtechi:~$
|
||||
```
|
||||
|
||||
### 步骤 4) 从 Debian 9 升级到 Debian 10
|
||||
#### 步骤 4) 从 Debian 9 升级到 Debian 10
|
||||
|
||||
一旦你做完所有的更改,是时候从 Debian 9 升级到 Debian 10 。但是在这之前,再次如下确保更新你的软件包:
|
||||
你做完所有的更改后,是时候从 Debian 9 升级到 Debian 10 了。但是在这之前,再次如下确保更新你的软件包:
|
||||
|
||||
```
|
||||
root@linuxtechi:~$ sudo apt update && sudo apt upgrade -y
|
||||
```
|
||||
|
||||
在软件包升级期间,你将被提示启动服务,所以选择你较喜欢的选项
|
||||
在软件包升级期间,你将被提示启动服务,所以选择你较喜欢的选项。
|
||||
|
||||
一旦你系统的所有软件包升级完成,是时候升级你的发行版的软件包。使用下面的代码来升级发行版:
|
||||
一旦你系统的所有软件包升级完成,就升级你的发行版的软件包。使用下面的代码来升级发行版:
|
||||
|
||||
```
|
||||
root@linuxtechi:~$ sudo apt dist-upgrade -y
|
||||
```
|
||||
|
||||
升级过程可能花费一些时间,取决于你的网络速度。记住在升级过程中,你将被问道一些问题,在软件包升级后是否需要重启服务,你是否需要保留现存的配置文件。如果你不想进行一些自定义更改,简单地键入 “Y” ,来让升级过程继续。
|
||||
升级过程可能花费一些时间,取决于你的网络速度。记住在升级过程中,你将被询问一些问题,在软件包升级后是否需要重启服务、你是否需要保留现存的配置文件等。如果你不想进行一些自定义更改,简单地键入 “Y” ,来让升级过程继续。
|
||||
|
||||
### 步骤 5) 验证升级
|
||||
#### 步骤 5) 验证升级
|
||||
|
||||
一旦升级过程完成,重启你的机器,并使用下面的方法检测版本:
|
||||
|
||||
@ -129,7 +125,7 @@ root@linuxtechi:~$
|
||||
|
||||
是的,你已经成功地从 Debian 9 升级到 Debian 10。
|
||||
|
||||
验证升级的备用方法
|
||||
验证升级的备用方法:
|
||||
|
||||
```
|
||||
root@linuxtechi:~$ cat /etc/*-release
|
||||
@ -147,7 +143,7 @@ root@linuxtechi:~$
|
||||
|
||||
### 结束
|
||||
|
||||
希望上面的逐步指南为你提供从 Debian 9(Stretch) 简单地升级为 Debian 10 (Buster) 的所有信息。在评论部分,请给予你使用 Debian 10 的反馈,建议,体验,更多 Linux 教程和文章,保持时时访问 LinuxTechi.com 。
|
||||
希望上面的逐步指南为你提供了从 Debian 9(Stretch)简单地升级为 Debian 10(Buster)的所有信息。在评论部分,请给予你使用 Debian 10 的反馈、建议、体验。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
@ -156,10 +152,10 @@ via: https://www.linuxtechi.com/upgrade-debian-9-to-debian-10-command-line/
|
||||
作者:[Pradeep Kumar][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[robsean](https://github.com/robsean)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.linuxtechi.com/author/pradeep/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.linuxtechi.com/debian-10-buster-installation-guide/
|
||||
[1]: https://linux.cn/article-11083-1.html
|
@ -1,312 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Install NetData Performance Monitoring Tool On Linux)
|
||||
[#]: via: (https://www.ostechnix.com/netdata-real-time-performance-monitoring-tool-linux/)
|
||||
[#]: author: (sk https://www.ostechnix.com/author/sk/)
|
||||
|
||||
Install NetData Performance Monitoring Tool On Linux
|
||||
======
|
||||
|
||||
![][1]
|
||||
|
||||
**NetData** is a distributed, real-time, performance and health monitoring tool for systems and applications. It provides unparalleled insights of everything happening on a system in real-time. You can view the results in a highly interactive web-dashboard. Using Netdata, you can get a clear idea of what is happening now, and what happened before in your systems and applications. You don’t need to be an expert to deploy this tool in your Linux systems. NetData just works fine out of the box with zero configuration, and zero dependencies. Just install this utility and sit back, NetData will take care of the rest.
|
||||
|
||||
It has its own built-in webserver to display the result in graphical format. NetData is quite fast and efficient, and it will immediately start to analyze the performance of your system in no time after installing it. It is written using **C** programming language, so it is extremely light weight. It consumes less than 3% of a single core CPU usage and a 10-15MB of RAM. We can easily embed the charts on any existing web pages, and also it has a plugin API, so that you can monitor any application.
|
||||
|
||||
Here is the list of things that will be monitored by NetData utility in your Linux system.
|
||||
|
||||
* CPU usage,
|
||||
* RAM Usage,
|
||||
* Swap memory usage,
|
||||
* Kernel memory usage,
|
||||
* Hard disks and its usage,
|
||||
* Network interfaces,
|
||||
* IPtables,
|
||||
* Netfilter,
|
||||
* DDoS protection,
|
||||
* Processes,
|
||||
* Applications,
|
||||
* NFS server,
|
||||
* Web server (Apache & Nginx),
|
||||
* Database servers (MySQL),
|
||||
* DHCP server,
|
||||
* DNS server,
|
||||
* Email serve,r
|
||||
* Proxy server,
|
||||
* Tomcat,
|
||||
* PHP,
|
||||
* SNP devices,
|
||||
* And many more.
|
||||
|
||||
|
||||
|
||||
NetData is free, open source tool and it supports Linux, FreeBSD and Mac OS.
|
||||
|
||||
### Install NetData On Linux
|
||||
|
||||
Netdata can be installed on any Linux distributions that have **Bash** installed.
|
||||
|
||||
The easiest way to install Netdata is to run the following one-liner command from the Terminal:
|
||||
|
||||
```
|
||||
$ bash <(curl -Ss https://my-netdata.io/kickstart-static64.sh)
|
||||
```
|
||||
|
||||
This will download and install everything needed to up and run Netdata.
|
||||
|
||||
Some users may not want to inject something directly into Bash without investigating it. If you don’t like this method, you can follow the steps below to install it on your system.
|
||||
|
||||
**On Arch Linux:**
|
||||
|
||||
The latest version is available in the Arch Linux default repositories. So, we can install it with [**pacman**][2] using command:
|
||||
|
||||
```
|
||||
$ sudo pacman -S netdata
|
||||
```
|
||||
|
||||
**On DEB and RPM-based systems**
|
||||
|
||||
NetData is not available in the default repositories of DEB based (Ubuntu / Debian) or RPM based (RHEL / CentOS / Fedora) systems. We need to install NetData manually from its Git repository.
|
||||
|
||||
First install the required dependencies:
|
||||
|
||||
```
|
||||
# Debian / Ubuntu
|
||||
$ sudo apt-get install zlib1g-dev uuid-dev libuv1-dev liblz4-dev libjudy-dev libssl-dev libmnl-dev gcc make git autoconf autoconf-archive autogen automake pkg-config curl
|
||||
|
||||
# Fedora
|
||||
$ sudo dnf install zlib-devel libuuid-devel libuv-devel lz4-devel Judy-devel openssl-devel libmnl-devel gcc make git autoconf autoconf-archive autogen automake pkgconfig curl findutils
|
||||
|
||||
# CentOS / Red Hat Enterprise Linux
|
||||
$ sudo yum install epel-release
|
||||
$ sudo yum install autoconf automake curl gcc git libmnl-devel libuuid-devel openssl-devel libuv-devel lz4-devel Judy-devel lm_sensors make MySQL-python nc pkgconfig python python-psycopg2 PyYAML zlib-devel
|
||||
|
||||
# openSUSE
|
||||
$ sudo zypper install zlib-devel libuuid-devel libuv-devel liblz4-devel judy-devel openssl-devel libmnl-devel gcc make git autoconf autoconf-archive autogen automake pkgconfig curl findutils
|
||||
```
|
||||
|
||||
After installing the required dependencies, install NetData on DEB or RPM based systems as shown below.
|
||||
|
||||
Git clone the NetData repository:
|
||||
|
||||
```
|
||||
$ git clone https://github.com/netdata/netdata.git --depth=100
|
||||
```
|
||||
|
||||
The above command will create a directory called **‘netdata’** in the current working directory.
|
||||
|
||||
Change to the ‘netdata’ directory:
|
||||
|
||||
```
|
||||
$ cd netdata/
|
||||
```
|
||||
|
||||
Finally, install and start NetData using command:
|
||||
|
||||
```
|
||||
$ sudo ./netdata-installer.sh
|
||||
```
|
||||
|
||||
**Sample output:**
|
||||
|
||||
```
|
||||
Welcome to netdata!
|
||||
Nice to see you are giving it a try!
|
||||
|
||||
You are about to build and install netdata to your system.
|
||||
|
||||
It will be installed at these locations:
|
||||
|
||||
- the daemon at /usr/sbin/netdata
|
||||
- config files at /etc/netdata
|
||||
- web files at /usr/share/netdata
|
||||
- plugins at /usr/libexec/netdata
|
||||
- cache files at /var/cache/netdata
|
||||
- db files at /var/lib/netdata
|
||||
- log files at /var/log/netdata
|
||||
- pid file at /var/run
|
||||
|
||||
This installer allows you to change the installation path.
|
||||
Press Control-C and run the same command with --help for help.
|
||||
|
||||
Press ENTER to build and install netdata to your system > ## Press ENTER key
|
||||
```
|
||||
|
||||
After installing NetData, you will see the following output at the end:
|
||||
|
||||
```
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
OK. NetData is installed and it is running (listening to *:19999).
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
INFO: Command line options changed. -pidfile, -nd and -ch are deprecated.
|
||||
If you use custom startup scripts, please run netdata -h to see the
|
||||
corresponding options and update your scripts.
|
||||
|
||||
Hit http://localhost:19999/ from your browser.
|
||||
|
||||
To stop netdata, just kill it, with:
|
||||
|
||||
killall netdata
|
||||
|
||||
To start it, just run it:
|
||||
|
||||
/usr/sbin/netdata
|
||||
|
||||
|
||||
Enjoy!
|
||||
|
||||
Uninstall script generated: ./netdata-uninstaller.sh
|
||||
```
|
||||
|
||||
![][3]
|
||||
|
||||
Install NetData
|
||||
|
||||
NetData has been installed and started.
|
||||
|
||||
To install Netdata on other Linux distributions, refer the [**official installation instructions page**][4].
|
||||
|
||||
##### Allow NetData default port via Firewall or Router
|
||||
|
||||
If your system stays behind any firewall or router, you must allow the default port **19999** to access the NetData web interface from any remote systems on the network,.
|
||||
|
||||
**On Ubuntu / Debian:**
|
||||
|
||||
```
|
||||
$ sudo ufw allow 19999
|
||||
```
|
||||
|
||||
**On CentOS / RHEL / Fedora:**
|
||||
|
||||
```
|
||||
$ sudo firewall-cmd --permanent --add-port=19999/tcp
|
||||
|
||||
$ sudo firewall-cmd --reload
|
||||
```
|
||||
|
||||
### Starting / Stopping NetData
|
||||
|
||||
To enable and start Netdata service on systems that use **Systemd** , run:
|
||||
|
||||
```
|
||||
$ sudo systemctl enable netdata
|
||||
|
||||
$ sudo systemctl start netdata
|
||||
```
|
||||
|
||||
To stop:
|
||||
|
||||
```
|
||||
$ sudo systemctl stop netdata
|
||||
```
|
||||
|
||||
To enable and start Netdata service on systems that use **Init** , run:
|
||||
|
||||
```
|
||||
$ sudo service netdata start
|
||||
|
||||
$ sudo chkconfig netdata on
|
||||
```
|
||||
|
||||
To stop it:
|
||||
|
||||
```
|
||||
$ sudo service netdata stop
|
||||
```
|
||||
|
||||
### Access NetData via Web browser
|
||||
|
||||
Open your web browser, and navigate to **<http://127.0.0.1:19999>** or **<http://localhost:19999/>** or **<http://ip-address:19999>**. You should see a screen something like below.
|
||||
|
||||
![][5]
|
||||
|
||||
Netdata dashboard
|
||||
|
||||
From the dashboard, you will find the complete statistics of your Linux system. Scroll down to view each section.
|
||||
|
||||
You can download and/or view NetData default configuration file at any time by simply navigating to **<http://localhost:19999/netdata.conf>**.
|
||||
|
||||
![][6]
|
||||
|
||||
Netdata configuration file
|
||||
|
||||
### Updating NetData
|
||||
|
||||
In Arch Linux, just run the following command to update NetData. If the updated version is available in the repository, it will be automatically installed.
|
||||
|
||||
```
|
||||
$ sudo pacman -Syyu
|
||||
```
|
||||
|
||||
In DEB or RPM based systems, just go to the directory where you have cloned it (In our case it’s netdata).
|
||||
|
||||
```
|
||||
$ cd netdata
|
||||
```
|
||||
|
||||
Pull the latest update:
|
||||
|
||||
```
|
||||
$ git pull
|
||||
```
|
||||
|
||||
Then, rebuild and update it using command:
|
||||
|
||||
```
|
||||
$ sudo ./netdata-installer.sh
|
||||
```
|
||||
|
||||
### Uninstalling NetData
|
||||
|
||||
Go to the location where you have cloned NetData.
|
||||
|
||||
```
|
||||
$ cd netdata
|
||||
```
|
||||
|
||||
Then, uninstall it using command:
|
||||
|
||||
```
|
||||
$ sudo ./netdata-uninstaller.sh --force
|
||||
```
|
||||
|
||||
In Arch Linux, the following command will uninstall it.
|
||||
|
||||
```
|
||||
$ sudo pacman -Rns netdata
|
||||
```
|
||||
|
||||
**Resources:**
|
||||
|
||||
* [**NetData website**][7]
|
||||
* [**NetData GitHub page**][8]
|
||||
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.ostechnix.com/netdata-real-time-performance-monitoring-tool-linux/
|
||||
|
||||
作者:[sk][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.ostechnix.com/author/sk/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.ostechnix.com/wp-content/uploads/2016/06/Install-netdata-720x340.png
|
||||
[2]: https://www.ostechnix.com/getting-started-pacman/
|
||||
[3]: https://www.ostechnix.com/wp-content/uploads/2016/06/Deepin-Terminal_002-6.png
|
||||
[4]: https://docs.netdata.cloud/packaging/installer/
|
||||
[5]: https://www.ostechnix.com/wp-content/uploads/2016/06/Netdata-dashboard.png
|
||||
[6]: https://www.ostechnix.com/wp-content/uploads/2016/06/Netdata-config-file.png
|
||||
[7]: http://netdata.firehol.org/
|
||||
[8]: https://github.com/firehol/netdata
|
@ -0,0 +1,313 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Install NetData Performance Monitoring Tool On Linux)
|
||||
[#]: via: (https://www.ostechnix.com/netdata-real-time-performance-monitoring-tool-linux/)
|
||||
[#]: author: (sk https://www.ostechnix.com/author/sk/)
|
||||
|
||||
在 Linux 上安装 NetData 性能监控工具
|
||||
======
|
||||
|
||||
![][1]
|
||||
|
||||
**NetData** 是一个用于系统和应用的分布式实时性能和健康监控工具。它提供了对系统中实时发生的所有事情的全面检测。你可以在高度互动的 Web 仪表板中查看结果。使用 Netdata,你可以清楚地了解现在发生的事情,以及之前系统和应用中发生的事情。你无需成为专家即可在 Linux 系统中部署此工具。NetData 开箱即用,零配置和零依赖。只需安装它然后休息,之后 NetData 将负责其余部分。
|
||||
|
||||
|
||||
它有自己的内置 Web 服务器,以图形形式显示结果。NetData 非常快速高效,安装后可立即开始分析系统性能。它是用 **C** 编程语言编写的,所以它非常轻量。它占用的单核 CPU 使用率不到 3%,内存占用 10-15MB。我们可以轻松地在任何现有网页上嵌入图表,并且它还有一个插件 API,以便你可以监控任何应用。
|
||||
|
||||
以下是 Linux 系统中 NetData 的监控列表。
|
||||
|
||||
* CPU 使用率
|
||||
* RAM 使用率
|
||||
* swap 内存使用率
|
||||
* 内核内存使用率
|
||||
* 硬盘及其使用率
|
||||
* 网络接口
|
||||
* IPtables
|
||||
* Netfilter
|
||||
* DDoS 保护
|
||||
* 进程
|
||||
* 应用
|
||||
* NFS 服务器
|
||||
* Web 服务器 (Apache 和 Nginx)
|
||||
* 数据库服务器 (MySQL),
|
||||
* DHCP 服务器
|
||||
* DNS 服务器
|
||||
* 电子邮件服务
|
||||
* 代理服务器
|
||||
* Tomcat
|
||||
* PHP
|
||||
* SNP 设备
|
||||
* 等等
|
||||
|
||||
|
||||
|
||||
NetData 是免费的开源工具,它支持 Linux、FreeBSD 和 Mac OS。
|
||||
|
||||
### 在 Linux 上安装 NetData
|
||||
|
||||
Netdata 可以安装在任何安装了**Bash** 的 Linux 发行版上。
|
||||
|
||||
最简单的安装 Netdata 的方法是从终端运行以下命令:
|
||||
|
||||
```
|
||||
$ bash <(curl -Ss https://my-netdata.io/kickstart-static64.sh)
|
||||
```
|
||||
|
||||
这将下载并安装启动和运行 Netdata 所需的一切。
|
||||
|
||||
有些用户可能不想在没有研究的情况下将某些东西直接注入 Bash。如果你不喜欢此方法,可以按照以下步骤在系统上安装它。
|
||||
|
||||
**在 Arch Linux 上:**
|
||||
|
||||
Arch Linux 默认仓库中提供了最新版本。所以,我们可以使用以下 [**pacman**][2] 命令安装它:
|
||||
|
||||
```
|
||||
$ sudo pacman -S netdata
|
||||
```
|
||||
|
||||
**在基于 DEB 和基于 RPM 的系统上**
|
||||
|
||||
在基于 DEB (Ubuntu / Debian) 或基于RPM (RHEL / CentOS / Fedora) 系统的默认仓库没有 NetData。我们需要从它的 Git 仓库手动安装 NetData。
|
||||
|
||||
首先安装所需的依赖项:
|
||||
|
||||
```
|
||||
# Debian / Ubuntu
|
||||
$ sudo apt-get install zlib1g-dev uuid-dev libuv1-dev liblz4-dev libjudy-dev libssl-dev libmnl-dev gcc make git autoconf autoconf-archive autogen automake pkg-config curl
|
||||
|
||||
# Fedora
|
||||
$ sudo dnf install zlib-devel libuuid-devel libuv-devel lz4-devel Judy-devel openssl-devel libmnl-devel gcc make git autoconf autoconf-archive autogen automake pkgconfig curl findutils
|
||||
|
||||
# CentOS / Red Hat Enterprise Linux
|
||||
$ sudo yum install epel-release
|
||||
$ sudo yum install autoconf automake curl gcc git libmnl-devel libuuid-devel openssl-devel libuv-devel lz4-devel Judy-devel lm_sensors make MySQL-python nc pkgconfig python python-psycopg2 PyYAML zlib-devel
|
||||
|
||||
# openSUSE
|
||||
$ sudo zypper install zlib-devel libuuid-devel libuv-devel liblz4-devel judy-devel openssl-devel libmnl-devel gcc make git autoconf autoconf-archive autogen automake pkgconfig curl findutils
|
||||
```
|
||||
|
||||
安装依赖项后,在基于 DEB 或基于 RPM 的系统上安装 NetData,如下所示。
|
||||
|
||||
Git 克隆 NetData 仓库:
|
||||
|
||||
```
|
||||
$ git clone https://github.com/netdata/netdata.git --depth=100
|
||||
```
|
||||
|
||||
上面的命令将在当前工作目录中创建一个名为 **“netdata”** 的目录。
|
||||
|
||||
切换到 “netdata” 目录:
|
||||
|
||||
```
|
||||
$ cd netdata/
|
||||
```
|
||||
|
||||
最后,使用命令安装并启动 NetData:
|
||||
|
||||
```
|
||||
$ sudo ./netdata-installer.sh
|
||||
```
|
||||
|
||||
**示例输出:**
|
||||
|
||||
```
|
||||
Welcome to netdata!
|
||||
Nice to see you are giving it a try!
|
||||
|
||||
You are about to build and install netdata to your system.
|
||||
|
||||
It will be installed at these locations:
|
||||
|
||||
- the daemon at /usr/sbin/netdata
|
||||
- config files at /etc/netdata
|
||||
- web files at /usr/share/netdata
|
||||
- plugins at /usr/libexec/netdata
|
||||
- cache files at /var/cache/netdata
|
||||
- db files at /var/lib/netdata
|
||||
- log files at /var/log/netdata
|
||||
- pid file at /var/run
|
||||
|
||||
This installer allows you to change the installation path.
|
||||
Press Control-C and run the same command with --help for help.
|
||||
|
||||
Press ENTER to build and install netdata to your system > ## Press ENTER key
|
||||
```
|
||||
|
||||
安装完成后,你将在最后看到以下输出:
|
||||
|
||||
```
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
OK. NetData is installed and it is running (listening to *:19999).
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
INFO: Command line options changed. -pidfile, -nd and -ch are deprecated.
|
||||
If you use custom startup scripts, please run netdata -h to see the
|
||||
corresponding options and update your scripts.
|
||||
|
||||
Hit http://localhost:19999/ from your browser.
|
||||
|
||||
To stop netdata, just kill it, with:
|
||||
|
||||
killall netdata
|
||||
|
||||
To start it, just run it:
|
||||
|
||||
/usr/sbin/netdata
|
||||
|
||||
|
||||
Enjoy!
|
||||
|
||||
Uninstall script generated: ./netdata-uninstaller.sh
|
||||
```
|
||||
|
||||
![][3]
|
||||
|
||||
安装 NetData
|
||||
|
||||
NetData 已安装并启动。
|
||||
|
||||
要在其他 Linux 发行版上安装 Netdata,请参阅[**官方安装说明页面**][4]。
|
||||
|
||||
##### 在防火墙或者路由器上允许 NetData 的默认端口
|
||||
|
||||
如果你的系统在防火墙或者路由器后面,那么必须允许默认端口 **19999** 以便从任何远程系统访问 NetData 的 web 界面。
|
||||
|
||||
**在 Ubuntu/Debian 中:**
|
||||
|
||||
```
|
||||
$ sudo ufw allow 19999
|
||||
```
|
||||
|
||||
**在 CentOS/RHEL/Fedora 中:**
|
||||
|
||||
```
|
||||
$ sudo firewall-cmd --permanent --add-port=19999/tcp
|
||||
|
||||
$ sudo firewall-cmd --reload
|
||||
```
|
||||
|
||||
### 启动/停止 NetData
|
||||
|
||||
要在使用 **Systemd** 的系统上启用和启动 Netdata 服务,请运行:
|
||||
|
||||
```
|
||||
$ sudo systemctl enable netdata
|
||||
|
||||
$ sudo systemctl start netdata
|
||||
```
|
||||
|
||||
要停止:
|
||||
|
||||
```
|
||||
$ sudo systemctl stop netdata
|
||||
```
|
||||
|
||||
要在使用 **Init** 的系统上启用和启动 Netdata 服务,请运行:
|
||||
|
||||
```
|
||||
$ sudo service netdata start
|
||||
|
||||
$ sudo chkconfig netdata on
|
||||
```
|
||||
|
||||
要停止:
|
||||
|
||||
```
|
||||
$ sudo service netdata stop
|
||||
```
|
||||
|
||||
### 通过 Web 浏览器访问 NetData
|
||||
|
||||
打开 Web 浏览器,然后打开 **<http://127.0.0.1:19999>** 或者 **<http://localhost:19999/>** 或者 **<http://ip-address:19999>**。你应该看到如下页面。
|
||||
|
||||
![][5]
|
||||
|
||||
Netdata 仪表板
|
||||
|
||||
在仪表板中,你可以找到 Linux 系统的完整统计信息。向下滚动以查看每个部分。
|
||||
|
||||
你可以随时打开 **<http://localhost:19999/netdata.conf>** 来下载和/或查看 NetData 默认配置文件。
|
||||
|
||||
![][6]
|
||||
|
||||
Netdata 配置文件
|
||||
|
||||
### 更新 NetData
|
||||
|
||||
在 Arch Linux 中,只需运行以下命令即可更新 NetData。如果仓库中提供了更新版本,那么就会自动安装该版本。
|
||||
|
||||
```
|
||||
$ sudo pacman -Syyu
|
||||
```
|
||||
|
||||
在基于 DEB 或 RPM 的系统中,只需进入已克隆它的目录(此例中是 netdata)。
|
||||
|
||||
```
|
||||
$ cd netdata
|
||||
```
|
||||
|
||||
拉取最新更新:
|
||||
|
||||
```
|
||||
$ git pull
|
||||
```
|
||||
|
||||
然后,使用命令重新构建并更新它:
|
||||
|
||||
```
|
||||
$ sudo ./netdata-installer.sh
|
||||
```
|
||||
|
||||
### 卸载 NetData
|
||||
|
||||
进入克隆 NetData 的文件夹。
|
||||
|
||||
```
|
||||
$ cd netdata
|
||||
```
|
||||
|
||||
然后,使用命令卸载它:
|
||||
|
||||
```
|
||||
$ sudo ./netdata-uninstaller.sh --force
|
||||
```
|
||||
|
||||
在 Arch Linux 中,使用以下命令卸载它。
|
||||
|
||||
```
|
||||
$ sudo pacman -Rns netdata
|
||||
```
|
||||
|
||||
**资源:**
|
||||
|
||||
* [**NetData 网站**][7]
|
||||
* [**NetData 的 GitHub 页面**][8]
|
||||
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.ostechnix.com/netdata-real-time-performance-monitoring-tool-linux/
|
||||
|
||||
作者:[sk][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.ostechnix.com/author/sk/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.ostechnix.com/wp-content/uploads/2016/06/Install-netdata-720x340.png
|
||||
[2]: https://www.ostechnix.com/getting-started-pacman/
|
||||
[3]: https://www.ostechnix.com/wp-content/uploads/2016/06/Deepin-Terminal_002-6.png
|
||||
[4]: https://docs.netdata.cloud/packaging/installer/
|
||||
[5]: https://www.ostechnix.com/wp-content/uploads/2016/06/Netdata-dashboard.png
|
||||
[6]: https://www.ostechnix.com/wp-content/uploads/2016/06/Netdata-config-file.png
|
||||
[7]: http://netdata.firehol.org/
|
||||
[8]: https://github.com/firehol/netdata
|
Loading…
Reference in New Issue
Block a user