Quantcast
Channel: MySQL Forums - Replication
Viewing all 1561 articles
Browse latest View live

Auto-Advancing Master Bin-Log Position (1 reply)

$
0
0
Hello,

Are there any trivial MySQL commands that can be run on a master in order to advance its MySQL binary log position?

I intend to use the command as a heartbeat to slaves (the built-in heartbeat functionality seems to degrade as more slaves connect to the master), and I've been using a dummy event of the form:

CREATE EVENT mysql.keep_alive ON SCHEDULE EVERY 60 SECOND DO DROP DATABASE IF EXISTS keep_alive;

But this command writes an Event Scheduler note to both the MySQL *.err file and Windows Event Viewer.

I was wondering if there was a cleaner way to do it without affecting the event logs. I'm currently using version:

mysql Ver 14.14 Distrib 5.5.25a, for Win64 (x86)

Thanks!

Replication not working (no replies)

$
0
0
Hi,

I am following these steps for a master slave replication but it does not seem to work. When I check the slave and run this SHOW SLAVE STATUS\G I get the out put that its connected to the master. When when I check the same on the master it shows empty..

1.3 Perform the following task on mysql 1 & 2:
1.3.1 Install MySql-server
> sudo apt-get install mysql-server mysql-client
1.3.2 General MySql configuration
Open the my.cnf
> sudo vim /etc/mysql/my.cnf
Look for the line bind-address.. and comment it to allow all network to connect to it
#bind-address = 127.0.0.1
1.3.3 MySql Master configuration
Open the my.cnf
> sudo vim /etc/mysql/my.cnf
Uncomment the following line
server-id = 1
log_bin = /var/lib/mysql/log-bin.log
binlog_do_db = “database name”
Restart MySql
> sudo /etc/init.d/mysql restart
1.3.4 Grant privileges to slave for replication(to be done on master)
> mysql -u root -p
> GRANT REPLICATION SLAVE ON *.* TO 'root'@'%' IDENTIFIED BY 'password';
> FLUSH PRIVILEGES;
Switch to the database you want to replicate
> USE “database name”;
> FLUSH TABLES WITH READ LOCK;
> SHOW MASTER STATUS;
Out put
+----------------+----------+------------------+------------------+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+----------------+----------+------------------+------------------+
| log-bin.000001 | 107 | “database name” | |
+----------------+----------+------------------+------------------+
1 row in set (0.00 sec)
Unlock the tables:
> UNLOCK TABLES;
> Exit
1.3.5 MySql Slave configuration
Open the my.cnf
> sudo vim /etc/mysql/my.cnf
Look for the following line and uncomment it:
server-id = 1
And replace it with:
server-id = 2
relay-log = /var/lib/mysql/relay-log-bin.log
log_bin = /var/lib/mysql/log-bin.log
expire_logs_days = 10
max_binlog_size = 100M
binlog_do_db = “database name”
Restart MySql
> sudo /etc/init.d/mysql restart
Log into MySql shell:
> mysql -u root -p
Execute the following lines to set the master
> CHANGE MASTER TO MASTER_HOST='IP',MASTER_USER='user-name', MASTER_PASSWORD='password', MASTER_LOG_FILE='log-bin.000002', MASTER_LOG_POS= 107;
Start the slave:
> START SLAVE;
Check status of the slave:
> SHOW SLAVE STATUS\G
If there is an issue in connecting, you can try starting slave with a command to skip over it:
> SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1; SLAVE START;

howto add a slave in a master-mater replication (no replies)

$
0
0
Hi,

I have to add a slave on an environment with a master - master replication.
I guess the slave have to register both servers.

How to do this ?

Thanks
Jean-Luc

Negative Slave performance results with 5.6 multithread worker slaves (no replies)

$
0
0
Hi,

We are testing MySql 5.6 replication multithread slave feature in local environment. We have observed that negative performance results. Test case details as follows:

Case 1:
1. Setup the Master/Slave replication with 3 databases with one table (db import, slave setup etc..)
2. stop the slave and in master update the 10K records in each table in each database parallelly
3. Once the updates are done in master, start the slave with single thread
4. Time taken to update the data in slave is 53 sec

Case 2:
1. Setup the Master/Slave replication with 3 databases with one table (db import, slave setup etc..)
2. stop the slave and in master update the 10K records in each table in each database parallelly
3. Once the updates are done in master, start the slave with 3 worker threads
4. Time taken to update the data in slave is 109 sec


We are expected that case2 should take less time than case 1 but results are different.
We have tried above test cases numerous iterations but found negative results.
Note: In Case1 and Case2 all configs are same except multiple worker threads.


Thank you in advance.

Replication down after disabling / enabling network card adapter (1 reply)

$
0
0
Hi All,

Here is my problem.

Environment :

- 2 virtual machine on vSphere
- MySQL Server 5.6

Prerequisite :

- MySQL replication has been correctly set and is working both ways (primary <-> secondary)

Scenario :

1. On the primary server, disable the network card adapter (Control Panel\Network and Internet\Network Connections)
2. Wait for 60 seconds
3. On the primary server, enable the network card adapter

Result : The MySQL replication is not working anymore (primary -> secondary and inversely). However, the MySQL logs shows that the replication has been resumed correctly (the file and postion are correct) :

Error reading packet from server: Lost connection to MySQL server during query ( server_errno=2013)
Slave I/O thread: Failed reading log event, reconnecting to retry, log 'mysql-bin.000001' at position 1837
Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual f [truncated, 276 bytes total]
Slave I/O: error reconnecting to master 'replication@10.10.0.1:3306' - retry-time: 60 retries: 1, Error_code: 2003
Slave I/O: error reconnecting to master 'replication@10.10.0.1:3306' - retry-time: 60 retries: 2, Error_code: 2003
Slave I/O: error reconnecting to master 'replication@10.10.0.1:3306' - retry-time: 60 retries: 3, Error_code: 2003
Slave: connected to master 'replication@10.10.0.1:3306',replication resumed in log 'mysql-bin.000001' at position 1837

Expected result : The MySQL replication is still working

Note :

- If I disable / enable the network card directly in vSphere, the MySQL replication is still working
- If I use a physical machine and unplug / plug the network cable, the MySQL replication is still working

Does anyone has the same issue? Could you please help me to solve this?

Thank you,

Geographically Distributed Multi-Master MySQL Clusters (no replies)

$
0
0
In this webinar, we discuss the multi-master capabilities of Continuent Tungsten to help you build and manage systems that spread data across multiple sites.

We cover important topics such as setting up large scale topologies, handling failures, and how to handle data privacy issues like removing personally identifiable information or handling privacy law restrictions on data movement. We will conclude with a live demonstration of a distributed MySQL solution with Continuent Tungsten clusters working across multiple Amazon Web Services (AWS) availability zones and regions.

Thursday, April 24 @ 1 pm ET/10 am PT
Register at https://www1.gotomeeting.com/register/286556528

replication crashes (no replies)

Replication question (direction issue and wan) (5 replies)

$
0
0
Hi all,

I have a question on how to implement replication

I need to collect data from multiple servers that are behind various firewalls so i cannot pull it. I have to push the data.

Next - I will be pushing 1 table form each database - into 1 database where each table will be prefixed with server id - is this possible - many DB's to 1 DB with many tables

Third - can i secure the replication over wan with ssh connection?

is the "collector" a slave in this case and each other server pushing still a master ?

replication error (no replies)

$
0
0
Hi

I have setup the mysql master slave replication. I have mysql Server version: 5.1.73.

now since last six month my replication broken two times. now I would like to diagnosh due to which reason it was broken.

Please guide so I can avoid the replication broken in future.

Error is just like

Last_Errno: 1062
Last_Error: Error 'Duplicate entry '1833' for key 'PRIMARY'' on query. Default database: 'Ahm_123'. Query: 'INSERT INTO
random_number_link(sessionid,randomid,link_detail)
VALUES
('1398433792135510.174655936795116','54018613984341521402079986852460','coded_type=coded')'

Setup & Operate Tungsten Replicator (no replies)

$
0
0
Webinar, Thursday 5/15
Register at https://www1.gotomeeting.com/register/663349769


Tungsten Replicator is an innovative and reliable tool that can solve your most complex replication problems. In this webinar we will introduce replicator installation and show you how to use key replicator features effectively with MySQL.

Course Topics:
• Checking host and MySQL prerequisites
• Downloading code from http://code.google.com/p/tungsten-replicator/
• Installation using the tpm utility
• Transaction filtering using standard filters as well as customized filters you write yourself
• Enabling and managing parallel replication
• Configuring multi-master and fan-in using multiple replication services
• Backup and restore integration
• Troubleshooting replication problems
• Logging bugs and participating in the Tungsten Replicator community.

Replication is a powerful technology that takes knowledge and planning to use effectively. This webinar gives you the background that makes replication easier to set up and allows you to take full advantage of the Tungsten Replicator benefits.

https://www1.gotomeeting.com/register/663349769

Is Master to Master (Multi Master) Replication Suported? (no replies)

$
0
0
I have been reading the MySQL 5.5 documentation regarding Replication and it only seems to support Master/slave replication. Though in the Forums section, there are links to outside articles on setting up Multi Master replication using MySQL. Is this is supported functionality of 5.5 and if so, why is it not docuumented in the MySQL documentation?

Thanks

checksum table not always matching on same server version (1 reply)

$
0
0
Hi

We've been looking at using a mysql server for general user access and a replica of that server for others to run long running queries on. The problem is that I want to ensure that the data is truly in-sync, so I wrote a script that goes through once a day and does a checksum on each table to see if they match.

I also lock the tables before doing a checksum.

Even though I've made sure that both systems are running the same version of mysql and the same OS version, while most of the tables match, a few don't.

And some of the few that don't really don't make sense as they are static tables that are never really updated, and if do an export of each table and run a diff on them they are the same, but somehow the mysql checksum table returns a different value for them.

Any ideas? Thanks in advance. I'd really like to use mysql for this project but this one issue is really preventing me from moving forward with it.

Steve

MySQL 5.6 startup issues with replication and server-id (1 reply)

$
0
0
Hi! I'm new here so please do forgive if this first post has some flaws. But, the situation shortly: I have a remote database with tons of measurement data, and I need to replicate that data for easier access. For historical reasons remote database is run on Ubuntu. Previous installation of Ubuntu (10.4, it had gone unnoticed) broke while updating and was in a hurry so installed 14.4 instead, with MySQL 5.6. Measurement environment is up and running, but for some reason I can't proceed with the replication process. And this might very well be an OS related issue as well, but suspected that I'd ask here first.

MySQL server (remote, Ubuntu 14.4, MySQL 5.6) starts without a glitch if nothing is touched, it starts without a glitch if I comment the line "bind-address 127.0.0.1". But, as soon as I uncomment the line "server-id=1" (local database, the destination of replication has server-id=2, it hasn't been touched), the server won't start.

There appears to be many warnings within error.log (/var/log/mysql/error.log) and some errors, but I'm guessing that the actual reason to prevent server from starting is that the TCP/IP-address is already in use? I've also tried to add "bind-address=ubuntu.server.ip.here" with the same results. It also seems like mysql is still being run (not stopping properly on sudo /etc/init.d/mysql stop/restart or sudo service mysql stop/restart), atleast sometimes.

Here is some output from the error.log from one of the times I tried the restart. That same list goes on and on, but as far as I can tell, it's always those same warnings and errors:

140507 14:56:04 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
140507 14:56:49 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
2014-05-07 14:56:49 0 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead.
2014-05-07 14:56:49 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2014-05-07 14:56:49 31378 [Warning] Buffered warning: Changed limits: max_open_files: 1024 (requested 5000)

2014-05-07 14:56:49 31378 [Warning] Buffered warning: Changed limits: table_cache: 431 (requested 2000)

2014-05-07 14:56:49 31378 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead.
2014-05-07 14:56:49 31378 [Note] Plugin 'FEDERATED' is disabled.
2014-05-07 14:56:49 31378 [ERROR] Function 'innodb' already exists
2014-05-07 14:56:49 31378 [Warning] Couldn't load plugin named 'innodb' with soname 'ha_innodb.so'.
2014-05-07 14:56:49 31378 [ERROR] Function 'federated' already exists
2014-05-07 14:56:49 31378 [Warning] Couldn't load plugin named 'federated' with soname 'ha_federated.so'.
2014-05-07 14:56:49 31378 [ERROR] Function 'blackhole' already exists
2014-05-07 14:56:49 31378 [Warning] Couldn't load plugin named 'blackhole' with soname 'ha_blackhole.so'.
2014-05-07 14:56:49 31378 [ERROR] Function 'archive' already exists
2014-05-07 14:56:49 31378 [Warning] Couldn't load plugin named 'archive' with soname 'ha_archive.so'.
2014-05-07 14:56:49 31378 [Note] InnoDB: Using atomics to ref count buffer pool pages
2014-05-07 14:56:49 31378 [Note] InnoDB: The InnoDB memory heap is disabled
2014-05-07 14:56:49 31378 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2014-05-07 14:56:49 31378 [Note] InnoDB: Compressed tables use zlib 1.2.8
2014-05-07 14:56:49 31378 [Note] InnoDB: Using Linux native AIO
2014-05-07 14:56:49 31378 [Note] InnoDB: Using CPU crc32 instructions
2014-05-07 14:56:49 31378 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2014-05-07 14:56:49 31378 [Note] InnoDB: Completed initialization of buffer pool
2014-05-07 14:56:49 31378 [Note] InnoDB: Highest supported file format is Barracuda.
2014-05-07 14:56:49 31378 [Note] InnoDB: 128 rollback segment(s) are active.
2014-05-07 14:56:49 31378 [Note] InnoDB: Waiting for purge to start
2014-05-07 14:56:49 31378 [Note] InnoDB: 5.6.17 started; log sequence number 1635381
^G/usr/sbin/mysqld: File '/var/log/mysql/mysql-bin.000027' not found (Errcode: 2 - No such file or directory)
2014-05-07 14:56:49 31378 [ERROR] Failed to open log (file '/var/log/mysql/mysql-bin.000027', errno 2)
2014-05-07 14:56:49 31378 [ERROR] Could not open log file
2014-05-07 14:56:49 31378 [ERROR] Can't init tc log
2014-05-07 14:56:49 31378 [ERROR] Aborting

2014-05-07 14:56:49 31378 [Note] Binlog end
2014-05-07 14:56:49 31378 [Note] Shutting down plugin 'partition'
2014-05-07 14:56:49 31378 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2014-05-07 14:56:49 31378 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2014-05-07 14:56:49 31378 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
2014-05-07 14:56:49 31378 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2014-05-07 14:56:49 31378 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2014-05-07 14:56:49 31378 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2014-05-07 14:56:49 31378 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2014-05-07 14:56:49 31378 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2014-05-07 14:56:49 31378 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2014-05-07 14:56:49 31378 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2014-05-07 14:56:49 31378 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2014-05-07 14:56:49 31378 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2014-05-07 14:56:49 31378 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2014-05-07 14:56:49 31378 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2014-05-07 14:56:49 31378 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2014-05-07 14:56:49 31378 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2014-05-07 14:56:49 31378 [Note] Shutting down plugin 'INNODB_METRICS'
2014-05-07 14:56:49 31378 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2014-05-07 14:56:49 31378 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2014-05-07 14:56:49 31378 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2014-05-07 14:56:49 31378 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2014-05-07 14:56:49 31378 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2014-05-07 14:56:49 31378 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2014-05-07 14:56:49 31378 [Note] Shutting down plugin 'INNODB_CMPMEM'
2014-05-07 14:56:49 31378 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2014-05-07 14:56:49 31378 [Note] Shutting down plugin 'INNODB_CMP'
2014-05-07 14:56:49 31378 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2014-05-07 14:56:49 31378 [Note] Shutting down plugin 'INNODB_LOCKS'
2014-05-07 14:56:49 31378 [Note] Shutting down plugin 'INNODB_TRX'
2014-05-07 14:56:49 31378 [Note] Shutting down plugin 'InnoDB'
2014-05-07 14:56:49 31378 [Note] InnoDB: FTS optimize thread exiting.
2014-05-07 14:56:49 31378 [Note] InnoDB: Starting shutdown...
2014-05-07 14:56:51 31378 [Note] InnoDB: Shutdown completed; log sequence number 1635391
2014-05-07 14:56:51 31378 [Note] Shutting down plugin 'BLACKHOLE'
2014-05-07 14:56:51 31378 [Note] Shutting down plugin 'ARCHIVE'
2014-05-07 14:56:51 31378 [Note] Shutting down plugin 'MyISAM'
2014-05-07 14:56:51 31378 [Note] Shutting down plugin 'CSV'
2014-05-07 14:56:51 31378 [Note] Shutting down plugin 'MRG_MYISAM'
2014-05-07 14:56:51 31378 [Note] Shutting down plugin 'MEMORY'
2014-05-07 14:56:51 31378 [Note] Shutting down plugin 'sha256_password'
2014-05-07 14:56:51 31378 [Note] Shutting down plugin 'mysql_old_password'
2014-05-07 14:56:51 31378 [Note] Shutting down plugin 'mysql_native_password'
2014-05-07 14:56:51 31378 [Note] Shutting down plugin 'binlog'
2014-05-07 14:56:51 31378 [Note] /usr/sbin/mysqld: Shutdown complete

140507 14:56:51 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
140507 14:57:36 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
2014-05-07 14:57:36 0 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead.
2014-05-07 14:57:36 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2014-05-07 14:57:36 32138 [Warning] Buffered warning: Changed limits: max_open_files: 1024 (requested 5000)

2014-05-07 14:57:36 32138 [Warning] Buffered warning: Changed limits: table_cache: 431 (requested 2000)

2014-05-07 14:57:36 32138 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead.
2014-05-07 14:57:36 32138 [Note] Plugin 'FEDERATED' is disabled.
2014-05-07 14:57:36 32138 [ERROR] Function 'innodb' already exists
2014-05-07 14:57:36 32138 [Warning] Couldn't load plugin named 'innodb' with soname 'ha_innodb.so'.
2014-05-07 14:57:36 32138 [ERROR] Function 'federated' already exists
2014-05-07 14:57:36 32138 [Warning] Couldn't load plugin named 'federated' with soname 'ha_federated.so'.
2014-05-07 14:57:36 32138 [ERROR] Function 'blackhole' already exists
2014-05-07 14:57:36 32138 [Warning] Couldn't load plugin named 'blackhole' with soname 'ha_blackhole.so'.
2014-05-07 14:57:36 32138 [ERROR] Function 'archive' already exists
2014-05-07 14:57:36 32138 [Note] InnoDB: Using atomics to ref count buffer pool pages
2014-05-07 14:57:36 32138 [Note] InnoDB: The InnoDB memory heap is disabled
2014-05-07 14:57:36 32138 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2014-05-07 14:57:36 32138 [Note] InnoDB: Compressed tables use zlib 1.2.8
2014-05-07 14:57:36 32138 [Note] InnoDB: Using Linux native AIO
2014-05-07 14:57:36 32138 [Note] InnoDB: Using CPU crc32 instructions
2014-05-07 14:57:36 32138 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2014-05-07 14:57:36 32138 [Note] InnoDB: Completed initialization of buffer pool
2014-05-07 14:57:36 32138 [Note] InnoDB: Highest supported file format is Barracuda.
2014-05-07 14:57:37 32138 [Note] InnoDB: 128 rollback segment(s) are active.
2014-05-07 14:57:37 32138 [Note] InnoDB: Waiting for purge to start
2014-05-07 14:57:37 32138 [Note] InnoDB: 5.6.17 started; log sequence number 1635391
2014-05-07 14:57:37 32138 [Note] Server hostname (bind-address): '*'; port: 3306
2014-05-07 14:57:37 32138 [Note] IPv6 is available.
2014-05-07 14:57:37 32138 [Note] - '::' resolves to '::';
2014-05-07 14:57:37 32138 [Note] Server socket created on IP: '::'.
2014-05-07 14:57:37 32138 [Note] Event Scheduler: Loaded 0 events
2014-05-07 14:57:37 32138 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.6.17-0ubuntu0.14.04.1' socket: '/var/run/mysqld/mysqld.sock' port: 3306 (Ubuntu)

I'm not that familiar with MySQL that could get a whole lot out of that. And this might very well be some newbie mistake, but this is the third day I'm fighting over this, and not even Google has been able to give any solution. So, please, help.

-Sami

Replication stops if master fails dropping a database with foreign key constraints (1 reply)

$
0
0
If master fails dropping a database with foreign key constraint, Slave stops due to foreign key constraint.

Steps to Reproduce:

1, Set up a master-slave replication

2, On master:
create database d;

create table d.t1(id INT NOT NULL AUTO_INCREMENT, f_id INT NOT NULL, PRIMARY KEY(id));
create table d.t2(id INT NOT NULL AUTO_INCREMENT, f_id INT NOT NULL, PRIMARY KEY(id));
create table d.t3(id INT NOT NULL AUTO_INCREMENT, f_id INT NOT NULL, PRIMARY KEY(id));

insert into d.t1(id, f_id) values(1,1);
insert into d.t2(id, f_id) values(1,1);
insert into d.t3(id, f_id) values(1,1);

alter table d.t1 add foreign key (f_id) references t2(id);
alter table d.t2 add foreign key (f_id) references t3(id);
alter table d.t3 add foreign key (f_id) references t1(id);

3, Go to the data directory of databse d on master, touch a file.

4, On master:
drop database d;

5, On slave:
show slave status\G

6, Error 'Cannot delete or update a parent row: a foreign key constraint fails' on query. Default database: 'd'. Query: 'DROP TABLE IF EXISTS `t1`,`t2`,`t3`'

I expect slave to successfully drop the database. But it does not. The fix of http://bugs.mysql.com/bug.php?id=2167 is related to this issue.

Maybe MySQL should disable foreign key check on slave for this case.

Slave Hangs on read lock (no replies)

$
0
0
Hi,
We're running MySQL Community Ver 14.14 Distrib 5.6.17 using row-based master/slave replication on Amazon's EC2 platform. Recently our slave has been getting hung up (replication stops, slave mysql won't cleanly shutdown) a few times a day when our snapshotting backup (ec2-consistent-snapshot) script runs, and I believe it's due to the script calling FLUSH LOCAL TABLES WITH READ LOCK which gets hung. SHOW PROCESSLIST shows the system user in a state of "Waiting for commit lock" - until I kill this process and restart, any calls to 'show slave status', 'stop slave' or the init shutdown script just hang and have to be cancelled.

This seems similar to the bug http://bugs.mysql.com/bug.php?id=68460, however it looks like it was fixed in 5.6.13, and we're on 5.6.17. The hanging processes started a few days ago when we started experiencing heavier-than-normal load on our master due to a migration script. I believe this load is contributing to the frequency of the hangups since prior to this we've only seen replication stop very infrequently. Our slave cnf config is below. Any help diagnosing this would be much appreciated!

----------------

[mysqld]
port=3306
socket=/var/run/mysqld/mysqld.sock
datadir="/data/mysql"
lower_case_table_names=1
default-storage-engine=INNODB
max_connections=400
query_cache_size=176M
table_open_cache=1520
tmp_table_size=63M
binlog-format=ROW
event_scheduler=ON
tmpdir=/data/mysql/temp

long_query_time=5
slow_query_log
log-queries-not-using-indexes

innodb_additional_mem_pool_size=11M
innodb_flush_log_at_trx_commit=1
innodb_support_xa=1
innodb_log_buffer_size=10M
innodb_buffer_pool_size=5000M
innodb_log_file_size=107M
innodb_thread_concurrency=10
innodb_file_per_table
innodb_autoextend_increment=200M
innodb_data_home_dir = "/data/mysql"
innodb_log_group_home_dir = "/data/mysql"
innodb_log_files_in_group = 2
max_allowed_packet=500M

#replication stuff
server-id=20
log-bin=1
show-slave-auth-info=1
expire_logs_days=7

#####################
# replica stuff
#####################
relay_log=/data/mysql/relay-bin
# stops slave threads from starting after a crash. Must restart slave process manually!
log_slave_updates
skip_slave_start
read_only

Replication Thread hangs on FLUSH TABLES WITH READ LOCK (no replies)

$
0
0
Hi,
I have a MySQL master/slave set up with row-based replication. At times of higher load we've been seeing replication halt and all slave thread activity commands just hang. STOP SLAVE, SHOW SLAVE STATUS, as well as the init.d stop script hang and never return. Replication is restored when I kill -9 the mysql process and restart.

I believe the hangups are being initiated by a FLUSH LOCAL TABLES WITH READ LOCK which is called by our backup snapshot script (ec2-consistent-snapshot) that is run every 2 hours. When things are in a hung state, SHOW PROCESSLIST shows 'Waiting for commit lock' - killing this command allows me to stop mysql cleanly, but it still requires a restart to get replication going again. I should also note that the ec2-consistent-snapshot script runs fine most of the time and only causes replication to break occasionally - for the last week it's broken about 5 times; randomly throughout the day.

I've seen this - http://bugs.mysql.com/bug.php?id=68460, however it states this bug was fixed in 5.6.13 and we're running 5.6.17.

MySQL Ver 14.14 Distrib 5.6.17 for Linux (x86_64)
Running on Amazon's m1.large linux distribution on EC2 with RAID0 EBS data volumes
slave cnf config below ->

--------------------------
port=3306
socket=/var/run/mysqld/mysqld.sock
datadir="/data/mysql"
lower_case_table_names=1
default-storage-engine=INNODB
max_connections=400
query_cache_size=176M
table_open_cache=1520
tmp_table_size=63M
binlog-format=ROW
event_scheduler=ON
tmpdir=/data/mysql/temp

long_query_time=5
slow_query_log
log-queries-not-using-indexes

innodb_additional_mem_pool_size=11M
innodb_flush_log_at_trx_commit=1
innodb_support_xa=1
innodb_log_buffer_size=10M
innodb_buffer_pool_size=5000M
innodb_log_file_size=107M
innodb_thread_concurrency=10
innodb_file_per_table
innodb_autoextend_increment=200M
innodb_data_home_dir = "/data/mysql"
innodb_log_group_home_dir = "/data/mysql"
innodb_log_files_in_group = 2
max_allowed_packet=500M

#replication stuff
server-id=20
log-bin=1
show-slave-auth-info=1
expire_logs_days=7

relay_log=/data/mysql/relay-bin
log_slave_updates
skip_slave_start
read_only

mysql replication (no replies)

$
0
0
Hello ,

I refreshed one database on one node of the cluster however the database should have been refresh automatically on other node but that didn't happen.Belwo stats is on node2


mysql> show slave status \G
*************************** 1. row ***************************
Slave_IO_State:
Master_Host: xx.xx.xx.xx
Master_User: repl
Master_Port: 3306
Connect_Retry: 10
Master_Log_File: mysql-bin.000031
Read_Master_Log_Pos: 758225577
Relay_Log_File: atdc-cxpussd07-lx02-relay-bin.000022
Relay_Log_Pos: 758225723
Relay_Master_Log_File: mysql-bin.000031
Slave_IO_Running: No
Slave_SQL_Running: Yes
Replicate_Do_DB:
Replicate_Ignore_DB: F5NLB
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 0
Last_Error:
Skip_Counter: 0
Exec_Master_Log_Pos: 758225577
Relay_Log_Space: 758225936
Until_Condition: None
Until_Log_File:
Until_Log_Pos: 0
Master_SSL_Allowed: No
Master_SSL_CA_File:
Master_SSL_CA_Path:
Master_SSL_Cert:
Master_SSL_Cipher:
Master_SSL_Key:
Seconds_Behind_Master: NULL
Master_SSL_Verify_Server_Cert: No
Last_IO_Errno: 1236
Last_IO_Error: Got fatal error 1236 from master when reading data from binary log: 'Client requested master to start replication from impossible position; the first event 'mysql-bin.000031' at 758225577, the last event read from '/mysql-logs/bin-log/mysql-bin.000031' at 4, the last byte read from '/mysql-logs/bin-log/mysql-bin.000031' at 4.'
Last_SQL_Errno: 0
Last_SQL_Error:
Replicate_Ignore_Server_Ids:
Master_Server_Id: 10
1 row in set (0.00 sec)


Best regards,
Vishal

How to get from a brittle MySQL replication system to a transparent, manageable Continuent Tungsten cluster (no replies)

$
0
0
Thursday, May 22nd
Register at https://www1.gotomeeting.com/register/116183801

In this live virtual course, you will learn how to get from a single database server to a scalable cluster, or from a brittle MySQL replication system to a transparent, manageable Continuent Tungsten cluster.

We discuss the benefits of leveraging Continuent Tungsten clustering with MySQL, and walk you through the steps to implement a Continuent Tungsten cluster in Amazon EC2. We cover the prerequisites, installing and configuring Continuent Tungsten, and best practices that are part of most production installations and proof-of-concepts.

Course Topics:

• Configuring MySQL and the OS for a proper Continuent Tungsten installation
• Installing a cross-site Continuent Tungsten cluster
• Online maintenance by performing a schema upgrade on the master database server with no application downtime (switch operation)
• Automatic master failover upon a MySQL database server failure
• Recovery of a failed master to a fully operational cluster member with a single command (recover operation)
• Disaster recovery by switching database operations to another data center or AWS region (geo-clustering, cross-site 'switch' operation)
• Multi-master operations across multiple geographic regions

We also discuss and demonstrate basic operations, such as adding and removing a cluster node, basic monitoring and troubleshooting, and discuss the basic failure scenarios. Learn how to quickly configure and provision highly optimized Continuent Tungsten deployments in the cloud or on-premises!

master -master replication issues error 1062 and 1677 (2 replies)

$
0
0
Hi,

Im facing issue in master-master replication failover.

1062 Error 'Duplicate entry '143' for key 'PRIMARY'' on query. Default database: 'commstree4'. Query: 'insert into profile_attachment (profile_id, file_id, type) values (55034, '408d1b90-a034-4b08-9a1e-e63d3ef5cfe5', 'cv')'

1677 error "Column 1 of table 'commstree4.COM_AUDIT_TRAIL' cannot be converted from type 'varchar(45)' to type 'varchar(30)'"

as a temporary fix i have made entry in my.cnf file

skip slave error = 1062
stop slave;
start slave;

but again 1677 occured.

so i made skip slave error = 1677 which doesnt fix the issue.

so made it as skip slave error = all even that doesnt fix it.

tried get global slave_type_conversions

mysql> show variables like "%slave_type%";
+------------------------+---------------+
| Variable_name | Value |
+------------------------+---------------+
| slave_type_conversions | ALL_LOSSY |
+------------------------+---------------+
1 row in set (0.00 sec)

mysql>

but no luck;

So reverted all replication setting from the server.

Please help me on this as this is urgent.

Replication setup (for the first time) (7 replies)

$
0
0
Hello!

Although I am a senior SQL Server DBA and have a good experience with SQL Server Replication and Oracle Golden Gate, now I have a mission to set up MySQL replication between two MySQL Servers 5.1.67 running on CENT OS 6.3.

After reading related sections from two MySQL books and numerous articles on web, I prepared my action plan as follows.

Here, I am sharing it with you and asking for your opinions for the plan. As this will be the first time for me to set up replication with these products, I thought you may be generous to share me your experiences and thoughts.

First, please let me tell you why I did not prefer mysqldump but copying database files, because I do not have enough disk space for an extra operation. Also, downtime is not that important for this environment. I've got a 10 hours of maintenance window for this operation.

Please keep in mind that I have had absolutely no experience with Linux and MySQL before this week =)

In advance, thank you for your time!

I.Configure Master

1. edit /etc/mysql/my.cnf. Enable networking for MySQL,

#skip-networking

2. Add the following lines to the my.cnf

server-id = 1
log-bin=binlog
expire-logs-days=5
sync_binlog = 1

3. restart mysql
$ /etc/init.d/mysqld restart

4. log into the MySQL database as root and create a user with

replication privileges:

mysql> GRANT REPLICATION SLAVE ON *.* TO repl_user IDENTIFIED BY 'xxx';
mysql>FLUSH PRIVILEGES;

5. At this point, for the sake of consistency, I am locking tables.

mysql> FLUSH TABLES WITH READ LOCK;
mysql> SHOW MASTER STATUS;

NOTE: Keep this prompt running in order for lock to be ACTIVE

e.g.

mysql> SHOW MASTER STATUS;
+——————–+———–+————–+——————+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB

|
+——————–+———–+————–+——————+
| FLTVM01-bin.000051 | 444132144 | |

|
+——————–+———–+————–+——————+
1 row in set (0.00 sec)

6. Shut down mysqld to provide consistency during copy operation

$ /etc/init.d/mysqld stop

7. Copy Database files from Master to Slave

-- I am not sure if I better use z parameter for compression or not?
$ rsync -hrtplz --rsh='ssh -p22579' --progress /var/lib/mysql root@SLAVE.domain.com:/var/lib

8. Rename the copied "mysql" system database in the SLAVE as "mysql_master" and then copy the original mysql. -- I am not sure if I better preserving the old one too? Do you think so? With this configuration, is mysql db replicated?

$ cd /var/lib/mysql
-- This is the mysql db came from MASTER
$ mv mysql mysql_master
$ cd ..
-- This mysql db belongs to the original installation on SLAVE
$ scp -r /var/lib/mysql_OLD/mysql /var/lib/mysql


II. Configure Slave

1. Stop mysqld

$ /etc/init.d/mysqld stop

2. Configure Slave configuration

server-id=2
master-host=MASTER.domain.com
master-user=repl_user
master-password=xxx
master-connect-retry=60

3. Start mysqld

$ /etc/init.d/mysqld start

4. Issue command Slave Stop and Change master

mysql> SLAVE STOP;
mysql> CHANGE MASTER TO MASTER_HOST='MASTER.domain.com', MASTER_USER='repl_user', MASTER_PASSWORD=’xxx’, MASTER_LOG_FILE='<LOG FILE>', MASTER_LOG_POS=<POS>;

6. Start Slave

mysql> START SLAVE;

7. Check for errors
#tail -f /var/log/mysqld.log

III. CHECKING & TESTING

status of the master can be known from mysql prompt:

mysql> SHOW MASTER STATUS;

and slave can be known by:

mysql> SHOW SLAVE STATUS;
Viewing all 1561 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>