This repository has been archived by the owner on Jan 26, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathperformance-monitoring.txt
183 lines (133 loc) · 5.49 KB
/
performance-monitoring.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
= Performance Monitoring
The performance monitoring toolchain consists of a number of components including
* A Collection Agent (collectd)
* A Collection Aggregator/Relay (graphite)
* A Data Store (whisperdb)
* An API/Presentation Layer (grafana)
These components and their interactions are laid out in the following diagram
image::performance_monitoring_single_node_collectd.png[]
== Installing the Performance Monitoring Suite
=== Installing the Collection Aggregator/Relay
Locate a bare metal system that meets the following minimum specifications
* 4GB of Memory
* Single Socket Xeon Class CPU
* 500GB of Disk Space
Do a fresh CentOS 7 basic install onto the machine. The required repositories
are enabled by
yum install centos-release-opstools
There is also a repository for using grafana required. Details can be found at
https://grafana.com/grafana/download
First thing we will need to open the firewall on the machine to allow connections to graphite and grafana
firewall-cmd --zone=public --add-port=2003/tcp --permanent
firewall-cmd --zone=public --add-port=3000/tcp --permanent
firewall-cmd --reload
Once that is done, install the graphite and grafana software by running the following command
yum install -y python-carbon graphite-web grafana httpd
First we will configure the grafana web interface to allow access. Edit
or create the file /etc/httpd/conf.d/graphite-web.conf and modify the
following lines blow to look like the following (changing Require line)
<Directory "/usr/share/graphite/">
<IfModule mod_authz_core.c>
# Apache 2.4
Require all granted
</IfModule>
Next we will synchronise the database behind graphite web. Run the following command (when prompted if you want to create a super user choose no)
sudo -u apache /usr/bin/graphite-manage syncdb --noinput
Next we will start and enable all the graphite and grafana services
systemctl start httpd
systemctl enable httpd
systemctl start carbon-cache
systemctl enable carbon-cache
systemctl start grafana-server
systemctl enable grafana-server
Now we will configure grafana to talk to our graphite instance. Go to the
following address in your browser (where
$FQDN_OF_PERFORMANCE_MONITORING_HOST is the hostname or IP address of the
host we have configured to store the centralised monitoring data
http://$FQDN_OF_PERFORMANCE_MONITORING_HOST:3000/
You should be presented with the grafana login page. Enter in the default
credentials of admin/admin to log into the system. Once you are logged in,
click on the grafana logo in the top left of the screen, then choose "Data
Sources". At the top of the page click "Add new", Enter in the following
details
Name: graphite
Default: yes (tick)
Type: Graphite
Url: http://localhost/
Access: proxy
Basic Auth: no (unticked)
Then click the "Add" button at the bottom.
== Installing the Performance Monitoring Collection Agent on all nodes
To monitor the performance of all machines in the OpenStack environment,
you will need to make sure the following channel is enabled in Subscription
Manager/Satellite on all machines
rhel-7-server-openstack-7.0-optools-rpms
Once this is done, you will need to install the following packages on all
OpenStack machines
yum install -y collectd
Next you will need to configure collectd on all machines to send their data
to the performance monitoring aggregator/relay. Edit the file
/etc/collectd.d/10-write_graphite.conf and place in it the following
contents (where $FQDN_OF_PERFORMANCE_MONITORING_HOST is the hostname or IP
address of the host we configured previously to be the performance
monitoring aggregator/relay)
<LoadPlugin write_graphite>
Globals false
</LoadPlugin>
<Plugin write_graphite>
<Carbon>
Host "$FQDN_OF_PERFORMANCE_MONITORING_HOST"
Port "2003"
Prefix "collectd."
EscapeCharacter "_"
StoreRates true
LogSendErrors true
Protocol "tcp"
</Carbon>
</Plugin>
When using SELinux, make sure to execute
setsebool -P collectd_tcp_network_connect=1
== Configure OpenStack specific collectd plugins in collectd
Collectd in its standard distribution already provides a few plugins suitable
for monitoring OpenStack. However, some more advanced plugins can and should
be installed and enabled.
=== Configure apache related monitoring
To install the collectd plugin, run
yum install collectd-apache
Create a file /etc/httpd/conf.d/16-server-status.conf:
LoadModule status_module modules/mod_status.so
<Location /server-status>
SetHandler server-status
Require host localhost
</Location>
ExtendedStatus On
Change the file /etc/collect.d/apache.conf to read
LoadPlugin apache
<Plugin apache>
<Instance "localhost">
URL "http://localhost/server-status?auto"
</Instance>
</Plugin>
=== Configure mysql monitoring
First, a collectd-plugin needs to be installed
yum install collectd-mysql
Create a monitoring user for be able to connect to
mysql, and grant that user USAGE privileges:
CREATE USER 'monitoring'@'localhost' IDENTIFIED BY 'monitorpassword';
-- Give appropriate permissions
-- ("GRANT USAGE" is synonymous to "no privileges")
GRANT USAGE ON *.* TO 'monitoring'@'localhost';
FLUSH PRIVILEGES;
Change the file /etc/collectd.d/mysql.conf:
LoadPlugin mysql
<Plugin mysql>
<Database "nova">
Host "localhost"
User "monitoring"
Password "monitorpassword"
Socket "/var/lib/mysql/mysql.sock"
</Database>
</Plugin>
Now we need to start and enable collectd on all hosts
systemctl start collectd
systemctl enable collectd