Quantcast
Channel: StackExchange Replication Questions
Viewing all 17268 articles
Browse latest View live

mariadb : Relay log write failure

$
0
0

I am currently trying to get a MariaDB 10.2.9 to run as a slave of a mysql 5.5 master but i keep getting the same error (Last_IO_Errno: 1595, Relay log write failure: could not queue event from master)

As there is some difference in version between master and slave i had to set

set global binlog_checksum='NONE';

All in all i took a mysqldump of the master, read the log_pos/file and

SET GLOBAL server_id=2;
CHANGE MASTER TO 
MASTER_HOST='10.145.46.11',MASTER_USER='replicant',MASTER_PASSWORD='...', 
MASTER_LOG_FILE='mysql-bin.000042', MASTER_LOG_POS=107;
start slave;

But the IO Thread simply wont start, the mariadb.log says:

...
2017-10-31 11:44:41 140026338711296 [Note] Slave SQL thread initialized, starting replication in log 'mysql-bin.000007' at position 107, relay log './mariadb-relay-bin.000001' position: 4
2017-10-31 11:44:41 140027007977216 [Note] Slave I/O thread: connected to master 'replicant@10.145.46.11:3306',replication started in log 'mysql-bin.000007' at position 107
2017-10-31 11:44:42 140027007977216 [Warning] Slave I/O: Notifying master by SET @master_binlog_checksum= @@global.binlog_checksum failed with error: Unknown system variable 'binlog_checksum', Internal MariaDB error code: 1193
2017-10-31 11:44:42 140027007977216 [ERROR] Slave I/O: Replication event checksum verification failed while reading from network, Internal MariaDB error code: 1743
2017-10-31 11:44:42 140027007977216 [ERROR] Slave I/O: Relay log write failure: could not queue event from master, Internal MariaDB error code: 1595
2017-10-31 11:44:42 140027007977216 [Note] Slave I/O thread exiting, read up to log 'mysql-bin.000007', position 107
....

I am also not sure what kind of checksum is failing here (mysql reference says "replication event checksum"?), ive tried:

set global slave_sql_verify_checksum=0;

current status is:

MariaDB [(none)]> show slave status \G;
*************************** 1. row ***************************
               Slave_IO_State: 
                  Master_Host: 10.145.46.11
                  Master_User: replicant
                  Master_Port: 3306
                Connect_Retry: 60
              Master_Log_File: mysql-bin.000007
          Read_Master_Log_Pos: 107
               Relay_Log_File: mariadb-relay-bin.000001
                Relay_Log_Pos: 4
        Relay_Master_Log_File: mysql-bin.000007
             Slave_IO_Running: No
            Slave_SQL_Running: Yes
              Replicate_Do_DB: 
          Replicate_Ignore_DB: 
           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: 107
              Relay_Log_Space: 256
              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: 1595
                Last_IO_Error: Relay log write failure: could not queue event from master
               Last_SQL_Errno: 0
               Last_SQL_Error: 
  Replicate_Ignore_Server_Ids: 
             Master_Server_Id: 1
               Master_SSL_Crl: 
           Master_SSL_Crlpath: 
                   Using_Gtid: No
                  Gtid_IO_Pos: 
      Replicate_Do_Domain_Ids: 
  Replicate_Ignore_Domain_Ids: 
                Parallel_Mode: conservative
                    SQL_Delay: 0
          SQL_Remaining_Delay: NULL
      Slave_SQL_Running_State: Slave has read all relay log; waiting for the slave I/O thread to update it

Hadoop filesystem size du command

$
0
0

I want to know what the two outputs of hadoop fs -du means. It's not clear on the documentation:

In [16]: subprocess.call(["hadoop", "fs", "-du","-
h","/project/crm/warehouse/"])

Output:

5.9 G 17.8 G /project/crm/warehouse/n98770_patron_1

What's the real size of the path? 5.9 GB or 17.8?

Thank you

Merge Replication From Multiple Express to Central

$
0
0

So I am trying to setup a merge replication from multiple remote SQL 2016 Express installations to a central SQL 2016 Server. This would be for reporting purposes so I would need all the express installations to report information to the central server daily.

The trouble I am having is that the main server is setup as the distributor and publisher (publisher is a blank database with the 41 tables we are wanting to report information into), and the express installs are all subscribers. Is this even possible and if it is, can someone point me in the right direction for documentation as I am not finding any for this purpose.

Thanks for all help!

Does SQLite support replication?

$
0
0

In an application which embeds SQLite3 and uses an in-memory database, is it possible to replicate the database between two running instances of the application? I could do this by hand with a homebrew protocol duplicating all my DB accesses, but it seems like something that should be done inside the DB layer.

RDS Replication Error (Apply Error 1406 / Truncation)

$
0
0

I have a MySQL RDS instance as a master, created a Read Replica from it, and ran some schema change operations on it. To be specific, I changed the charset and collation of all the tables and columns from utf8 to utf8mb4. Things were replicating fine, but an error just occurred.

Apply Error 1406: Error; Data too long for column... etc

This is due to lowering the varchar length on some columns from 255 to 191.

I read that you can run some commands to skip replication errors, as described here: http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/mysql_rds_skip_repl_error.html

However, would this "skip" the insert, or, just truncate the data and proceed with the insert?

I'd like the data to be truncated and still added to the table rather than aborting the entire operation, but I'm not sure if that is going to happen or not. Any suggestions would be welcome!

Prevent replication of ALTER commands

$
0
0

I am using MariaDB 10.0 multi-source replication for a specific use case.

For security reasons, I would like to prevent ALTER commands on master to replicate (such as CREATE, ALTER, DROP...) whatever user run these commands (even root) but of course let SELECT, INSERT, UPDATE, DELETE commands to replicate....

I do not want to use SET SQL_LOG_BIN=0|1 on client side. In fact, I never want to replicate schema modification.

In practice, I wish I could revoke alter permissions to my replication user (who currently has REPLICATION SLAVE permission)

Is there a way to achieve this?

SQL Server replication data validation

$
0
0

I have a transnational replication between my local database and the cloud. The local database holds 30 days worth of data(it deletes the first day and insert the data of the 31 and so on).

On the cloud I don't replicate Delete Statements. The idea is that we want the cloud to have 1 year worth of data.

Does SQL Server provide a way to validate that the data on my local database exists on the subscriber (in this case the cloud) or should I code my own solution to that?

MYSQL replication for production server with both server active

$
0
0

I want to know whether below is feasible?

I have two production MYSQL version: 5.5.52 databases. both have two schema (schema1 and schema2). If 1. I replicate data from server1 schema1 to server2 schema1 2. I give read access to a robotic user on server2 - schema1 and write access on server2 - schema2. 3. I run select queries on various tables on server2 - schema1 and create a master resultant table on server2 schema2.

Will it impact server1 at all? will it cause data - corruption? is above solution feasible? I want to do this so that I can reduce load from server1.


SQL Server 2014 Replication

$
0
0

I have configured transactional SQL Server 2014 replication but I was not able to transfer data to my subscriber. the snapshot was created 100% but still, it was not working properly I tried reinitializing it few times still same results. if someone can help me on this? one question do we have to restore the Db we want to replicate to the subscriber as well? this I am not sure. thanks.

MySQL Semi-synchronous replication with Multi-Master

$
0
0

Is it possible to use semi-synchronous replication with a Multi-Master setup?

I've tried to follow this guide to setup a semi-synchronous replication for a master-slave setup: https://avdeo.com/2015/02/02/semi-synchronous-replication-in-mysql/

But I'm not sure how to implement this on a Multi-Master setup.

There are two plugins: one for the master and one for the slave. Since a Multi-Master act as a Master and Slave, does that mean I have to install both plugins on all servers?

I'm using MySQL 5.7

Add article to transaction replication without generating a snapshot at all

$
0
0

I have a transaction replication and the subscription was synced from snapshot years ago. Now I have a new table that needs to be added to the replication. Problem is the table is close to a TB and I do not want to generate a snapshot for that table instead just want the new data to be synced, kinda like when you sync from backup. Its inserts only to the table and I can sync the old data manually later.

How do I make replication to start transferring the data without generating the snapshot.

what is this function doing? replication [on hold]

$
0
0
rep_sample_n <- function(tbl, size, replace = FALSE, reps = 1)
{
rep_tbl = replicate(reps, tbl[sample(1:nrow(tbl), size, replace = replace), 
], simplify = FALSE) %>%
bind_rows() %>%
mutate(replicate = rep(1:reps, each = size)) %>%
select(replicate, everything()) %>%
group_by(replicate)
return(rep_tbl)
}

Hey, can anyone help me there? What is this function doing? Is the first line setting the variables of the function? And then what is this "replicate" doing? Thanks!

Cassandra Database replication to another instance

$
0
0

Is it possible to do Cassandra data replication into another server instance to run read only data operations on it? As we have explored SAN and it become more hardware expensive

Note: I am not allowed to copy data into file and therefore. It should be like mirroring of data.

Mysql replication no error and not replicating

$
0
0

I am getting no errors yet replication is not working . wonder where i am going wrong My master status is

            File: mysql-bin.000002
        Position: 2006432
    Binlog_Do_DB: site3,site2
Binlog_Ignore_DB: 

My Slave Status is

*************************** 1. row ***************************
               Slave_IO_State: Waiting for master to send event
                  Master_Host: 104.131.119.241
                  Master_User: drupal
                  Master_Port: 3306
                Connect_Retry: 60
              Master_Log_File: mysql-bin.000002
          Read_Master_Log_Pos: 2006432
               Relay_Log_File: mysqld-relay-bin.000003
                Relay_Log_Pos: 2006577
        Relay_Master_Log_File: mysql-bin.000002
             Slave_IO_Running: Yes
            Slave_SQL_Running: Yes
              Replicate_Do_DB: site3,site2
          Replicate_Ignore_DB: 
           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: 2006432
              Relay_Log_Space: 2006879
              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: 0
Master_SSL_Verify_Server_Cert: No
                Last_IO_Errno: 0
                Last_IO_Error: 
               Last_SQL_Errno: 0
               Last_SQL_Error: 
1 row in set (0.00 sec)

Non-Replicating commands from (master) Mysql 5.5.40 to (slave) MariaDB 10.0.19

$
0
0

CRUD replicates just fine. But we noticed that DB structure altering commands such as ALTER TABLE and/or adding/updating columns to a table and even creating new ones do not replicate to the slave at all.


Setup

This is the content of our my.cnf files:

Replication Setup A

  • Where: (master) Mysql 5.5.40> (slave) MariaDB 10.0.19

Master:

server-id = 1002
binlog-do-db = db_1
binlog-do-db = db_2
binlog-do-db = db_3
sync_binlog = 1
expire_logs_days = 30
innodb_flush_log_at_trx_commit = 1

Slave:

server-id = 1005
replicate-do-db = db_1
replicate-do-db = db_2
replicate-do-db = db_3
slave-parallel-threads=4
slave_compressed_protocol = ON
slave-skip-errors = all
log-slave-updates = ON

Strangely, DB structure altering commands works just fine on a different server pair with an *almost similar replication setup:

Replication Setup B

  • Where: (master) MariaDB 10.0.17> (slave) MariaDB 5.5.41

Master:

server-id = 1004
bind-address = "0.0.0.0"
binlog-do-db = db_a
binlog-do-db = db_b
binlog-do-db = db_c
binlog-do-db = db_d
binlog-do-db = db_e
binlog-do-db = db_f
binlog-do-db = db_g
sync_binlog = 1
expire_logs_days = 30
innodb_flush_log_at_trx_commit = 1

Slave:

server-id = 1003
bind-address = "0.0.0.0"
replicate-do-db = db_a
replicate-do-db = db_b
replicate-do-db = db_c
replicate-do-db = db_d
replicate-do-db = db_e
replicate-do-db = db_f
replicate-do-db = db_g
slave_compressed_protocol = ON
slave-skip-errors = all

Notes for both replication pairs:

  • Names of the databases were obscured.
  • Parts of the my.cnf file where i think replication is configured are only posted.

Questions

  1. Is this a bug or an undocumented feature?
  2. Did i do something wrong on my setup?
  3. What could be other factors that might effect to this behaviour?
  4. If there really are (query)commands that aren't supported for replication, what are these?
    • 4.a) Mysql/MariaDB version setups that has the same effect?

I tried looking at the error logs of the slave for any hints and used structure altering query commands as search keywords but to no avail. Maybe I'm not looking in the right direction?

Update (2015-06-04)

Further testing ensued. As suggested by this SO post, I might have to remove or comment out replicate-do-db from my.cnf; So I did and I found out that:

  • Creating a new table is replicated.
  • Altering a table is not replicated.
  • CRUD transactions were not replicated.

Also, things just got stranger for Replication Setup B where everything was just supposed to work.

  • One DB failed to replicate an ALTER TABLE command just yesterday and we only found out about it now.
  • After the incident, I tried testing executing ALTER TABLE commands to all other DBs of the same server and it replicated just fine. In this test, I am unable to remove replicate-do-db from my.cnf as restarting the server is currently not an option.

Attunity high latency and SQL Server blocking query

$
0
0

We have recently implemented an Attunity replication between 2 servers (From Oracle -> to MSSQL).

Sometimes, we are facing high latency / incoming changes between the 2 servers.

enter image description here

and most of the time we can observe (on SQL Server) a query from attunity program, on a specific table, blocking users queries :

enter image description hereenter image description here

When the query complete, there is no more latency between servers.

According to sp_woisactive, the query is in RUNNABLE state. Trying to start a select on the lock table, my query is blocked, waiting for the attunity query to end.

If we stop attunity replication, the query end and all other transactions runs fines.

Have you Any ideas why this query is taking so much time ? How can I diagnostic this ? it's just a delete on a specific id. Moreover, Indexes are all up to date and there is no fragmentation.

How can I remove a channel from replication slave?

$
0
0

Today my question is about MySQL replication cleanup.

I used mysqldump with the --master-info --all-databases tag and restored it to a new host to be used as a replication slave.

After restore, I see some artifacts of slave information from the master. This is the third host in a replication chain.

I issued reset slave for channel 'xxxxx'; which returned Query OK, 0 rows affected (0.00 sec). When I later query using show slave status for channel 'xxxxx';, I still see information for this replication channel appearing.

How can I cleanup this replication channel such that it never accidentally starts, as well as cleanup the output of show slave status \G to only show the intended replication channel?

Replication or Anything else for enterprise solution (Offline enabled)

$
0
0

Experts!

Please note that this question itself means that my lack of knowledge in this situation.

The situation is.

I have being using my own POS development for a long time and it was built on VB6 and MS SQL Server 2000 and works fine with no errors and all my customers are well satisfied. Now it is different and some of them demanded that I should be able to connect branches to the main office etc.

What I did.

I developed a system using VS 2017 community version using MySql as back end. It allows me to use my server to host database and all branches including head office are having a database with replication connecting them all and also it allows me to develop some android and IOS for mobile to access database.

Question arises now.

  1. Clients are always doing mistakes on their machines that the link between replicated databases are broken frequently.

  2. Building up replication from where it left is becoming difficult all the time.

  3. Clients starts to think it is my fault. ****/*^

Am I doing write. I mean is there any better solution other than replication (Don't tell me to work live its a no (they need to work offline too)).

Need advises that as a developer to developer (understanding re do is the hardest). I can read a lot and a fast learner too.

So Please help. And thanks a lot in advance. Deeply appreciated any kind of a help. :)

Is it possible for unique key to break master-master replication in mysql?

$
0
0

I have a master-master mysql setup with 2 servers running the exact same application making writes to such a table:

 CREATE TABLE `metric` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `host` varchar(50) NOT NULL,
  `userid` int(10) unsigned DEFAULT NULL,
  `name` varchar(255) NOT NULL,
  `sampleid` tinyint(3) unsigned NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique-metric` (`userid`,`host`,`name`,`sampleid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8

auto_increment_increment is 2 and offsets are 0 and 1, so PK ids don't clash, but is it possible that with bad timing, 2 applications will create a row with an equal unique-metric index breaking replication on both mysql servers, since replication thread won't be able to insert replicated row into table due to another row already having the exact same index?

Write-lock a whole table during transaction

$
0
0

I need to perform a delicate operation to my table in which I will solely insert, delete and select upon all of my rows and no God may interfere with the table during this operation: the table will be in an inconsistent state and any concurrent MySQL session shall not be allowed to modify it until commit-ed.

The use of SELECT ... FOR UPDATE | LOCK IN SHARE MODE is not suitable because, while it may potentially be used to lock all the rows in the table, it won't prevent the insertion of further rows by a concurrent session. Basically, I need to LOCK TABLES my_table WRITE within the body of a transaction.

The table contains about 20,000 rows and a master-slave, mixed-format replication is in place over a slow connection so, for any workaround, I'd prefer to avoid using temporary tables which may faint the slave, and the amount of data dumped into the binlog should ideally be minimized.

The engine is InnoDB on MySQL 5.6, for both master and slave.

Viewing all 17268 articles
Browse latest View live


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