安装NewRelic的MySQL插件

Posted

下载解压 newrelic_mysql_plugin

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

复制到/usr/local/ 目录下

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

改配置

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

添加授权码(YOUR LICENSE KEY)

vi config/newrelic.properties
licenseKey=xxxxxxxxxxxxxxxxxxxxxxxxxx

配置mysql的参数

vi config/mysql.instance.json

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

看看是否能启来了

java -Xmx128m -jar newrelic_mysql_plugin-1.2.0.jar

开机的时候自动运行

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

启动newrelic-mysql-plugin

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/uXyZ66