2.4.4. Installing the Monitor Agent on Unix
As a prerequisite for installing the MySQL Enterprise Monitor Agent on Linuxsystems you must have the Linux Standards Base (LSB)initialization functions installed.
To install the agent navigate to the directory that contains thefile,mysqlmonitoragent-version
-installer.bin(where version indicates thethree-part version number, the OS, and the architecture). Ensurethat this file is executable by typing:
shell> chmod +x mysqlmonitoragent-version
-installer.bin
To install to the default directory(/opt/mysql/enterprise/agent
) you need tobe logged in as root
. Installing as anunprivileged user installs to the/home/user_name
/mysql/enterprise/agentdirectory.
Note
If you install the agent as an unprivileged user, it will notautomatically start up on rebooting.
What follows describes installation from the command line. Youmay install the Monitor Agent graphically by running theinstaller from within a windows manager. In both cases the stepsare identical. You may also install the Monitor Agent inunattendedmode. This is especially useful ifyou are doing multiple installations. For more information onthis topic see Section 2.7, “Unattended Installation”
.
Begin installation from the command line by typing:
shell> ./mysqlmonitoragent-version
-installer.bin --mode text
The various options are shown in what follows. Default valuesare indicated by square brackets; to select them pressEnter
. Otherwise enter a value of yourchoosing.
First, you must select the Language you want to use duringthe installation process:
Language Selection
Please select the installation language
[1] English
[2] Japanese
Please choose an option [1] :
Next, specify the directory where you want the agentinstalled:
----------------------------------------------------------------------------
Welcome to the MySQL Enterprise Monitor Agent Setup Wizard.
----------------------------------------------------------------------------
Please specify the directory where MySQL Enterprise Monitor Agent will be installed
Installation directory [/opt/mysql/enterprise/agent]:
Specify the MySQL server that you want to monitor. First,you must specify whether you want to use a TCP/IP orsocket-based connection to communicate with the MySQLServer:
How will the agent connect to the database it is monitoring?
[1] TCP/IP
[2] Socket
Please choose an option [1] :
If you select TCP/IP, then you will be asked to enter theTCP/IP address and port number:
----------------------------------------------------------------------------
Monitored Database Information
IMPORTANT: The agent user account specified below requires special MySQL privileges.
Visit the following URL for more information:
https://enterprise.mysql.com/docs/monitor/2.0/en/mem-install.html#mem-agent-rights
MySQL hostname or IP address [127.0.0.1]:
Validate MySQL hostname or IP address [Y/n]:
MySQL Port [3306]:
If you select Socket, then you will be asked to provide thepath name to the MySQL socket. Typical values are/tmp/mysql.sock
,/var/lib/mysql.sock
, or/var/run/mysql.sock
.
----------------------------------------------------------------------------
Monitored Database Information
IMPORTANT: The agent user account specified below requires special MySQL privileges.
Visit the following URL for more information:
https://enterprise.mysql.com/docs/monitor/2.0/en/mem-install.html#mem-agent-rights
MySQL Socket []:
Note
The service agent always associates “localhost
”
with the TCP/IP address 127.0.0.1, not the MySQL socket. This is in
contrast to the MySQL Command Line Tool, which connects via the MySQL
socket by default on Unix, if the hostname “localhost
” is specified.
If the MySQL server you wish to monitor has been started with the --skip-networking
command option then you will not be able to connect to it via TCP/IP,
as the server will not listen for TCP/IP connections. In this case the
service agent will need to be configured to use the MySQL socket. This
can be done during installation by selecting “socket
” rather than “TCP/IP
” and then specifying the MySQL socket name. This can also be configured after installation by editing the agent-instance.iniconfiguration file, for further information on this refer to Section 2.6.2, “MySQL Server (agent-instance.ini
) Configuration”
.
If the MySQL server to be monitored has been started using the command option --bind-address
then the server will only listen for connections on the IP address
specified, that is, the IP address of the MySQL server. If the service
agent has been started using TCP/IP networking and the default address
of 127.0.0.1 it will not be able to connect to the server to be
monitored. Also, if “localhost
” is specified
as the host name during agent configuration, a connection will not be
established, as the server will be listening for connections on the
address specified with the --bind-addressoption, not 127.0.0.1.
Specify the user credentials for the MySQL server that youwant to monitor:
MySQL Username []: service_agent
MySQL Password :
Re-enter :
Select whether you want to enable Query Analyzer. If youdisable the Query Analyzer during installation, you willneed to manually edit the configuration file to re-enablethe Query Analyzer functionality. If you enable QueryAnalysis (Proxy), you must specify the port on which theagent will listen for queries.
----------------------------------------------------------------------------
Query Analyzer Configuration
MySQL Proxy enables query monitoring and analysis by listening on a specified port for client connections that are then passed through to a backend MySQL database server. It is not needed for basic monitoring functionality.
Click here for more information.
[Y/n]:
Enable Proxy (recommended) [Y/n]:
Proxy Port [4040]:
Backend Host: 127.0.0.1 (cannot be changed)
Backend Port: 3306 (cannot be changed)
For more information on enabling Query Analyzer if youdisabled it during installation, seeChapter 9, The Query Analyzer Page
.
Enter the details of the MySQL Enterprise Service Manager that you want touse with this agent. The configuration information requiredis available within the installation report generated whenyou installed MySQL Enterprise Service Manager
----------------------------------------------------------------------------
MySQL Enterprise Monitor Options
Hostname or IP address []: 192.168.0.197
Tomcat Server Port [18080]:
Tomcat SSL Port [18443]:
The agent and MySQL Enterprise Service Manager support using SSL forcommunication. If you want to enable SSL communicationbetween the agent and the MySQL Enterprise Service Manager, you must replyY
to the following question.
Before installation starts, you will be provided with asummary of the installation settings that you havespecified:
Here are the settings you specified:
Installation directory: /opt/mysql/enterprise/agent
Monitored MySQL Database:
-------------------------
Hostname or IP address: 127.0.0.1
Port: 3306
MySQL username: mysql_user
MySQL password: password
Query Analyzer Configuration
-------------------------
Proxy Enabled: yes
Proxy Port: 4040
MySQL Enterprise Manager:
------------------------------
Hostname or IP address: 192.168.0.197
Tomcat Server Port: 18080
Tomcat SSL Port: 18443
Use SSL: 0
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
The installer will copy the necessary files and create theconfiguration file required to run the agent:
----------------------------------------------------------------------------
Please wait while Setup installs MySQL Enterprise Monitor Agent on your computer.
Installing
0% ______________ 50% ______________ 100%
#########################################
----------------------------------------------------------------------------
Info to start MySQL Agent
The MySQL agent was successfully installed. To start the MySQL Agent please
invoke:
/opt/mysql/enterprise/agent/etc/init.d/mysql-monitor-agent start
Press [Enter] to continue :
----------------------------------------------------------------------------
Setup has finished installing MySQL Enterprise Monitor Agent on your computer.
Finally, you can read the suppliedREADMEfile when prompted. The file isprovided within theshare/doc/README_en.txtfile within theagent installation directory if you would like to read thisfile separately.
For information on starting the agent, seeSection 2.5.3, “Starting/Stopping the Agent on Unix”
.