Saturday, February 27, 2010

MySql: Install Enterprise Monitor




Contents
1. Instroduction
2. Install Service manager
2.1 Prepare For Installation
2.2 Installation Using Command Line Mode
3. Install monitor agent
3.1 Prepare for installation
3.2 Install Agent

1. INSTRODUCTION

2. INSTALL SERVICE MANAGER

2.1 Prepare For Installation

1. Create a mysql group and mysql user in the system if there is not one already.
#>groupadd mysql
#>useradd -s /bin/csh -m -d /home/mysql -c "Mysql User" -g mysql mysql
2. Check required linux package
As a prerequisite for installing the MySQL Enterprise Monitor Agent on Linux systems you must have the Linux Standards Base (LSB) initialization functions installed.
   rpm -qa |grep -i lsb
   redhat-lsb-3.0-8.EL

By deault, the installation using the following port:
Tomcat Server Port [18080]:
Tomcat Shutdown Port [18005]:
Tomcat SSL Port [18443]:
MySQL Database Port [13306]:


If you want to use the default ports, you need to install the service manager with root user since the ports are only can access by root. If you want to install using user other than root (unprivileged user), you need to use other ports.

You can change default to use the ports of your choices. However, you need to make sure that all the ports you are going to use are opened.

Since we are using mysql user to install the monitor, we are going to use the following ports:Tomcat Server Port [18080]: 8080

Tomcat Shutdown Port [18005]: 8005
Tomcat SSL Port [18443]: 8443
MySQL Database Port [13306]: 3306

To see if a port is open, use the following command to check individual port:
#> netstat -tulpn | grep 8080
(Not all processes could be identified, non-owned process info will not be shown, you would have to be root to see it all.)
tcp 0 0 :::8080 :::* LISTEN -

or you can use
#> netstat -tulpn | less

You can enable the ports by editing the /etc/service file in Redhat linux and restart xinetd.

3. To install the Service Manager find the file named mysqlmonitor-version-installer.bin (where version indicates the version number, the OS, and the architecture ). For example, following is a Linux 64 bit package.

   mysqlmonitor-2.1.1.1141-linux-x86_64-installer.bin

4. Ensure that this file is executable by typing:
#l> chmod +x mysqlmonitor-version-installer.bin

5. To install to the default directory (/opt/mysql/enterprise/monitor) you need to be logged in as root. Installing as an unprivileged user installs to the /home/user_name/mysql/enterprise/monitor/ directory.


7. Have your product key ready. The product key is in a xml file which should had beed downloaded along with the monitor package. The product key file will have a file name like:

 mysql_monitoring_service.key

You also shoul have the advisor.jar file ready,

2.2 Installation Using Command Line Mode

1. Begin Installation

Become the mysql user and from the shell, type:

#> ./ mysqlmonitor-2.1.1.1141-linux-x86_64-installer.bin

2. Select the language of your choice
Please select the installation language
[1] English - English
[2] Japanese - 日本語
Please choose an option [1] :1

3. Specify the installation directory:
Installation directory [/nethome/sweng/user/mysql/enterprise/monitor]: /opt/mysql/enterprise/monitor

4. Specify Tomcat Port. Use the default or pick one of your own.
Tomcat Server Options
Please specify the following parameters for the bundled Tomcat Server
Tomcat Server Port [18080]: 8080
Tomcat Shutdown Port [18005]: 8005
Tomcat SSL Port [18443]:8443

5. Specify SSL support. Select ‘y’ unless you don’t want ssh support

Is SSL support required? [y/N]:

6. Specify Repository configuration. It uses a MySql database to store information the service manager gathered. If you already have MySql database running on your server, you can use it

Repository Configuration

You can use the default username and password or you can create one your own.
Manager/password

Select the default port or select one your own when prompt.

Please specify the following parameters for the bundled MySQL server
Repository Username [service_manager]: manager
Password :
re-enter :
Bundled MySQL Database Port [13306]:3306
configuration Report

7. Note the configuration reports. It is in:
/opt/mysql/enterprise/monitor/configuration_report.txt

Note:
The settings you specified will be saved here:
/opt/mysql/enterprise/monitor/configuration_report.txt
IMPORTANT: This configuration report includes passwords stored in plain text; it is intended to help you install and configure your agents. We strongly advise you to secure or delete this text file immediately after installation

You have not installed the MySQL Enterprise Monitor as the root user. Therefore it could not be configured to auto-start on reboot. See the Installation section of the MySQL Enterprise Monitor documentation for instructions on how to do this manually.

Press [Enter] to continue :

8. Start Enterprise Monitor installation. Enter ‘Y’
Setup is now ready to install MySQL Enterprise Monitor on your computer.
Do you want to continue? [Y/n]: Y

Please wait while Setup installs MySQL Enterprise Monitor on your computer.
Installing
0% ______________ 50% ______________ 100%

#######################################

--------------------------------------------------------------------------

Completed installing files
Setup has completed installing the MySQL Enterprise Monitor files on your computer
Uninstalling the MySQL Enterprise Monitor files can be done by invoking:
/opt/mysql/enterprise/monitor/uninstall
To complete the installation, launch the MySQL Enterprise Dashboard and complete the initial setup and product activation information. Refer to the readme file for additional information and a list of known issues.

Press [Enter] to continue :
Press [Enter] to continue :
----------------------------------------------------------------------------

Setup has finished installing MySQL Enterprise Monitor on your computer.
View Readme File [Y/n]: Y
. Test the manager server
The README file is locate in /opt/mysql/enterprise/monitor/README.txt

From the web browser, enter the following url:
http://hostname:8080/
where hostname is the hostname of the manager server, 8080 is the port you enter in step 4 for Tomcat Server Port [18080]:

10. Enter product Key and Advisor.jar
After connect to the Tomcat server the first time, you should have the screen like this one:

Browser and upload your product key file and adviser.jar files. Enter the password for admin user and agenuser. You can different username if you prefer.
Set the time period for remove historica data collection. Pick a long one start with.When done, click on complete setup.

11. Connect to the Service Manager from browser. In the browser, enter the following url:

http://::8080.
Where is the hostname of your manager server.

Use admin as user id to login. If you see a screen like this one, it is working. And you can start to install agent on eah of your MySql Database Servers.

12. Configuration files and log files location

Config.properties is in

/opt/mysql/enterprise/monitor/apache-tomcat/webapps/ROOT/WEB-INF

This file contains configuration information about database connection.

">

3. INSTALL MONITOR AGENT<

For each database server that you want to monitor, an agent need to be install locally.

3.1 Prepare for installation
1. Create the following directory and give ownship to mysql.

/opt/mysql/enterprise/monitor
#>cd /opt
#>chown –R mysql:mysql mysql

2. Add the agent user to the database server you want to monitor

Before setting up an agent to monitor a MySQL server you need to ensure that there is a user account for the agent on that server
Login to the MySql database server and create the user call agent
mysql> create user 'agent' identified by 'password';
mysql> GRANT SELECT, REPLICATION CLIENT, SHOW DATABASES, SUPER, PROCESS
-> ON *.*
-> TO 'agent'@'localhost' identified by 'password';

Query OK, 0 rows affected (0.00 sec)

3. Check LSB installation
You can check the existence of the LSB package using the following command in linux:
#> rpm -qa |grep -i lsb

redhat-lsb-3.1-19.fc8.x86_64

3.2 Install Agent

1. Start installer

./mysqlmonitoragent-2\[1\].1.1.1144-linux-glibc2.3-x86-32bit-installer.bin

2. Select language

Select 1 for English

Language Selection
Please select the installation language
[1] English - English
[2] Japanese - 日本語


Please choose an option [1] : 1

3. Select installation directory

The installation directory is /opt/mysql/enterprise/monitor
Installation directory
Please specify the directory where MySQL Enterprise Monitor Agent will be installed
Installation directory [/u0/mysql/mysql/enterprise/agent]: /opt/mysql/enterprise/monitor

4. Provide database connection information
Select to socket as connection methold. You can find your socket file location from the my.cnf file.
Provide the username and password for the agent user which defined in step 1 of section 3.1

How will the agent connect to the database it is monitoring?

[1] TCP/IP
[2] Socket
Please choose an option [1] : 2

MySQL Socket []: /var/lib/mysql/mysql.sock
MySQL Username []: agent
MySQL Password :
Re-enter :

5. Query Analyzer configuration information

Enable Proxy (recommended) [Y/n]: Y
Proxy Port [6446]: 6446
Backend Host: 127.0.0.1 (cannot be changed)
Backend Port: 3306 (cannot be changed)

6. Provde Service Manager Server information

In this section, you provide hostname or IP of the service manager server. The tomcat ports and the agent id and password. The agent is and password is the one that you created in step 10 in section 2.1.

MySQL Enterprise Monitor Options
Hostname or IP address []: xyx.domain.com
Tomcat Server Port [18080]: 8080
Tomcat SSL Port [18443]: 8443
Use SSL? [y/N]: y

Agent Username [agent]: agent
Agent Password :
Re-enter :

7. Review configuration setting
Review the configuration parameters which you just entered. If all is fine, start the installation.

----------------------------------------------------------------------------
Configuration Report
Here are the settings you specified:
Installation directory: /opt/mysql/enterprise/monitor
Monitored MySQL Database:

-------------------------
Socket: /var/lib/mysql/mysql.sock
MySQL username: agent
MySQL password: password
Query Analyzer Configuration

-------------------------
Proxy Enabled: yes
Proxy Port: 6446

MySQL Enterprise Monitor:
-------------------------
Hostname or IP address: monitor.domain.com
Tomcat Server Port: 8080
Tomcat SSL Port: 8443
Use SSL: 1
Press [Enter] to continue :
Agent username: agent
Press [Enter] to continue :
----------------------------------------------------------------------------
Setup is now ready to begin installing MySQL Enterprise Monitor Agent on your computer.

Do you want to continue? [Y/n]: Y
Please wait while Setup installs MySQL Enterprise Monitor Agent on your computer.

Installing
0% ______________ 50% ______________ 100%

#########################################
----------------------------------------------------------------------------

Start MySQL Enterprise Monitor Agent
Info to start MySQL Enterprise Monitor Agent
The MySQL Monitor Agent was successfully installed. To start the MySQL Agent please invoke:

/opt/mysql/enterprise/monitor/etc/init.d/mysql-monitor-agent start

You have not installed the MySQL Service Agent as the root user. Therefore it could not be configured to auto-start on reboot. See the Installation section of the MySQL Enterprise Monitor documentation for instructions on how to do this manually.

Press [Enter] to continue :
Setup has finished installing MySQL Enterprise Monitor Agent on your computer.

View Readme File [Y/n]: Y

8. Created inventory table in mysql dabase

The agent use the mysql.inventory table to track replication related activities. For some installation, the table dose not exists. If the table dose not exists, the agent will not start.

Use the following commands create the table and grant permission to the agent user.

mysql> CREATE TABLE mysql.inventory ( name VARCHAR(64) NOT NULL PRIMARY KEY, value VARCHAR(64)) ENGINE=MYISAM;

Query OK, 0 rows affected (0.02 sec)

Mysql>grant insert, update,select on mysql.inventory to 'agent'@'%' identified by 'password';

Query OK, 0 rows affected (0.01 sec)

9. Start agent

Change to directory: /opt/mysql/enterprise/monitor/etc/init.d
Start the agent with the following command:

#> ./mysql-monitor-agent start

Starting MySQL Enterprise agent service... [ OK ]
Check if the agent is started:

#> ./mysql-monitor-agent status

MySQL Enterprise agent is running

10. Log file location

The agent log is located in /opt/mysql/enterprise/monitor. The log file name is, by default, mysql-monitor-agent.log. The following log entries indicate the agent is started successfully:

2010-02-25 15:48:23: (critical) MySQL Monitor Agent 2.1.1.1144 started.
2010-02-25 15:48:23: (critical) network-io.c:317: successfully reconnected to dashboard at https://agent:password@10.48.82.240:8443/heartbeat
2010-02-25 15:48:23: (critical) agent_mysqld.c:707: successfully connected to database at /var/lib/mysql/mysql.sock as user agent (with password: YES)

11. Check agent status from Service Manager using browser

Login into the service manager from the browser. The server of the agent that you just created should show up on the left hand side panel. And the monitor should show some status of the agent.

-----------------------------------
Post History:
2009-02-26: Initial post. Draft from actual installation note.

No comments: