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

Subscriber DB value disappeared from merge subscription. Can it be corrected?

$
0
0

This is very strange.

We have a merge publication with a lot of subscribers. One of them suddenly failed to synchronise with the message "The subscription to publication '(publication name)' is invalid or has not been set up correctly."

Investigating, I found that the subscriber_db value on the publisher has suddenly become blank, if I use sp_helpmergesubscription. The value was definitely there a few days ago, when the subscriber last synchronised successfully.

All other subscribers are unaffected.

How can I investigate how this happened? Is it possible to correct it without re-adding the subscription?

(This happened once some time ago and, without a value to subscriber_db, the subscription could not even be dropped. A new one had to be created alongside the "faulty" one.)


Domain Account or Windows account for Transactional Replication

SQL Server Merge Replication - Adding Pull Subscription with modified Publication Properties to an environment with existing Push Subs

$
0
0

Scenario is as follows:

  • Existing publication with only push subscriptions under a Merge Replication environment
  • Distributor resides on the Publishing Server

I would like to add a unidirectional (publisher to subscriber only) pull subscription to this environment without modifying the existing push subscriptions.

This pull subscription needs to exclude certain articles that are currently being pushed to the other subscribers.

This pull subscription also has a different set of publishing properties for one specific article. In other words, Table A and Table B reside on the Publisher and share the same table structure(columns) but differing data. Table C exists on all subscriptions. Table A is currently being pushed to Table C on the Push subscribers, but I want the Table C residing on the new Pull Subscription to pull data from table B of the Publisher.

1) Is it possible/recommended to have a replication environment containing a mix of push and pull subscriptions?

2) Can I modify publishing properties/published articles of just the Pull subscription without affecting the existing environment?

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?

EDIT 2018-02-19

Since my requirements seems nonsense for some readers, I give some additional information about this use case.

I created one (or more) MariaDB Proxy database(s) with tables using BLACKHOLE Storage Engine. So data is not stored on this proxy server, but binlogs are.

I have other MariaDB servers running the same database schema but with INNODB storage engine that replicates data from proxy server(s) using MariaDB Multi-source Replication.

On the proxy server, I can safely recreate, for example, a table schema with a CREATE OR REPLACE TABLE mytable (id int) ENGINE=BLACKHOLE statement as there is no data stored in it.

But this kind of statement MUST NOT run as is on the "slaves" (which are not real slaves as you noticed) as they must remain in their original storage engine or any other option they may have at the table level.

I can do this by issuing a SET SQL_LOG_BIN=0 before executing my command, but I was looking for a way to make sure that I will not break the slaves in case I forget to do it.

MongoDB unrecoverable replication error

$
0
0

One of member of my MongoDB replica set decided it would not restart, with the following error (reformatted for readability):

Starting rollback due to OplogStartMissing: 
our last op time fetched: (term: 30, timestamp: Jul 28 07:45:11:6) 
source's GTE:             (term: 31, timestamp: Jul 28 07:45:11:7)

Fatal assertion 18750 UnrecoverableRollbackError
                          (term: 31, timestamp: Jul 28 07:45:12:2) > our last optime: 
                          (term: 30, timestamp: Jul 28 07:45:11:6)

Let's call the instance where this happens M1, and the source its trying to sync M2. M1 used to be primary, then the primary switched to M2, and M1 restarted.

The naive interpretation of these log messages is that the first operation from M2's oplog is exactly the next operation after what we have applied in M1. So, we should just happily apply operations from M2, but MongoDB tries to rollback some operations, finds an operation in future relative to both what we've applied and what's next on M2, and dies.

I have two questions: first, why is MongoDB trying rollback in the first place, and second, where is operation with timestamp of Jul 28 07:45:12:2 is coming from?

How (if at all) does Galera enforce authentication for SST via rsync when adding a node?

$
0
0

I have to be missing something here.

It just hit me as added a new node to my cluster in order to prepare for the removal of a different node: "How does the cluster know that it is okay to send the new node a SST?"

I am pretty sure that the only information the new node has about the cluster is the gcomm:// address. Surely that isn't looked at as "secure" information that passes for authentication. To my knowledge, no shell account on the new node has the same password as on the existing cluster nodes.

So what would prevent anyone from spinning up a new node and pointing it's gcomm:// address at one or more of my nodes to just get an SST and be able to see all of my data?

Of course, certificates will be put in place. But I'm talking about a default setup and how things work "out of the box." I couldn't find much of anything that talked about this out there.

Am I going nuts?

How could I latency measure replication in Mongodb, NoSQL, or quantify of replicas updates?

Setting up replication with MariaDB 10.3.4 docker images

$
0
0

I'm attempting to set up replication between two docker containers, both running the stock MariaDB 10.3.4 images (which are the latest versions as of right now). When I start up the containers, I get error code 1062 (Duplicate key) on table mysql.user for key localhost-root. The slave is clearly trying to replicate the mysql.user table from the master and failing because they both have root@localhost users. This does not seem to be Docker-related - I would imagine the same issue will arise when setting up any master/slave pair from scratch.

How can I set up a slave to replicate everything? I'm starting from scratch, so I want the slave to be a (more-or-less) perfect copy of the master.

Here is the set up:

I'm running the containers from a docker-compose.yml file:

version: '2'

volumes:
    dbdata:
        external: false

services:

    # the MariaDB database MASTER container
    #
    database:
        image: mariadb:10.3.4
        env_file:
            - ./env/.env.database
        volumes:
            - dbdata:/data/db
            - /etc/localtime:/etc/localtime:ro
            # mount the configuration files in the approriate place
            #
            - ./database/master/etc/mysql/conf.d:/etc/mysql/conf.d:ro
            # mount the SQL files for initialization in a place where the
            # database container will look for it on initialization; see
            # "Initializing a fresh instance" at
            # https://hub.docker.com/_/mariadb/ for details
            #
            - ./database/master/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d:ro
        ports:
            - "3306:3306"

    # the MariaDB database SLAVE container
    #
    slave:
        image: mariadb:10.3.4
        # env_file:
        #     - ./env/.env.database
        environment:
            - MYSQL_ALLOW_EMPTY_PASSWORD=yes
        volumes:
            - /etc/localtime:/etc/localtime:ro
            # mount the configuration files in the approriate place
            #
            - ./database/slave/etc/mysql/conf.d:/etc/mysql/conf.d:ro
            # mount the SQL files for initialization in a place where the
            # database container will look for it on initialization; see
            # "Initializing a fresh instance" at
            # https://hub.docker.com/_/mariadb/ for details
            #
            - ./database/slave/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d:ro
        depends_on:
            - database

The .env/.env.database file simply exposes the environment variables that the MariaDB docker image requires:

# the root user password
#
MYSQL_ROOT_PASSWORD=password

# the database to use
#
MYSQL_DATABASE=mydatabase

Note that this is my development environment, so I'm using a dumb password.

The master & slave configuration files are mounted from my local host.

000-replication-master.sql:

GRANT REPLICATION SLAVE ON *.* TO 'replicant'@'%' IDENTIFIED BY 'password';

replication.cfg for the master:

[mariadb]
    log-bin
    server_id=1
    log-basename=master1

    # force binlog format to ROW to avoid issues with
    # replicate_do_db
    binlog_format=ROW

000-replication-slave.sql:

-- configure the connection to the master
--
CHANGE MASTER TO
    MASTER_HOST='database',
    MASTER_USER='replicant',
    MASTER_PASSWORD='password',
    MASTER_PORT=3306,
    MASTER_USE_GTID=slave_pos,
    MASTER_CONNECT_RETRY=10;

-- start the slave
--
START SLAVE;

replication.cnf for the slave:

[mariadb]
    server_id=1000
    relay-log = /var/log/mysql/mysql-relay-bin.log
    log_bin = /var/log/mysql/mysql-bin.log

The error I'm seeing on the slave is this:

Could not execute Write_rows_v1 event on table mysql.user; Duplicate entry 'localhost-root' for key 'PRIMARY', Error_code: 1062; handler error HA_ERR_FOUND_DUPP_KEY; 

The issue is similar to this question, but I'm attempting to use the stock MariaDB images (instead of a custom Docker image).

I've tried a number of different things:

  1. I set it up with replicate_do_db = mydatabase on the slave and it did work, but given the concerns with slave filtering, I'd prefer not to use it. I think it's set up correctly but I'd rather not take the chance.

  2. I've tried deleting the offending row from the mysql.user table (both with a DELETE statement and, when that didn't with, with TRUNCATE) on the slave before the CHANGE MASTER statement, but this does not work.

I should mention that I've searched for an answer to this problem, but all the tutorials online suggest getting the binary log position on the master and manually updating the slave position before starting replication. I'm looking for a solution that will allow me to set up the slave immediately after the master is created and start syncing from scratch.

So, in short, the question is how do I set up a master & slave to replicate everything, starting from a brand-new installation of MariaDB on both master and slave?


Manual Active-Active DynamoDB MultiRegion Replicas

$
0
0

Trying to implement multi-region replication for DynamoDB. Very similar to Global Tables, except the major limitations: 1) need to be able to add more regions along the way. 2) make this work even when there is data in the tables.

Would want to rely on lambdas dynamo streams and probably event rules for periodic checks. Solution should support writes to either region just like in case with GlobalTables.

I was hoping to get help with algorithm that would ensure that the data is eventually consistent.

In my case amount of data inside tables would be very little.

Thanks!

Group replication ports issues

$
0
0

What should be the ports for group replication if we are implementing group replication on three different MySQL servers? The my.cnf for the first server is

port=3306
loose-group_replication_local_address= "x.x.x.x:3307"
loose-group_replication_group_seeds= "x.x.x.x:3307,x.x.x.x:3307,x.x.x.x:3307"

For the second server the settings are same and I have changed the IP's in loose-group_replication_local_address accordingly, but I am facing this error when running start GROUP_REPLICATION:

[ERROR] Plugin group_replication reported: '[GCS] The member was unable to join the group. Local port: 3307'

Does any one know the solution?

Replication Path Cassandra NoSQL

$
0
0

In data replication, is it correct to claim that the time for replication is the write time on the source server plus the delay between the nodes plus the write time on the target server?

Freeipa The host 'ipa-eastus.xxxxx.com' does not exist to add a service to

$
0
0

I have a task to install two Freeipa servers with replication, in Kubernetes and restore there some data from backup. So I did set up first Freeipa 4.3.3 server in Kubernetes with this official docker file https://github.com/freeipa/freeipa-container/blob/master/Dockerfile.fedora-24 . After that I uploaded backup into pod. I entered inside pod and restored my backup according to official manual with restore utility:

ipa-restore --data /my_backup_folder

First server works perfectly, I can access web UI, make ldap queries, manage users, groups, etc. Then I did set up another Freeipa in another region. I also installed it in Kubernetes with the same docker file as above. Finally I tried to install replica and got issue. My steps on second server:

1. Remove initial set up

ipa-server-install -U --uninstall

2. Install ipa client:

ipa-client-install --debug -U --domain xxxxx.com --realm XXXXXXX.COM --server first-ipa.xxxxxx.com -p admin -w <password> --hostname ipa-eastus.xxxxxx.com --request-cert --no-ntp After this step I can successfully run such command as ipa host-find, ipa service-find, etc. So IPA client works fine.

3. Install ipa replica:

ipa-replica-install --debug -U -w <password> --hostname ipa-eastus.xxxxxxx.com During this step it verifies network connection between servers, network is fine, then it fetches some info from first server and in the middle of progress fails with

ipa.ipalib.plugins.rpcclient.rpcclient: DEBUG    Destroyed connection context.rpcclient_140224155653136
ipa         : DEBUG    Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/ipaserver/install/service.py", line 448, in start_creation
    run_step(full_msg, method)
  File "/usr/lib/python2.7/site-packages/ipaserver/install/service.py", line 438, in run_step
    method()
  File "/usr/lib/python2.7/site-packages/ipaserver/install/dsinstance.py", line 1222, in __get_ds_keytab
    force_service_add=True)
  File "/usr/lib/python2.7/site-packages/ipaserver/install/installutils.py", line 1141, in install_service_keytab
    version=u'2.112'    # All the way back to 3.0 servers
  File "/usr/lib/python2.7/site-packages/ipalib/rpc.py", line 986, in forward
    return self._call_command(command, params)
  File "/usr/lib/python2.7/site-packages/ipalib/rpc.py", line 963, in _call_command
    return command(*params)
  File "/usr/lib/python2.7/site-packages/ipalib/rpc.py", line 1115, in _call
    return self.__request(name, args)
  File "/usr/lib/python2.7/site-packages/ipalib/rpc.py", line 1109, in __request
    raise error_class(message=error['message'])
NotFound: The host 'ipa-eastus.xxxxxxx.com' does not exist to add a service to.

ipa         : DEBUG      [error] NotFound: The host 'ipa-eastus.xxxxxxx.com' does not exist to add a service to.
  [error] NotFound: The host 'ipa-eastus.xxxxxxx.com' does not exist to add a service to.
Your system may be partly configured.
Run /usr/sbin/ipa-server-install --uninstall to clean up.

Can anyone help me with this? I am confused, because after step 2 - the host "ipa-eastus.xxxxxxx.com" is added to first server, I don't understand why it tells that host doesn't exist. All DNS names are configured properly. Many thanks

I want to Create a brand new slave for my MySql Percona server 5.7

$
0
0

I have a Master Master Replication setup using mysql Percona Server 5.7, but for some unknown reasons, seems like my passive server is broken "thats not the issue", the replication is bad and the data been bad in the passive for a while.

I have decided to create a new Passive server from the current active. What is the best way to create a new passive server "from the active one" without or with minimum downtime? given that:

  • bin logs set on Active and current passive
  • Relay log is set
  • log expire days = 3
  • sync-binlog = 1
  • binlog-format = ROW
  • log-slave-updates = ON

please help

Issues kicking off Attunity Replication job - Task Server

$
0
0

My org is just beginning to work on replacing our existing DWH platform with Snowflake/Attunity/WhereScape and some (for now) unnamed Data Vis. tool, but we're running into a weird error and I'm hoping someone has seen the same thing and can maybe point me in the right direction.

We have 2 replication jobs, one from an Oracle source and one from a SQL Server source, and they are both failing and throwing the error "Task Server Initialization Failed", without churning any useful logs.

We had the initial thought that it was a setup issue and that I had done something wrong in setting up the Data Lake or the source endpoint, but we were able to successfully replicate with the same account on another DB with me at the helm, so...i don't think it's me.

I'm going to have a DBA work with me to go line-by-line and verify that the permission match the Attunity user guide, but does anyone out there have any tips or know where I should look?

How merge replication in SQL Server synchronizes the changes of subscribers after disconnection?

$
0
0

Merge Replication allows both subscribers and publishers to do modifications even when subscribers are not connected and combines data from multiple sources into a single central database. What will happen if one of subscribers is not connected, the publisher modifies a specified article while connected, and the subscriber modifies the same article on the subscriber instance while not connected. After some time when the subscriber gets connected how the data will be synchronized?


Getting error message while replication database in mongodb windows

$
0
0

I am trying to replicate database in mongodb 4.0 in two different windows server. I followed all the steps of mongodb replication. While I was configuring the secondary database from primary through the below command

rsconf={_id:"myset", members:[{_id:0,host:"PrimaryServerIP:27017"},{_id:1,host:"SecondaryServerIP:27017"}]}

Then while I was reconfiguring the rsconf through

rs.reconfig(rsconf)

I was getting the below error message "Support for replication protocol version 0 was removed in MongoDB 4.0. Downgrade to MongoDB version 3.6 and upgrade your protocol version to 1 before upgrading your MongoDB version"

I tried to update the replication protocol by downgrading the MongoDB to 3.6 through the below command

rsconf = rs.conf()
rsconf.protocolVersion=1
rs.reconfig(rsconf)

But still getting the same error message. Is there any way to update the protocol version to 1 in mongodb 4.0.

Also I tried the same replication steps in mongodb 3.6 and it is working fine. Any help will be highly appreciated.

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!

Copy SQL Server replication configuration from production to test environment

$
0
0

Where I'm currently working we have an SQL Server's instance for a billing database and another instance for customer database. Both databases keep some tables synchronized using replication mechanism. I'm trying to set up some automated way to get fresh backups from production into QA/DEV environments, but in order for our platform to be kind of a mirror of production environment we need this replication thing between customer and billing databases to work. I know very few about these kind of things, I'm only a developer by unfortunately no one else is willing to do it.

My question is, Is it possible to copy the replication setup in production to QA without having to go along all the process of setting up replication step by step in QA/DEV environments? Maybe generating some scripts of this setup from production and with some small changes enable it in QA/DEV environments?

Additional notes:

  1. We use an instance for QA/Dev customer databases.
  2. Another instance for QA/DEV billing databases.
  3. Both instances run in the same server.

SQL Server version:

Microsoft SQL Server 2016 (RTM-GDR) (KB3210111) - 13.0.1728.2 (X64) Dec 13 2016 04:40:28 Copyright (c) Microsoft Corporation Enterprise Edition (64-bit) on Windows Server 2012 R2 Standard 6.3 (Build 9600: ) (Hypervisor)

This is probably a dumb question, but I'd appreciate any help about it.

Thanks.

Not showing subscription in Local Subscriptions folder during Replication

$
0
0

I've created a replication subscription

enter image description here

After refreshing there is no Local Subscription in a folder

enter image description here

PS I've also checked in a Publisher in case of a mistake but there also was no subscription written.

As the wizard shows the subscription is created, where is it? why it is not is a correct folder?

While creating I've used SQL Agent service account. May the account or its security(accessibility) settings be the reason?

Thanks for your time.

MySQL Replication ERROR 1130: error conecting to master

$
0
0

I'm having difficulty connecting MySQL slave database to master using MyWorkBench.

I tried:

  1. executing

    CREATE USER 'replication'@'localhost' IDENTIFIED BY 'password';
    GRANT ALL PRIVILEGES ON . TO 'replication'@localhost' WITH GRANT OPTION;
  2. using IP address instead of the server name

I confirmed that:

  • I followed all the steps for setting server_id for slave and master

  • I could ping both master and slave servers

Can anyone help me with this, please?

Viewing all 17268 articles
Browse latest View live


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