Authorpython |
Versionmysql |
Timelinux |
Commentnginx |
V0.1sql |
Mar 1st , 2019docker |
First commitshell |
|
Hao.Yu@telit.comapache |
V0.2centos |
Mar 4th , 2019 |
add data source from influxDB |
graphite is solution for data source scale out
statsD to limited the metric sent to graphite
Download MySQL Yum Repository
https://dev.mysql.com/downloads/repo/yum/
wget http://dev.mysql.com/get/mysql80-community-release-el7-2.noarch.rpm
install the repo
rpm -ivh mysql80-community-release-el7-2.noarch.rpm
see if the repo is enable or disable
yum repolist all | grep mysql
enable mysql 5.7
yum-config-manager --enable mysql57-community
check repo to make sure 5.7 is enable in repo
cat mysql-community.repo
yum repolist enabled | grep mysql
yum install mysql-community-server
systemctl start mysqld
systemctl status -l mysqld
yum install python34-PyMySQL.noarch
find mysql root initial password
sudo grep 'temporary password' /var/log/mysqld.log
2019-03-01T04:19:58.304407Z 1 [Note] A temporary password is generated for root@localhost: 1XGPZC)o<rs+
mysql -uroot -p
change root password
ALTER USER 'root'@'localhost' IDENTIFIED BY 'Root@123';
create user graphite identified by 'Grap@123';
create database graphite;
grant all ON graphite.* to graphite@'%';
sudo yum install -y yum-utils \
device-mapper-persistent-data \
lvm2
sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
sudo yum install docker-ce docker-ce-cli containerd.io
service docker start
docker run -d --name graphite --restart=always -p 81:81 -p 80:80 -p 8125:8125/udp hopsoft/graphite-statsd
please check 8125 is StatsD traffic port in UDP mapping
visit http://10.143.40.170/login with admin/admin
change admin password
http://10.143.40.170/admin/users/edit/1
find download information from http://docs.grafana.org/installation/rpm/
vi /etc/yum.repos.d/grafana.repo
[grafana]
name=grafana
baseurl=https://packages.grafana.com/oss/rpm
repo_gpgcheck=1
enabled=1
gpgcheck=1
gpgkey=https://packages.grafana.com/gpg.key
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
yum install Grafana
binding ip address and mysql account information
vi /etc/grafana/grafana.ini
systemctl start grafana-server
systemctl status -l grafana-server
check port is up
netstat -ntlp
goto http://192.168.1.60:3000
login as admin/admin
install server side image rendering
yum install -y fontconfig freetype* urw-fonts
create folder and dashboard
share the link
Add data source
fill in mysql account information
click save and test for testing the connection
topologic introduce https://www.influxdata.com/time-series-platform/
goto https://portal.influxdata.com/downloads/ get download link
wget https://dl.influxdata.com/influxdb/releases/influxdb-1.7.4.x86_64.rpm
sudo yum localinstall influxdb-1.7.4.x86_64.rpm
systemctl start influxdb
enter influx to enter the shell
create and show database
insert data by shell
insert cpu,host=nginx value=0.5
insert data by API
curl -i -XPOST 'http://localhost:8086/write?db=TelitDemo' --data-binary 'cpu,host=apache value=4'
query database
CREATE USER "admin" WITH PASSWORD 'Pass@123' WITH ALL PRIVILEGES
enable auth in influxdb
vi /etc/influxdb/influxdb.conf
[http]
enabled = true
bind-address = "10.143.40.163:8088"
auth-enabled = true
then restart the influxdb
systemctl restart influxdb
goto Grafana web ui http://10.143.40.160:3000 and find configuration in left menu
enter influxdb connection information
click save and test to make sure db link is available
create influx DS folder and create new dashboard
add query and select data source
edit panel
add fake data
data will show up in the panel
update with mysql account information
create production table and column
make some fake number
create mysql folder and switch datasource to mysql
select add a table
SELECT * from production
order by SalesTime desc
limit 10
;
finally go back to dashboard and looks like this
update SMTP information in /etc/grafana/grafana.ini
and update alerting configuration in Grafana webUI
https://grafana.com/plugins/raintank-worldping-app/installation
grafana-cli plugins install raintank-worldping-app
service grafana-server restart
enable worldping in Grafana plugings
go and get Grafana.com API Key
https://grafana.com/login?to=%2Fprofile%2Fapi-keys
register user and find key
https://grafana.com/orgs/pcdog/api-keys
dashboard like this
goto world ping home in left menu
add endpoint
wait data information collection
wait for a while for the ping data collection , the dashboard will looks like this.