Here's how I setup my test environment:
1. I copy a "fresh" data directory into N locations.
shell# cat createtestenv.sh
#!/bin/sh
echo -n "Setting up fresh mysqld_multi setup..."
cp -R /var/lib/mysqlfresh /var/lib/mysql
cp -R /var/lib/mysqlfresh /var/lib/mysql2
cp -R /var/lib/mysqlfresh /var/lib/mysql3
chown -R mysql:mysql /var/lib/mysql*
echo " done."
echo -n "Starting fresh mysqld instances..."
/etc/init.d/mysql start
echo " done."
2. I install the MEM service manager.
echo
echo "### Beggining MEM install: `date`"
echo
echo -n "Installing monitor..."
/root/mysqlmonitor.bin --mode "unattended" --unattendedmodeui "minimal" \
--installdir "/opt/mysql/enterprise/monitor" --adminuser "manager" \
--adminpassword "manager"
--installdir "/opt/mysql/enterprise/monitor" --adminuser "manager" \
--adminpassword "manager"
echo " done."
3. I install the Agent in one of two ways.
#echo -n "Installing agent in host-only mode..."
# Install Agent in host only mode
#/root/mysqlmonitoragent.bin --mode "unattended" --unattendedmodeui "minimal" \
#--agent_installtype "standalone" --managerhost "localhost" --managerport 18443 \
#--agentuser "agent" --agentpassword "agent"
#--agent_installtype "standalone" --managerhost "localhost" --managerport 18443 \
#--agentuser "agent" --agentpassword "agent"
echo -n "Installing agent in 'phone home' mode..."
# Install Agent in "phone home" mode, to enable auto monitoring
/root/mysqlmonitoragent.bin --mode "unattended" --unattendedmodeui "minimal" \
--mysqlhost "localhost" --mysqlport 3306 --managerhost "localhost" \
--mysqluser "root" --mysqlpassword "root" --managerport 18443 --agentuser "agent" \
--agentpassword "agent" --generaluser "matt" --generalpassword "matt" \
--limiteduser "sid" --limitedpassword "sid" --agent_autocreate 1 \
--mysqlconnectiongroup "Production"
--mysqlhost "localhost" --mysqlport 3306 --managerhost "localhost" \
--mysqluser "root" --mysqlpassword "root" --managerport 18443 --agentuser "agent" \
--agentpassword "agent" --generaluser "matt" --generalpassword "matt" \
--limiteduser "sid" --limitedpassword "sid" --agent_autocreate 1 \
--mysqlconnectiongroup "Production"
/etc/init.d/mysql-monitor-agent start > /dev/null 2>&1
echo " done."
echo
echo "### Ending MEM install: `date`"
echo
This demonstrates how you can use the unattended installation methods to easily script the installation and setup of the MEM Service Manager and the Agent. You can also then configure the Service Manager so that it will automatically begin monitoring any of the Agents that "phone home" (my own likely annoying terminology). You would do that using the MySQL Process Discovery Advisor. You can see a screenshot of where that's done below:
Using these methods you can have a MEM Agent installed and set up on any new machine that gets created and have it automatically reach out to the Service Manager. Then the Service Manager can begin monitoring that Agent and the associated MySQL instance using the default credentials specified.
I hope that this is helpful! Several people have asked me about how I set things up for my own testing and demos, so I wanted to share.
Thank you for using MySQL!
No comments:
Post a Comment