安装NewRelic的MySQL插件

下载解压 newrelic_mysql_plugin

1
2
wget https://rpm.newrelic.com/plugins/52/ccc77b365b95fb4ca973aa29843616fd
tar -xvf newrelic_mysql_plugin-1.2.0.tar.gz

复制到/usr/local/ 目录下

1
2
sudo cp -rf newrelic_mysql_plugin-1.2.0 /usr/local/newrelic-mysql
cd /usr/local/newrelic-mysql

改配置

1
2
cp config/template_mysql.instance.json config/mysql.instance.json
cp config/template_newrelic.properties config/newrelic.properties

添加授权码(YOUR LICENSE KEY)

1
2
vi config/newrelic.properties
licenseKey=xxxxxxxxxxxxxxxxxxxxxxxxxx

配置mysql的参数

1
2
3
4
5
6
7
8
9
10
11
vi config/mysql.instance.json

[
    {
                "name" : "Localhost",
                "host" : "localhost",
                "metrics" : "status,newrelic",
                "user" : "USER_NAME_HERE",
                "passwd" : "USER_PASSWD_HERE"
    },
]

看看是否能启来了

1
java -Xmx128m -jar newrelic_mysql_plugin-1.2.0.jar

开机的时候自动运行

1
sudo cp /usr/local/newrelic-mysql/etc/init.d/newrelic-mysql-plugin.rh /etc/init.d/newrelic-mysql-plugin

启动newrelic-mysql-plugin

1
2
sudo chmod 777 /etc/init.d/newrelic-mysql-plugin
sudo /etc/init.d/newrelic-mysql-plugin start

成功以后https://rpm.newrelic.com/左右的菜单就会出现“mysql”的栏目!

原文: https://rpm.newrelic.com/accounts/345505/plugins/directory/52

原文地址:http://dlj.bz/0g4lKu

Comments