如何在没有备份的情况下创建2个具有备份的节点 [英] How to create 2 nodes with backup, but without document balance

查看:61
本文介绍了如何在没有备份的情况下创建2个具有备份的节点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有2个benchbase节点.

I have 2 couchbase nodes.

一个应该备份另一个,但是我确实希望服务器平衡它们之间的文档.

One should backup the other, but I do NOT want the server to balance the documents between them.

因此,我尝试将它们都添加到一个群集中,并在存储桶上将副本设置为禁用",但仍然可以平衡这两个服务器之间的文档.

So I've tried to add them both to one cluster, and set replicas to "disable" on the bucket, but still it balance the documents between those 2 servers.

然后,我尝试将服务器用作不同的群集,并在它们之间进行复制.我还在客户端配置中添加了这两个服务器:

Then I've tried to use the servers as different clusters with replication between them. I've also added in the client config those two servers:

<servers bucket="default" bucketPassword="private">
    <add uri="http://server1ip/pools/default">
    <add uri="http://server2ip/pools/default">
</servers>

当我关闭server1时,请求转到了server2,因此备份工作了!

When I shut down server1, the requests went to server2, so the backup worked!

我不确定是否要从server1上的客户端发送请求,它将始终选择最近的服务器(始终将请求发送到server1ip).

BUT i'm not sure if I'm sending a request from a client on server1, it will always choose the nearest server (sending the request always to server1ip).

我该如何实现?

推荐答案

在创建Couchbase集群时,它被视为单个"数据库.数据始终分布在同一群集中.

When you are creating a Couchbase cluster, this is viewed as a "single" database. The data are always distributed in the same cluster.

因此,如果要自动将数据备份"到其他节点,则必须使用XDCR(跨数据中心复制),它将数据从一个群集复制到另一个群集.(您会看到我没有使用节点"一词,因为Couchbase数据库应部署在多节点上.)

So if you want to "backup" automatically the data into other nodes, what you have to use is the the XDCR (Cross Data Center Replication) that will replicate the data from one cluster to another cluster. (as you can see I am not using the word, "node", since a Couchbase database should be deployed on multipe nodes.)

我邀请您查看以下资源以了解有关此内容的更多信息:

I am inviting you to look at the following resources to learn more about this:

这篇关于如何在没有备份的情况下创建2个具有备份的节点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆