jmeter + influxdb + granfana + collectd monitor cpu + mem + TPS

1. AnSo grafana

##### gafana expired installation package error

RPM-grafana the Unpacking Package Error 5.1.4-1.x86_64
error: the Unpacking of Archive File failed ON / usr / sbin / grafana-CLI; 5e250e9c: the cpio: Read
Verifying: grafana-5.1.4-1.x86_64
reason damaged installation package not the latest
###### Download the official website of the latest package:
#### grafana Installer
https://grafana.com/grafana/download

#####binary install
wget https://dl.grafana.com/oss/release/grafana-6.5.3.linux-amd64.tar.gz
tar -zxvf grafana-6.5.3.linux-amd64.tar.gz
#### grafana rpm install
sudo yum install initscripts urw-fonts wget
wget <rpm package url>
sudo rpm -Uvh <local rpm package>
安装成功展示
warning: grafana-6.5.3-1.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID 24098cb6: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:grafana-6.5.3-1 warning: /etc/init.d/grafana-server created as /etc/init.d/grafana-server.rpmnew
warning: /usr/lib/systemd/system/grafana-server.service created as /usr/lib/systemd/system/grafana-server.service.rpmnew
################################# [100%]
### NOT starting on installation, please execute the following statements to configure grafana to start automatically using systemd
sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable grafana-server.service
### You can start grafana-server by executing
sudo /bin/systemctl start grafana-server.service
POSTTRANS: Running script.............


#### start grafana, verify that the service is started
sudo systemctl-daemon reload
sudo systemctl Start grafana-Server
sudo systemctl Status grafana-Server
### starts successfully verified :
● grafana-server.service - Grafana instance
Loaded: loaded (/ usr /lib/systemd/system/grafana-server.service; Enabled; PRESET Vendor: Disabled)
the Active: the Active (running) Operating since Mon 2020-01-20 10:31:27 CST; 12S ago Member
docs: HTTP: // docs. grafana.org
Main PID: 63048 (grafana-Server)

### Configuring boot from the start
sudo systemctl enable grafana-server.service

#### firewall ports open by default grafana 3000 :
Firewall-cmd = --zone public --add-Port = 3000 / tcp --permanent
Firewall-cmd --reload
Firewall-cmd = --zone public --list-the ports
or simply turning off the firewall:
systemctl STOP firewalld


### web access grafana:
Install the host ip: 3000

### grafana modify the configuration, Grafana has many configuration options, you can specify or use environment variables specified in the .ini configuration file,
you must restart Grafana to make all configuration changes to take effect.
Doc document's official website address: HTTPS: //grafana.com/docs/grafana/latest/installation/configuration/
vi /etc/grafana/grafana.ini
### method to explain the INI comment comment:
all comments begin with a semicolon, if necessary For example, to change the configuration web page port,
need to remove the semicolon in front of the line, change

###关于web login密码账号更改也是如此,需要重启grafana才生效
37 # The http port to use
38 ;http_port = 3000
####web login
152 #################################### Security ####################################
153 [security]
154 # disable creation of admin user on first start of grafana
155 ;disable_initial_admin_creation = false
156
157 # default admin user, created on startup
158 ;admin_user = admin
159
160 # default admin password, can be changed before first start of grafana, or in profile settings
161 ;admin_password = admin

##### influxdb failed to start problem solving, influxdb Installer configuration path:

/etc/influxdb/influxdb.conf
#####启用graphite配置########:
[[graphite]]
# Determines whether the graphite endpoint is enabled.
enabled = false
database = "graphite"
# retention-policy = ""
bind-address = ":2003"
protocol = "tcp"
consistency-level = "one"
http启用:
### [http]
###
### Controls how the HTTP endpoints are configured. These are the primary
### mechanism for getting data into and out of InfluxDB.
###

[http]
# Determines whether HTTP endpoint is enabled.
enabled = true

# The bind address used by the HTTP service.
bind-address = ":8086"


The default data is stored influxdb ####: meta metadata, Data
/ var / lib / influxdb / Data
/ var / lib / influxdb / Meta

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
### [meta]
###
### Controls the parameters for the Raft consensus group that stores metadata
### about the InfluxDB cluster.
###

[meta]
# Where the metadata/raft database is stored
dir = "/var/lib/influxdb/meta"

# Automatically create a default retention policy when creating a database.
# retention-autocreate = true

# If log messages are printed for the meta service
# logging-enabled = true

###
### [data]
###
### Controls where the actual shard data for InfluxDB lives and how it is
### flushed from the WAL. "dir" may need to be changed to a suitable place
### for your system, but the WAL settings are an advanced configuration. The
### defaults should work for most systems.
###

[data]
# The directory where the TSM storage engine stores TSM files.
dir = "/var/lib/influxdb/data"

# The directory where the TSM storage engine stores WAL files.
wal-dir = "/var/lib/influxdb/wal"
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

#### influxdb log directory:
Start influxdb: systemctl start influxdb
query start state: systemctl status influxdb

启动失败:
: Failed to start InfluxDB is an open-source, distributed, time series database.

tail -n 20 / var / log / messages reasons for the failure analysis, to find the user right to refuse:
RUN: Open Server: Open TSDb of Store: mkdir / var / lib / influxdb / the Data / _internal / _series: permission denied

#### inquiry influxdb: -ql influxdb use query RPM
/usr/lib/influxdb/scripts/influxdb.service
/ var / lib / influxdb
/ var / log / influxdb
####
LS influxdb the -l -d
cd / var / lib /
chown -R & lt influxdb: influxdb influxdb

#### influxdb collectd integrated installation monitoring CPU, MEM, Disk
### yum installation collectd: ORG: HTTPS: //collectd.org/download.shtml
<< Python module pseudocode https://www.jianshu.com/ the p-/ a05da23150fb >>
####### collectd installation, the official website address: https://collectd.org/download.shtml

The method of mounting a yum:
yum the install EPEL-Release-Y
yum the install -Y to collectd
### to modify the configuration:

we /etc/collectd.conf

 

Modify the configuration
vi /etc/collectd.conf

         Make sure the following items comments (#) is removed

             Hostname "192.168.1.126" here changed the IP address of the machine installation of collectd

             LoadPlugin cpu

             LoadPlugin memory

             LoadPlugin network

             LoadPlugin swap

            <Plugin cpu>

                    ReportByCpu true

                    ReportByState true

                    Enable cpu usage ValuesPercentage true here, 5.7. * Above have low version does not support a hundred percent

           </Plugin>

           <Plugin network>

                   <Server "192.168.1.222" "25826"> here designated port to send the data collected to influxdb collectd address and influxdb conf configuration in collectd

                 # Interface "enp0s31f6" get the name of the card by ifconfig

                  </Server>

          </Plugin>


启动:
systemctl start collectd.service
systemctl status collectd.service

● collectd.service - Collectd statistics daemon
Loaded: loaded (/usr/lib/systemd/system/collectd.service; disabled; vendor preset: disabled)
Active: active (running) since Mon 2020-01-20 17:11:49 CST; 23s ago
Docs: man:collectd(1)
man:collectd.conf(5)
Main PID: 6968 (collectd)
Tasks: 11
CGroup: /system.slice/collectd.service
└─6968 /usr/sbin/collectd


Method two: Source Installation:
wget https://storage.googleapis.com/collectd-tarballs/collectd-5.9.2.tar.bz2
the tar -xvf to collectd-5.9.2.tar.bz2
mkdir -p / Data / Project / collectd_dir / DATAS
## C the compile, a write system collectd C language statistics collection tool
./configure -prefix = / Data / Project / collectd_dir / DATAS
### by the install the dir DATAS
the make prefix = All the install / Data / Project / collectd_dir / DATAS
the Find / -name collectd.conf queries installation directory:
/data/project/collectd_dir/datas/etc/collectd.conf


####
Hostname "192.168.110.151"
#FQDNLookup to true
#BaseDir "/ var / lib / collectd "
#PIDFile" /var/run/collectd.pid "
#PluginDir" / usr / lib64 / collectd "
#TypesDB" /usr/share/collectd/types.db "

#### influxdb installation, the official website address https://v2.docs.influxdata.com/v2.0/get-started/ :

wget https://dl.influxdata.com/influxdb/releases/influxdb-1.7.2.x86_64.rpm
sudo yum localinstall influxdb-1.7.2.x86_64.rpm

Environment Variables: vi / etc / profile

## influx env
export INFLUXDB_CONFIG_PATH=/etc/influxdb/influxdb.conf


Start influxdb systemctl
[root @ hostuser1 Project] # Influx
Connected to HTTP: // localhost: 8086 Version 1.6.4
InfluxDB shell Version: 1.6.4
> collectd the Create Database
> collectd use
the Using Database collectd
> Show Databases
name: Databases
name
- -
_internal
jmeter
collectd
amount of data ### influxdb of more than one, will very much affect the performance, you can set only five days to retain data
> the Create retention Policy "5_days" ON collectd DURATION 5D default Replication 1
> Show retention Policies ON collectd
name DURATION replicaN default shardGroupDuration
---- -------- ------------------ -------- -------
autogen 0s 1 to true 168h0m0s
>
Show Measurements

### Check connector connection tcp 25826:
SS -tuln
UDP UNCONN 0 0 [::]: 25826 [::]: *
UDP UNCONN 0 0 [::. 1]: 323 [::]: *
TCP 128 the LISTEN 0 *: 111 *: *

##### collectd dashboard template
https://grafana.com/grafana/dashboards/10179

### JMETER >ADD>Listener>BackendListener

 

 

####TPS

 

 

####cpu,mem

Guess you like

Origin www.cnblogs.com/SunshineKimi/p/12219873.html