Wednesday 11 September 2013

Enterprise Monitor-ing the Raspberry Pi & MySQL Cluster

So, now I've got my Raspberry Pi's tested, and running MySQL Cluster we'll need some form of checking it's up and running, as with the rest of our MySQL servers.

Monitoring via a Remote Agent

First issue, of course, is that, with my existing MEM console, I have no need to re-install MEM, but rather want to deploy an agent so that I can monitor the MySQL Cluster.
This poses it's first problem, as there isn't an ARM-ready agent software available. Remember, it's not a supported platform. So what can we do? Setup a remote Enterprise Monitor agent, so that, we can monitor the MySQL Cluster, albeit at the sacrifice of not having the agent local on each Raspberry Pi, and hence, not be able to capture the o.s. data.

Config change

So, on my Ubuntu server, I go to the agent install directory:

  cd /opt/mysql/enterprise/agent/etc
  vi mysql-mypi01-agent.ini
  :1,$ s/ol63uek01/mypi01/g

  # Proxy Parameters
  proxy-address=:3317
  proxy-backend-addresses = mypi01:3306


We've changed the proxy port so that it's unique on the MEM server.

Also need to change the agent-uuid for this remote agent:
First, generate a new UUID:
  /opt/mysql/enterprise/agent/bin/mysql-proxy --plugins=agent --agent-generate-uuid
  a5e420b3-02d5-4000-ad6f-faeb9f9b80a4
And replace the agent-uuid entry in mysql-mypi01-agent-ini.

Now for the directory structure and details needed to connect to the sqlnode:
  cp -r instances-ol6uek01 instances-mypi01
  cd instances-mypi01/agent
  vi agent-instance.ini


This reminds us to create the memagent user on each sqlnode.
Go on.. do it, on both mypi01 & mypi02:
  grant all on *.* to 'memagent'@'141.144.12.45' identified by 'oracle';
And test it too, from ubuvlc01:
  mypi01:  mysql -umemagent -poracle -h141.144.12.41 -P3306
  mypi02:  mysql -umemagent -poracle -h141.144.12.40 -P3306

Ok.

Now, repeat the same steps for mypi02.
  cp mysql-mypi01-agent.ini mysql-mypi02-agent.ini
  vi mysql-mypi02-agent.ini
  :1,$ s/mypi01/mypi02/g
  # Proxy Parameters
  proxy-address=:3318
  proxy-backend-addresses = 141.144.12.40:3306


  /opt/mysql/enterprise/agent/bin/mysql-proxy --plugins=agent --agent-generate-uuid
  2013-09-11 10:43:54: (critical) plugin agent 2.3.12.2174 started
  052fcb7b-89e7-4b16-8b66-7475c40a2b0f

  vi mysql-mypi02-agent.ini
Change the agent-uuid entry.

Now the directory structure:
  cp -r instances-mypi01 instances-mypi02
  cd instances-mypi02/agent/
  vi agent-instance.ini

And change the IP address so it connects to mypi02, and not mypi01.

We've create the users and confirmed remote access.
Now, to start them both up.

Remote Agent Startup

On the ubuntu server:
mypi01 agent:
  /opt/mysql/enterprise/agent/etc/init.d/mysql-monitor-agent start /opt/mysql/enterprise/agent/etc/mysql-mypi01-agent.ini
  Starting MySQL Enterprise agent service...
   *

mypi02 agent:
  /opt/mysql/enterprise/agent/etc/init.d/mysql-monitor-agent start /opt/mysql/enterprise/agent/etc/mysql-mypi02-agent.ini
  Starting MySQL Enterprise agent service...
   *

Double checking:
  ps -ef | grep agent | grep mypi
root     11488     1  0 10:47 ?        00:00:00 /opt/mysql/enterprise/agent/libexec/mysql-monitor-agent --defaults-file=/opt/mysql/enterprise/agent/etc/mysql-mypi01-agent.ini --daemon --pid-file=/opt/mysql/enterprise/agent/mysql-mypi01-agent.pid
root     11489 11488  0 10:47 ?        00:00:00 /opt/mysql/enterprise/agent/libexec/mysql-monitor-agent --defaults-file=/opt/mysql/enterprise/agent/etc/mysql-mypi01-agent.ini --daemon --pid-file=/opt/mysql/enterprise/agent/mysql-mypi01-agent.pid
root     11576     1  0 10:50 ?        00:00:00 /opt/mysql/enterprise/agent/libexec/mysql-monitor-agent --defaults-file=/opt/mysql/enterprise/agent/etc/mysql-mypi02-agent.ini --daemon --pid-file=/opt/mysql/enterprise/agent/mysql-mypi02-agent.pid
root     11577 11576  1 10:50 ?        00:00:00 /opt/mysql/enterprise/agent/libexec/mysql-monitor-agent --defaults-file=/opt/mysql/enterprise/agent/etc/mysql-mypi02-agent.ini --daemon --pid-file=/opt/mysql/enterprise/agent/mysql-mypi02-agent.pid


Now check the MEM dashboard.

On the dashboard, now refreshed, we can see both servers mypi01 & mypi02.
Let's create their own group:
- Go to Settings tab - Manage Servers - Create Group button "RaspberryPiCluster"
- Add both servers by passing the mouse over the down-pointing arrow, "add to group" and select both servers.
Go back to the Monitor tab, and click on the RaspberryPiCluster group.

MySQL Enterprise Monitor with the Raspberry Pi MySQL Cluster group added.

Now we can see them specifically, let's enable the Cluster-specific advisor for this group.
- Go to Advisors tab - Add to Schedule - click on the "Cluster (10)" top level box, and then hit the "schedule" button just under "Current Schedule". Accept the default frequency, and we're now collecting cluster data.

with the Cluster specific Advisor enabled.




If we kill both ndbd processes on the datanodes, and then go back to the Monitor tab, we can see that it's providing Critical Eents on the first page, that "Cluster Has Stopped / Nodes Not Running"

Showing the Cluster down / stopped events.
Ok, so we're seeing some Cluster info on MySQL Enterprise Monitor 2.3.12.


to be continued...

No comments:

Post a Comment