database-replication

postgresql streaming replication slow on macOS

ⅰ亾dé卋堺 提交于 2019-12-23 01:42:34
问题 I am using PostgreSQL 10.1 on MAC on which I am trying to set up streaming replication. I configured both master and slave to be on the same machine. I find the streaming replication lag to be slower than expected on mac. The same test runs on a Linux Ubuntu 16.04 machine without much lag. I have the following insert script. for i in $(seq 1 1 1000) do bin/psql postgres -p 8999 -c "Insert into $1 select tz, $i * 127361::bigint, $i::real, random()*12696::bigint from generate_series('01-01-2018

Rails 3 and mysql master-slave replications

好久不见. 提交于 2019-12-21 19:59:58
问题 Want to set up mysql master-slave replications in rails app. Are there plugins/db adapters available for Rails 3? Does the Masochism plugin work properly with rails 3? 回答1: Try Octopus, which supports both rails3 and rails2.3: https://github.com/tchandy/octopus Masochism, DbCharmer, data_fabric et al will probably never be updated for Rails3 since so many ActiveRecord internals have drastically changed. 回答2: data_fabric also now claims support for Rails 3.0.7 https://github.com/mperham/data

Microservice data replication patterns

﹥>﹥吖頭↗ 提交于 2019-12-21 17:53:20
问题 In a microservice architecture, we usually have two ways to communicate 2 microservices. Let’s say service A needs to get information from service B. The first option is an remote call, usually synchronous over HTTPS, so service A query an API hosted by service B. The second option is adopting an event-driven architecture, where the state of service B can be published and consumed by service A in asynchronous way. Using this model, the service A can update its own database with the

Ideal Replication Filter for JSON based Databases Like Couchbase, CouchbaseLite, CouchDB, etc.?

こ雲淡風輕ζ 提交于 2019-12-21 05:44:09
问题 I am about to write a filter function on CouchDB server side to filter documents specific to the user . This filter will allow replication only for those few selected documents that a particular user has access to rather than whole database of TBs of size. Here I found a similar question CouchDB: Restricting users to only replicating their own documents but it does not provide me the info that I need. SO my questions remain: What can be the best approach to specify such a filter? How should I

Encountered a MongoDB warning after converting a replica set to stand alone server

强颜欢笑 提交于 2019-12-19 05:29:00
问题 I encountered the following warning after converting a mongodb replica set to a stand alone server. I did rs.remove('host') and removed the replSet arguments when starting the mongo db. [root@sam ~]# mongo MongoDB shell version: 2.4.3 connecting to: test Server has startup warnings: Tue Jul 9 17:18:46.076 [initandlisten] Tue Jul 9 17:18:46.076 [initandlisten] ** WARNING: mongod started without --replSet yet 1 documents are present in local.system.replset Tue Jul 9 17:18:46.077 [initandlisten]

Encountered a MongoDB warning after converting a replica set to stand alone server

走远了吗. 提交于 2019-12-19 05:27:07
问题 I encountered the following warning after converting a mongodb replica set to a stand alone server. I did rs.remove('host') and removed the replSet arguments when starting the mongo db. [root@sam ~]# mongo MongoDB shell version: 2.4.3 connecting to: test Server has startup warnings: Tue Jul 9 17:18:46.076 [initandlisten] Tue Jul 9 17:18:46.076 [initandlisten] ** WARNING: mongod started without --replSet yet 1 documents are present in local.system.replset Tue Jul 9 17:18:46.077 [initandlisten]

Mongoose: Read on ReplicaSet

浪尽此生 提交于 2019-12-18 17:26:41
问题 I have a mongodb replica set from which I want to read data from primary and secondary db. I have used this command to connect to the db: mongoose.connect('mongodb://user:password@54.230.1.1,user:password@54.230.1.2,user:password@54.230.1.3/PanPanDB?replicaSet=rs0&readPreference=nearest'); It doesn't work.. My application continues to read from the primary.. Any suggestion please? 回答1: If you want to read from a secondary, you should set your read preference to either of: secondaryPreferred -

Is it possible to do N-master => 1-slave replication with MySQL?

此生再无相见时 提交于 2019-12-18 13:30:41
问题 I want to make a dedicated SLAVE machine for data replication of three database on three different servers. In other words, I want to do Multiple Master => SIngle Slave replication. Is there any way to do this, as simple as it can be ? Thanks ! 回答1: Multi-master replication (a slave with more than one master) is not supported by MySQL (besides MySQL Cluster). You can do a master-master replication of a circular (ring) replication (described here or here). In High performance MySQL 2nd edition

Hibernate web application with MySQL failover

浪子不回头ぞ 提交于 2019-12-14 01:26:36
问题 I developed a Java web application, using Hibernate 3.3.2 as persistence framework and Apache Tomcat 7.0.27 as server. This application was successfully set up to use MySQL 5.5 Replication Servers: 1 master, 1 slave. Read-only queries go on the latter and the others on the master instance. And here comes the problem: I would like to test DB failover, i.e. at some time stop the slave MySQL instance and see the application still work well with read-only queries. As far as I understood from the

Issue with connecting to ReplicationServer with sql authentication

家住魔仙堡 提交于 2019-12-13 21:35:02
问题 I am trying to use PowerShell to connect to ReplicationServer and backup replication. The SQL Server Edition is 2008 SP2. It works fine with Windows authentication but when I try to connect with SQL Server authentication it shows error New-Object : Cannot find an overload for "ReplicationServer" and the argument count: "1". At .....\Experiment.ps1:34 char:74 + [Microsoft.SqlServer.Replication.ReplicationServer]$var_server=new-object <<<< ("Microsoft.SqlServer.Replication.ReplicationServer")