Running Multiple Instances via MXJ / MBean
Posted by: Andrew Rubinger
Date: March 07, 2007 02:27PM

In that our Java-based application is replication-aware, we would like to run 3 instances of MySQL (Master, Slave1, Slave2) on our developers' local machines.

We're currently starting MySQL as a JMX MBean as part of the container's "start" lifecycle such that the DB launching process is completely transparent to the deployment.

To add additional instances, I'd expect to make additional MBeans, changing the datadir, pid-file, port, binary log, server-id, and some other properties as required.

However, when attempting to change the datadir (to make separate data directories for each instance), I receive:

15:21:53,843 WARN [ServiceController] Problem creating service mysql:type=service,name=mysqld
java.lang.IllegalArgumentException: C:\[theNewPathISpecified]\mysql not equal to C:\Documents and Settings\[myUsername]\Local Settings\Temp\mysql-c.mxj

How can I override these properties? Has anyone launched many instances of MySQL on one machine via the MBean before?

If I were to create my own MBean implementation, could I manually pass (and override) these properties to MysqldResource, or is the source of the error deeper than the MBean implementation class?

Thanks in advance. :)


PS - Example JBoss *-service.xml MBean Configuration:

<?xml version="1.0" encoding="UTF-8"?>
<mbean code=""
<attribute name="autostart">true</attribute>
<attribute name="port">3306</attribute>
<attribute name="basedir">${}${file.separator}mysql</attribute>
<attribute name="datadir">${}${file.separator}mysql${file.separator}data${file.separator}master</attribute>
<attribute name="pid-file"></attribute>

Options: ReplyQuote

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.