CentOS7 Performance Monitoring System Installation
Directory
System description.
Development environment.
Before.
Install the influxdb database.
Install collectd
Install Grafana
FAQ
Influxdb web interface does not respond.
System description
To create a beautiful real-time monitoring system like New Relic, we only need the three InfluxDB, collectd, and Grafana tools. The relationship between these three tools is as follows:
Collect data-> store data (InfluxDB)-> display data (Grafana ).
InfluxDB is an open-source Distributed Time Series database developed in the Go language. It is ideal for storing metrics, events, analysis, and other data.
Collectd is a system performance collection tool written in C;
Grafana is a front-end tool developed by pure Javascript. It is used to access InfluxDB, customize reports, and display charts. Development Environment
System Version Information |
Linux version 3.10.0-123. el7.x86 _ 64 (builder@kbuilder.dev.CentOS.org) (gcc version 4.8.2 20140120 (Red Hat 4.8.2-16) (GCC )) Install in Centos7 minimal mode |
Use software version |
Collectd: collectd-5.5.0-2.el7.x86_64 Influxdb: influxdb-0.8.8-1.x86_64 Garfana: grafana-2.0.2-1.x86_64 |
Before getting started
Disable selinux:
[Root @ localhost ~] # Vi/etc/selinux/config
Change SELINUX = enforcing to SELINUX = disabled
Calibration Time:
Set to Shanghai Time Zone
[Root @ localhost log] # timedatectl set-timezone Asia/Shanghai
Synchronization time
[Root @ localhost log] #/usr/sbin/ntpdate time.nist.gov note:
I wrote a rough script for installing three software with one click. github address:
Https://github.com/kylinlin/install_performance_monitor_automaticallyinstall influxdbdatabase
Download Software from this URL: https://s3.amazonaws.com/influxdb/influxdb-0.8.8-1.x86_64.rpm
Unzip and install
[Root @ localhost ~] # Rpm-ivh influxdb-0.8.8-1.x86_64.rpm
Disable Firewall:
[Root @ localhost ~] # Systemctl stop firewalld. service
Add a port to the firewall:
[Root @ localhost ~] # Firewall-cmd -- zone = public -- add-port = 8083/tcp -- permanent (add port 5666)
[Root @ localhost ~] # Firewall-cmd -- reload (restart firewall)
Start the process:
[Root @ localhost ~] #/Etc/init. d/influxdb start
Note: The installation and startup are successful only when the font in the red box appears.
Open the browser and enter the address http: // 192.168.1.204: 8083/. You can see the screen after startup. the login name and password are root by default.
Create Database: Enter the Database name collectd and click Create Database.
Database Created
Influxdb configuration file:/opt/influxdb/shared/config. toml install collectd
Download the software from here:
Http://dl.Fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
Installation:
[Root @ slave204 tmp] # rpm-ivh epel-release-7-5.noarch.rpm
[Root @ slave204 tmp] # yum install collectd-y
The configuration file of collectd is/etc/collectd. conf, and its execution file is located in/usr/sbin/collectd
Back up the configuration file
[Root @ slave204 tmp] # cp/etc/collectd. conf/etc/collectd. conf_backup
Then modify the configuration file: [root @ localhost ~] # Vi/etc/collectd. conf
First, remove the following comments and modify the Hostname.
Remove the files before LoadPlugin network and LoadPlugin uptime #
Add a Configuration item under Plugin Configuration.
Save and exit, and run the check command: [root @ localhost etc] #/usr/sbin/collectd-t
If no output exists, the configuration is correct.
Start: [root @ localhost etc] # systemctl start collectd. service stores collectd data in influxdb
First, back up the influxdb configuration file.
[Root @ slave204 tmp] # cp/opt/influxdb/shared/config. toml/opt/influxdb/shared/config. toml_backup
Then, modify the [input_plugins.collectd] in the configuration file and configure it as follows:
[Root @ slave204 tmp] # vim/opt/influxdb/shared/config. toml
Restart influxdb
[Root @ slave204 tmp] #/etc/init. d/influxdb restart
Refresh the influxdb web interface and enter the collectd database.
View memory usage results: select * from "influxdb/memory-used"
Install Grafana
Download the installation package:
Https://grafanarel.s3.amazonaws.com/builds/grafana-2.0.2-1.x86_64.rpm
[Root @ localhost ~] # Yum install initscripts fontconfig-y
[Root @ slave204 tmp] # rpm-ivh grafana-2.0.2-1.x86_64.rpm
Set startup
[Root @ slave204 tmp] # systemctl daemon-reload
Start the grafana Server
[Root @ slave204 tmp] # systemctl start grafana-server
Check whether the startup status is successful
[Root @ slave204 tmp] # systemctl status grafana-server
Log on to the web page: 192.168.1.204: 3000. the user name and password are both admin configuration data sources.
After logging in, you will see a blank space. Click the icon to complete all configurations.
First, change the password:
Import the database data to granfa and configure it as follows:
Name: influxdb
Type: InfluxDB 0.8.x
Url: http: // localhost: 8086
Database: collectd
User: root Password: root
Create a dashboard
Return to the Home page and click Home.
A blank dashboard has been created above. Now you can add monitoring elements to the dashboard to monitor CPU idle rate.
Create a title for a chart
Define query statements
For specific definitions of the derivative function in, refer to here:
Https://influxdb.com/docs/v0.8/api/aggregate_functions.htmldefine coordinate axis
Monitoring memory
Monitor network card
Define the chart display content (the available value of series is the content displayed after list series is executed on the influxdb web Interface). You can click Add query again to Add the content:
Note that there are multiple NICs. First confirm your system Nic and then select
After creation, click Back to dashboard to return to the home page
FAQ
Influxdb web interface does not respond
After influxdb is installed, log on to the web interface and enter the user name and password. Then, click Connect.
A: Close the firewall.