-
Notifications
You must be signed in to change notification settings - Fork 0
/
graphite_centos.howto
120 lines (83 loc) · 3.29 KB
/
graphite_centos.howto
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
Starting documentation on graphite on CentOS howto
What you will get with graphite will be
* Place to store numeric time-series data
* Software to render graphs of the data collected
Process will be
1. Install graphite and use MySQL for backend
2. Install carbon and whisper
3. Install bucky
4. Install collectd
1. Install graphite and use MySQL for backend
- Install packages
* yum install graphite-web mysql mysql-server MySQL-python
- Start and configure MySQL
* /etc/init.c/mysqld start
* mysql_secure_installation (follow prompts)
# Create DB to be used by graphite, username and password
mysql -e "create database graphite;" -u root -p
mysql -e "grant all privileges on graphite.* to 'graphite'@'localhost' identified by 'my_super_extra_password';" -u root -p
mysql -e "flush privileges;" -u root -p
- Confiure graphite to use the graphite DB created on MySQL
* vim /etc/graphite-web/local_settings.py
DATABASES = {
'default': {
'NAME': 'graphite',
'ENGINE': 'django.db.backends.mysql',
'USER': 'graphite',
'PASSWORD': 'my_super_extra_password',
}
}
- Populate the graphite DB with the graphite script
* /usr/lib/python2.6/site-packages/graphite/manage.py syncdb
When this steps occurs, you will be prompted to create a superuser. This superuser will be the one used to login to the graphite web interface and save custom graphs, create more users and some other admin tasks. Please save the credentials for the user created.
- Start apache and point your browser to your grpahite server ip
* /etc/init.d/httpd start
These are all the steps required to install and configure graphite
2. install carbon and whisper
* yum install python-carbon python-whisper
- start the carbon cache service
* /etc/init.d/carbon-cache start
- Configure a simple storage-schema.conf
* vim /etc/carbon/storage-schemas.conf
add this
[server_load]
priority = 100
pattern = ^servers\.
retentions = 10:43200,900:350400
3. Install bucky
* yum install python-bucky
4. Install collectd
* yum install -y rrdtool rrdtool-devel perl rrdtool-perl libgcrypt-devel gcc make gcc-c++ perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker perl-ExtUtils-Embed
* cd /opt; curl -s -L http://collectd.org/files/collectd-5.4.1.tar.bz2 | tar jx; cd collectd-5.4.1
* ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --libdir=/usr/lib --mandir=/usr/share/man --enable-cpu --enable-curl --enable-df --enable-exec --enable-load --enable-logfile --enable-memory --enable-network --enable-nginx --enable-syslog --enable-rrdtool --enable-uptime --enable-write_graphite
* make; make install
* cp contrib/redhat/init.d-collectd /etc/init.d/collectd; chmod 755 /etc/init.d/collectd; chown root.root /etc/init.d/collectd
* /etc/init.d/collectd start; chkconfig --level 345 collectd on
* vim /etc/collectd.conf
FQDNLookup true
LoadPlugin syslog
LoadPlugin logfile
<Plugin "logfile">
LogLevel "info"
File "/var/log/collectd.log"
Timestamp true
</Plugin>
LoadPlugin cpu
LoadPlugin interface
LoadPlugin load
LoadPlugin memory
LoadPlugin rrdtool
LoadPlugin write_graphite
<Plugin "write_graphite">
<Carbon>
Host "127.0.0.1"
Port "2003"
Prefix "collectd."
Protocol "tcp"
EscapeCharacter "_"
SeparateInstances true
StoreRates false
AlwaysAppendDS false
</Carbon>
</Plugin>
Include "/etc/collectd.d"