# Elastic CCR using Create Follower API

**URL:** https://discuss.elastic.co/t/elastic-ccr-using-create-follower-api/308226
**Category:** Elasticsearch
**Tags:** ccr-cross-cluster-replication
**Created:** [June 27, 2022, 9:46am UTC](https://discuss.elastic.co/t/elastic-ccr-using-create-follower-api/308226 "2022-06-27T09:46:54Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![abhishekgupta31986](https://avatars.discourse-cdn.com/v4/letter/a/b19c9b/32.png) [@abhishekgupta31986](https://discuss.elastic.co/u/abhishekgupta31986)
#### Post date: [June 27, 2022, 9:46am UTC](https://discuss.elastic.co/t/elastic-ccr-using-create-follower-api/308226/1 "2022-06-27T09:46:54Z")

</div>

Hi,

I'm setting up CCR in ES. As per documentation it's necessary to setup appropriate roles in remote and local cluster, and then create a user in local cluster with the created role.

However i dont see how this role will be used by Create follower API as it doesnt have such parameter.  
I was even able to perform CCR on my locally running cluster without creating any roles mentioned in the documentation (i do have xpack enabled in my ES).  
**So it it really necessary to create a user with such roles? If yes then how this role is used by ES?**

**As per documentation:**  
"Remote cluster  
On the remote cluster that contains the leader index, the cross-cluster replication role requires the read\_ccr cluster privilege, and monitor and read privileges on the leader index.

Local cluster  
On the local cluster that contains the follower index, the remote-replication role requires the manage\_ccr cluster privilege, and monitor, read, write, and manage\_follow\_index privileges on the follower index"

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [June 28, 2022, 1:05am UTC](https://discuss.elastic.co/t/elastic-ccr-using-create-follower-api/308226/2 "2022-06-28T01:05:52Z")

</div>

Welcome to our community! 😃

On [Tutorial: Set up cross-cluster replication | Elasticsearch Guide [8.2] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/8.2/ccr-getting-started-tutorial.html#_configure_privileges_for_cross_cluster_replication), which is what you are referring to, there's API examples directly below that show you what needs to happen.

If you copy and paste them they make the request to the relevant API endpoint. Did these not work?

---

<div class="post-metadata">

### Author: ![abhishekgupta31986](https://avatars.discourse-cdn.com/v4/letter/a/b19c9b/32.png) [@abhishekgupta31986](https://discuss.elastic.co/u/abhishekgupta31986)
#### Post date: [June 28, 2022, 7:52am UTC](https://discuss.elastic.co/t/elastic-ccr-using-create-follower-api/308226/3 "2022-06-28T07:52:25Z")

</div>

Hi, Thanks for your reply.  
Well example given does work. In the documentation, it has been mentioned that i need to create roles in both remote and local cluster. Then create a user in local cluster and assign the role.

However without creating any such roles and a user, i was able to do CCR and i do have xpack enabled in my cluster. So is it really necessary to create such role and a user, if yes then how is it used by ES? Because in Create Follower Index API, the user and roles are not used any where.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 26, 2022, 7:52am UTC](https://discuss.elastic.co/t/elastic-ccr-using-create-follower-api/308226/4 "2022-07-26T07:52:26Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
