Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

We run your basic Master + Multi-slave mysql replication setup.

We would like to lower the MASTER_CONNECT_RETRY parameter on each of our slaves.

Is there anything beyond re-executing CHANGE MASTER TO ... on each of our slaves with the new connect_retry paramater (and of course MASTER_HOST, MASTER_USERNAME, etc etc, which will be the same) that we need to keep in mind?

As mentioned, this is an already running replication setup. All that we want to do is lower the MASTER_CONNECT_RETRY time.

Thanks.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

The number of times that the slave tries to connect to the master before giving up. Reconnects are attempted at intervals set by the --master-connect-retry option (or the MASTER_CONNECT_RETRY option of the CHANGE MASTER TO statement) and reconnects are triggered when data reads by the slave time out according to the --slave-net-timeout option. The default value is 86400. A value of 0 means “infinite”; the slave attempts to connect forever.

Slave-net-timeout --> The number of seconds to wait for more data from the master before the slave considers the connection broken, aborts the read, and tries to reconnect. The first retry occurs immediately after the timeout. The interval between retries is controlled by the CHANGE MASTER TO statement or --master-connect-retry option and the number of reconnection attempts is limited by the --master-retry-count option. The default is 3600 seconds (one hour).

So in conclusion you have to follow these steps in all slaves:

stop slave;
CHANGE MASTER TO MASTER_HOST = 'master_host',
MASTER_USER = 'user',
MASTER_PASSWORD = 'password',
MASTER_PORT = port,
MASTER_LOG_FILE = 'filename',
MASTER_CONNECT_RETRY=50;
start slave;
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.