MySQL Enterprise Monitor安装
体系架构
----------------------------------------------------
Monitired MySQL Server <--> Agent --> Monitor
安装步骤
----------------------------------------------------
1. 建立一个作为Repository独立的MySQL数据库,也可以用EM自带的
2. 安装EM
3. 在每个要监视的MySQL server上按住EM agent
安装文件
EM:
mysqlmonitor-2.3.9.2137-linux-x86_64-installer.bin
mysqlmonitor-2.3.9.2137-linux-x86_64-update-installer.bin
EM agent:
mysqlmonitoragent--2.3.9.2137-linux-x86_64-installer.extension
安装EM
----------------------------------------------------
./mysqlmonitor-2.3.9.2137-linux-x86_64-installer.bin --mode unattended \
--mysql_installation_type bundled \
--installdir /data/enterprise/monitor \
--adminuser em_admin --adminpassword em_password
./mysqlmonitor-2.3.9.2137-linux-x86_64-update-installer.bin --mode unattended \
--installdir $MYSQL_ROOT/enterprise/monitor \
--createDataBackup 0
Repository用EM自带的mysql,缺省会在13306端口启动,所有的配置文件,数据文件都放到了安装目录:
mysql -u em_admin -padmindemo -h 127.0.0.1 -P 13306
mysql> select user,password,host from mysql.user;
+----------+-------------------------------------------+------------+
| user | password | host |
+----------+-------------------------------------------+------------+
| em_admin | *B994AC90D2010A61C3E18636CB3225DD173DFD23 | localhost |
| em_admin | *B994AC90D2010A61C3E18636CB3225DD173DFD23 | mysql02-us |
| em_admin | *B994AC90D2010A61C3E18636CB3225DD173DFD23 | 127.0.0.1 |
+----------+-------------------------------------------+------------+
3 rows in set (0.00 sec)
mysql> show variables like '%datadir%';
+---------------+---------------------------------------+
| Variable_name | Value |
+---------------+---------------------------------------+
| datadir | /mysql/enterprise/monitor/mysql/data/ |
+---------------+---------------------------------------+
1 row in set (0.00 sec)
mysql>
启停EM:
mysqlmonitorctl.sh start
mysqlmonitorctl.sh status
mysqlmonitorctl.sh stop
EM用的是tomcat作为web服务器的
第一次登录需要做如下的初始化设置
1. Set up your My Oracle Support credentials.
2. Create a user name and password for the dashboard administrator.
dba/oracle123
3. Create a user name and password for the Monitor Agent.
em_agent/agentdemo
4. 在页面上上传AdvisorScript-Platinum-2.3.9.2137.jar
EM Agent的的安装
----------------------------------------------------
mysqlmonitoragent-version-linux-glibc2.3-x86-64bit-installer.bin --mode unattended \
--installdir mysql/enterprise/agent
--mysqlhost 127.0.0.1 --mysqlport 3306 --mysqluser agent --mysqlpassword mysql --checkmysqlhost yes ##被监视的数据信息
--managerhost em_hostname --managerport 18080 --agentuser AGENTUSER --agentpassword PASSWORD ##连接monitor的信息
--proxyport 44044 --enableproxy 0
--createaccount 1 --rootuser ROOTUSER --rootpassword PASSWORD
enableProxy就是让agent具有mysql proxy的功能,应用通过agent来连接数据库,这样agent就可以收集到sql语句来做Query Analyzer
这个功能对单机数据库用用
Em agent需要两个连接
一个连接management服务器,就是EM monitor,需要哦能够到前面建立的agent用户名和密码
一个连接被监视的MySQL,一般是本机3306端口的数据库,它需要用被监视数据库的root用户登录来建立自己需要的agent用户名和密码
启动和停止agent
/etc/init.d/mysql-monitor-agent start
/etc/init.d/mysql-monitor-agent status
/etc/init.d/mysql-monitor-agent stop
阅读(975) | 评论(0) | 转发(0) |