Errno 1782 on MySQL replication - mysql

I have 3 servers configured with multi-source replication (my replication topology). It worked fine for 2 weeks, but now I getting error on a slave (server C at image):
Error executing row event: '##SESSION.GTID_NEXT cannot be set to ANONYMOUS when ##GLOBAL.GTID_MODE = ON.'
I tried to set GTID_NEXT/GTID_PURGED but it not worked.
Is possible to up this slave without reseting the master of server A (I reseted the master of server C)?
When I created the replication I setted AUTO_POSITION to 0, then if I get
the slave to run again the server C will read the missing log.
The version of MySQL is 5.7.17.

Add this line to my.cnf
slave-skip-errors = 1782

Related

MySQL daemon failed to start

MySQL won't restart when I try "service mysqld restart"because I'm using this part in my.cnf
master-host = [private-IP-of-db01]
master-user = [replication-username]
master-password = [replication-password]
master-connect-retry = 60
when I comment out these parts! MySQL restarts fine. Why is that so? Also I have to include these lines in my.cnf because of master slave replication and I can't omit them out.
Usually master host information on the slave mysql server is stored in "master.info" file and maintained there. You may want to start mysql without adding the configuration to your "my.cnf" file, the only configuration you may want to add is a "server_id" , Once mysql is up and running, you should setup slave with 'change master command....'.

Switch Master and Slave role in mysql

Mysql Server1 is running as MASTER. -- server id =1
Mysql Server2 is running as SLAVE. -- server id =2
Now DB replication is happening from MASTER to SLAVE.
Switch:
Now when I stop Slave on Server2 and Configure Server1 as Slave (by command CHANGE MASTER TO MASTER_HOST=') and start Slave on server1, the replication failed with below error:
Last_IO_Errno: 1593
Last_IO_Error: Fatal error: The slave I/O thread stops because master and slave have equal MySQL server ids; these ids must be different for replication to work (or the --replicate-same-server-id option must be used on slave but this does not always make sense; please check the manual before using it).
Im using MYSQL
Pls help as im new to MYSQL.

MySQL binary logs will not start

In-Short: My binary logs aren't starting even though log-bin is set and specified. I'm not sure how to fix it.
I have a MariaDB instance running as a service on windows that I am attempting to replicate to a MariaDB instance on a Ubuntu machine. I am using MySQL workbench 6.0 as much as I can to manage everything, and following the instructions from Oracle here for setting up master-slave replication: http://dev.mysql.com/doc/refman/5.0/en/replication-howto.html
I have made it to the fourth chapter, where I allegedly have the master and slave both configured, and I am about to read-lock the master tables for an initial data dump to the slave before I start up replication. So I flushed the tables with read lock and checked the master status:
FLUSH TABLES WITH READ LOCK;
SHOW MASTER STATUS;
That last line didn't return any binary log information. Checking further, I ran:
SHOW BINARY LOGS;
and an error message confirmed that:
Error Code: 1381. You are not using binary logging
Master Config is like this:
[mysqld]
datadir = "C:/mysql/data"
port=3306
sql_mode="STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION"
default_storage_engine=innodb
innodb_buffer_pool_size=1535M
innodb_log_file_size=50M
feedback=ON
innodb_flush_log_at_trx_commit = 1
sync_binlog = 1
log-bin-index = "C:/mysql/logs/log-bin.index"
log-bin=mysql-bin
server-id=1
innodb_flush_log_at_trx_commit=1
[client]
port=3306
How do I make sure the binary logs are rolling so I can continue with this?

Setting up MySQL master - master replication

I currently have one master server and want to add another master server for fail over.
On the primary server I've added the following to "my.ini"
server-id = 1
replicate-same-server-id = 0
auto-increment-increment = 2
auto-increment-offset = 1
log_bin=mysql-bin
log_error=mysql-bin.err
binlog_do_db=1
binlog_do_db=2
binlog_do_db=3
binlog_do_db=4
Once adding:
master-host = [IP]
master-user = [usernameslaveuser]
master-password = [password]
master-connect-retry = 30
The mysql server no longer starts up...
So I decided to first get the secondary server to work properly.
Problem 2:
On the new server I've copied over my user files from the "data"/mysql dir of the primary.
I've also imported all databases with MySQL work bench.
Then I added this to "my.ini":
server-id=2
replicate-same-server-id = 0
auto-increment-increment = 2
auto-increment-offset = 2
master-host = [IP]
master-user = [usernameslaveuser]
master-password = [password]
master-connect-retry = 30
log_bin=mysql-bin
log_error=mysql-bin.err
binlog_do_db=1
binlog_do_db=2
binlog_do_db=3
binlog_do_db=4
The server starts up fine, so I decided to add a table inside a replicating database on the master but the changes where not copied over to the secondary server...
I googled a bit and found that I have to run some commands in the mysql command line to make replication work.
But when I open this on the secondary server it doesn't start...
When opening it in the command prompt it says mysql.exe: unknown variable 'server-id=2"
Both servers are running Windows Server 2012 R2 and have MySQL 5.6.15 64bit installed.
Can someone guide me true the last part of setting this up?
Specifying as below in my.cnf(linux) or my.ini(windows) file is no longer supported in latest versions of MySQL
master-host = [IP]
master-user = [usernameslaveuser]
master-password = [password]
master-connect-retry = 30
You should execute this query instead:
CHANGE MASTER TO MASTER_HOST='host name/ip',MASTER_USER='user',MASTER_PASSWORD='pwd', MASTER_PORT=3306, MASTER_CONNECT_RETRY=30;
I've resolved problem 2: I wasn't putting it in the mysqld part but in the mysql part of the my.ini
Resolved problem 1: had to run it in the MySQL command line.

MySQL master-slave after crash

Here's the scenario:
I have one MySQL Master and 1 slave.
master-slave replication is set and works perfectly.
The slave machine crashes.
The master machine is still up and running.
Nothing changes in the master DB.
I start the slave machine again.
I start the slave MySQL DB.
Do I need to invoke "start slave" again on the slave DB ?
10x.
I believe the slave will start automatically unless you have skip-slave-start in your my.cnf.
Run 'SHOW SLAVE STATUS' and see what it says.
In master, check the status of the master and see it shows slave is running or not.
Goto slave machine and restart(stop & start) the slave machine.
Repeat the step 1 to check again