database-replication


What's the best way to ensure referential integrity on a replicated database?

此生再无相见时 提交于 2020-01-15 11:51:51
问题 Using SQL SERVER 2005, I have a couple of questions on Replication and referential integrity. 1) Does Replication handle referential integrity? 2) If I do an Insert to Parent table and then to Insert to Child table, in one transaction, on Source DB - will Replicated DB also behave in the same manner? I.e. In Replicated DB record must be present in Master table, before it is referenced in child table? Thanks 回答1: Assuming replication is transactional and you have referential integrity on your

MySQL: Writing to slave node

拟墨画扇 提交于 2020-01-13 09:06:11
问题 Lets say I have a datbase of Cars. I have Makes and Models (FK to Makes). I plan on having users track their cars. each Car has a FK to Model. Now, I have a lot of users, and I want to split up my database to distribute load. The Makes and Models tables don't change so much, but they need to be shared across shards. My thought is to use MySQL replication from a master DB of makes and models to each slave database. My question is: Can I safely write to the slave databases assuming I don't

mariadb, is this kind of increment offset reaction consider normal?

人走茶凉 提交于 2020-01-06 05:57:11
问题 I posted a similar question a bit earlier but I was a bit confused because of the settings already set and by reading this http://mariadb.org/auto-increments-in-galera/ I totally understand and corrected the settings but from what I read the output of the auto increment id will be like both nodes are increment of 2 node 1 with offset 1 1,3,5,7 node 2 with offset 2 2,4,6,8 but when I create new rows...this happens create with node 1, node 1, node 2 would give me 1,3,4 it wouldn't give me 2

How do I keep two article tables synced, but keep stock separate

只谈情不闲聊 提交于 2020-01-05 15:50:07
问题 This is probably a more conceptual problem, but I couldn't find an easy solution. Scenario: Two shops (say 'M' and 'S']. M is the master and determines the articles in the databases. Each maintains an independent stock. I have M's article table replicating to S, and I separated stock into a separate table with a common reference. Now when new articles are added in M, they arrive at S too, but they won't have an entry in S's stock table. Similar problem with delete articles. Possible solutions

mysql failover: how to choose slave as new master?

跟風遠走 提交于 2020-01-03 13:33:06
问题 I'm mysql newbie. when it comes to fail-over, which slave should be promoted to the new master? For example, A is master, B and C are slaves, and A does async replication to B and C. At some point of time, B receives more data from A than C, A crashes. If we promote C to new master, and changes B's master to C, then what happens to B? It truncates its data to match C? Obviously, B is the best new master candidate, but my question is, how to determine this fact? 回答1: From the MySQL

Replicate a single Redis database from an instance that has multiple databases

六眼飞鱼酱① 提交于 2020-01-02 05:48:20
问题 I have one Redis instance that has two databases. Now I want to set up a second instance and replicate the first instance, but the second instance should only have one database and replicate only db 0 from the first instance. When I try to do it (set slaveof ... for the second instance) I get the following error message in the Redis log file: FATAL: Data file was created with a Redis server configured to handle more than 1 databases. Exiting I tried using redis-dump but I get an error when I

Replicate a single Redis database from an instance that has multiple databases

会有一股神秘感。 提交于 2020-01-02 05:48:06
问题 I have one Redis instance that has two databases. Now I want to set up a second instance and replicate the first instance, but the second instance should only have one database and replicate only db 0 from the first instance. When I try to do it (set slaveof ... for the second instance) I get the following error message in the Redis log file: FATAL: Data file was created with a Redis server configured to handle more than 1 databases. Exiting I tried using redis-dump but I get an error when I

cassandra sharding and replication

懵懂的女人 提交于 2020-01-02 05:41:11
问题 I am new to Cassandra was going though this Article explaining sharding and replication and I am stuck at a point that is - I have a cluster with 6 Cassandra nodes configured at my local machine. I create a new keyspace "TestKeySpace" with replication factor as 6 and a table in keyspace "employee" and primary key is auto-increment-number named RID. I am not able to understand how this data will be partitioned and replicated. What I want to know is since I am keeping my replication factor to

how to convert a read only hibernate session to write during a transaction (Master/Slave DB)

冷暖自知 提交于 2019-12-25 08:21:24
问题 Working with MySql replication with spring+hibernate, I have a quick question; The transactions that are opened are in read-only mode i.e pointing to slave DB. What is the best way to convert it to write mode if I want to save/update/delete any thing during that transaction? I do not want to open a write mode transaction as most of the time I want read stuff. Do I need to overide the replication Driver/Hibernate template for this thing? 回答1: We open transactions in read only mode and then

multiple Postgres clusters (not instances) on 2 machines

ぐ巨炮叔叔 提交于 2019-12-25 00:38:01
问题 I am trying to setup (half way done already) 2 Postgres clusters, say prod and test (not instances) on 2 machines say .114 and .115. One cluster has 2 instances. Each instance runs on each of machines. I am trying to make .114 as primary for test cluster while .115 will work as secondary for it. For prod cluster .115 will work as primary and .114 as secondary. Although it sounds not-good that i have test and prod on same machines but this is what customer needs now. I have already setup test

工具导航Map