Error code [1290]; The MySQL server is running with the --read-only option

Asked by Mathiselvan

Hi,

We have a MMM setup as below.

MMMHOST-01 (Monitor node)
MMMDB-01 (agent node - db1)
MMMDB-02 (agent node - db2)

MMMDB-01 and MMMDB-01 are the db servers with Master-Master replication and MMMHOST-01 is the MMM Monitor server.

Recently we got the error message in the app logs as below and the order has not been placed in the database servers.

SQL state [HY000]; error code [1290]; The MySQL server is running with the --read-only option so it cannot execute this statement;
nested exception is java.sql.SQLException: The MySQL server is running with the --read-only option so it cannot execute this statement

On that time, the db1 was connected as active node.

Please can you help us to fix this issue.

Thanks,
Mathiselvan M.

Question information

Language:
English Edit question
Status:
Answered
For:
mysql-mmm Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Kenny Gryp (gryp) said :
#1

In MMM, you will have a master-master replication setup, but only one server will have the writer role. In MySQL replication it is very easy to cause a split brain situation if you would write to 2 nodes at the same time. That's why it's limited. It will almost never be recommended.

So only the server with the writer role can be allowed to accept writes. The passive master will have the setting read_only set to 1.

Kenny

On 01 Jul 2013, at 18:16, Mathiselvan <email address hidden> wrote:

> New question #231694 on mysql-mmm:
> https://answers.launchpad.net/mysql-mmm/+question/231694
>
> Hi,
>
> We have a MMM setup as below.
>
> MMMHOST-01 (Monitor node)
> MMMDB-01 (agent node - db1)
> MMMDB-02 (agent node - db2)
>
> MMMDB-01 and MMMDB-01 are the db servers with Master-Master replication and MMMHOST-01 is the MMM Monitor server.
>
> Recently we got the error message in the app logs as below and the order has not been placed in the database servers.
>
> SQL state [HY000]; error code [1290]; The MySQL server is running with the --read-only option so it cannot execute this statement;
> nested exception is java.sql.SQLException: The MySQL server is running with the --read-only option so it cannot execute this statement
>
> On that time, the db1 was connected as active node.
>
> Please can you help us to fix this issue.
>
> Thanks,
> Mathiselvan M.
>
> --
> You received this question notification because you are a member of
> mysql-mmm-core, which is an answer contact for mysql-mmm.

Revision history for this message
Mathiselvan (mathiselvan-mathiyalagan) said :
#2

Thanks for your prompt response Kenny.

Our application hosts are designed to connect only to DNS name called 'dbhost' which will be derived to a VIP.

The VIP is referred to one of the database hosts between db1 or db2 through the MMM Monitor server.

Also these errors were collected only from the app level and we have not tried connecting the database servers directly.

Can you please help me to identify the cause for this issue.

Thanks,
Mathiselvan M.

Revision history for this message
Kenny Gryp (gryp) said :
#3

Well, this error would be gotten if you try to write to a passive master. either the 'dbhost' is not pointing to the VIP which has the writer role or MMM has failed to set read_only=0 due to permissions/configuration problem.

I would also like to mention that MMM does not have any support anymore these days. there is no development happening for years and usage is dropping heavily as alternatives have popped up.

I would recommend looking at alternatives:

.. [#] http://www.mysqlperformanceblog.com/2012/06/08/percona-replication-manager-prm-documentation-available-beta/
.. [#] http://code.google.com/p/mysql-master-ha/
.. [#] http://www.percona.com/software/percona-xtradb-cluster

Kenny

On 01 Jul 2013, at 18:36, Mathiselvan <email address hidden> wrote:

> Question #231694 on mysql-mmm changed:
> https://answers.launchpad.net/mysql-mmm/+question/231694
>
> Status: Answered => Open
>
> Mathiselvan is still having a problem:
> Thanks for your prompt response Kenny.
>
> Our application hosts are designed to connect only to DNS name called
> 'dbhost' which will be derived to a VIP.
>
> The VIP is referred to one of the database hosts between db1 or db2
> through the MMM Monitor server.
>
> Also these errors were collected only from the app level and we have not
> tried connecting the database servers directly.
>
> Can you please help me to identify the cause for this issue.
>
> Thanks,
> Mathiselvan M.
>
> --
> You received this question notification because you are a member of
> mysql-mmm-core, which is an answer contact for mysql-mmm.

Can you help with this problem?

Provide an answer of your own, or ask Mathiselvan for more information if necessary.

To post a message you must log in.