# Disabling XDR on a site

**URL:** <https://discuss.aerospike.com/t/disabling-xdr-on-a-site/4935>\
**Category:** XDR (Cross Data Center Replication)\
**Created:** [February 12, 2018, 7:57am UTC](https://discuss.aerospike.com/t/disabling-xdr-on-a-site/4935 "2018-02-12T07:57:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ruchika\_Chugh](https://avatars.discourse-cdn.com/v4/letter/r/77aa72/32.png) [@Ruchika\_Chugh](https://discuss.aerospike.com/u/Ruchika_Chugh)\
**Post date:** [February 12, 2018, 7:57am UTC](https://discuss.aerospike.com/t/disabling-xdr-on-a-site/4935/1 "2018-02-12T07:57:56Z")

</div>

Hi

What is the best way to disable incoming XDR traffic on a site without restarting Aerospike DB?

---

<div class="post-metadata">

**Author:** ![pgupta](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/pgupta/32/2351_2.png) [@pgupta](https://discuss.aerospike.com/u/pgupta)\
**Post date:** [February 12, 2018, 8:02am UTC](https://discuss.aerospike.com/t/disabling-xdr-on-a-site/4935/2 "2018-02-12T08:02:08Z")

</div>

See configuration parameter: allow-xdr-writes

---

<div class="post-metadata">

**Author:** ![Ruchika\_Chugh](https://avatars.discourse-cdn.com/v4/letter/r/77aa72/32.png) [@Ruchika\_Chugh](https://discuss.aerospike.com/u/Ruchika_Chugh)\
**Post date:** [February 12, 2018, 8:05am UTC](https://discuss.aerospike.com/t/disabling-xdr-on-a-site/4935/3 "2018-02-12T08:05:48Z")

</div>

> [@pgupta](#):
>
> allow-xdr-writes

In this case, the source xdr will stop writing data to digestlog. This is is outbound traffic. However, what is required is that any datacenter should stop receiving xdr traffic from all the sources i.e. stop receiving inbound traffic

---

<div class="post-metadata">

**Author:** ![pgupta](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/pgupta/32/2351_2.png) [@pgupta](https://discuss.aerospike.com/u/pgupta)\
**Post date:** [February 12, 2018, 5:10pm UTC](https://discuss.aerospike.com/t/disabling-xdr-on-a-site/4935/4 "2018-02-12T17:10:42Z")

</div>

Hope the test below helps.

Consider a case: DC1 → shipping to DC2. (namespaces match etc)

If I insert a record on DC1 (eg namespace ns1), it shows up on DC2.

`aql> insert into ns1.set1 (pk, b) values (1,1)`

If on DC2 I set `allow-xdr-writes` to false, (default is true), DC2 will reject incoming xdr writes from DC1.

`[DC2] $ asinfo -v 'set-config:context=namespace;id=ns1;allow-xdr-writes=false'`

And on DC2 logs, I see:

```
Feb 12 2018 16:59:07 GMT: INFO (info): (thr_info.c:2766) Changing value of allow-xdr-writes of ns ns1 from true to false
Feb 12 2018 16:59:07 GMT: INFO (info): (thr_info.c:3022) config-set command completed: params context=namespace;id=ns1;allow-xdr-writes=false

```

If I insert a record on DC1:

`aql> insert into ns1.set1 (pk, b) values (2,2)`

On DC1 logs, I see:

`Feb 12 2018 16:59:19 GMT: WARNING (xdr): (xdr_ship.c:937) An unexpected write error happened to DC DC2. Code 22: AEROSPIKE_ERR_FAIL_FORBIDDEN at /work/source/modules/ee/xdr/../modules/client/src/main/aerospike/as_event.c:772.<Digest>:0xe005c25a9eeb151e363051415453171b50c74cc4`

Now, I go back to DC2 and set allow-xdr-writes again to true:

```
[DC2] $ asinfo -v 'set-config:context=namespace;id=ns1;allow-xdr-writes=true'

```

DC2 log shows:

```
Feb 12 2018 17:06:13 GMT: INFO (info): (thr_info.c:2762) Changing value of allow-xdr-writes of ns ns1 from false to true
Feb 12 2018 17:06:13 GMT: INFO (info): (thr_info.c:3022) config-set command completed: params context=namespace;id=ns1;allow-xdr-writes=true

```

Now, when I insert a record on DC1, it is shipped to DC2.

`aql> insert into ns1.set1 (pk, b) values (3,3)`

3,3 shows up on DC2. [Note: (2,2) does not come]

On DC2:

```
[aql> select * from ns1
+---+
| b |
+---+
| 3 |
| 1 |
+---+
2 rows in set (0.018 secs)

```
