# ROR cluster with Elastic Cloud integration

ReadonlyREST plugin cannot be installed on Elastic Cloud. But we can still take advantage of ROR's features with a little, smart trick - [the remote cluster](https://www.elastic.co/guide/en/elasticsearch/reference/current/remote-clusters.html) Elasticsearch feature. A self-managed ROR-based cluster can access an Elastic Cloud cluster when the latter is configured as a remote cluster in the first one.

## Solution Architecture

![Solution architecture](https://3824385214-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MIs6FnSQk86FxD8nNwy-659326392%2Fuploads%2Fgit-blob-e99316d50b7ba3c419460cbd75d0f3171ad05dd3%2Felastic_cloud_integration_diagram.png?alt=media)

The two clusters will communicate at a transport level. The communication will be secured by two-way SSL. Because both clusters have to be configured to trust each other, the initial configuration procedure requires attention. But we prepared a demo that provides an interactive guide to properly set up the clusters automatically. Moreover, details of the setup are described below. Let's start!

## Configuration

Depending on what you need now, you may be interested in either:

* [Quick Start using our docker-based Playground](https://docs.readonlyrest.com/develop/examples/elastic-cloud-cluster-integration/playgroud)
* [Detailed explanation on how to set up the solution](https://docs.readonlyrest.com/develop/examples/elastic-cloud-cluster-integration/details)

## Testing

You can test the setup using Kibana sample web logs. Let's see how to do it in a few steps:

1. Open your browser and go to your Elastic Cloud deployment Kibana and add "Sample web logs".
2. In a new browser tab, open your local ROR cluster Kibana (`http://localhost:15601/`) and log in as admin (`admin:admin`).
3. Pick `Stack Management` in the Kibana menu, go to `Data views`, and click `Create data view` to create the data view to explore the sample logs from the Elastic cloud cluster.

   ![Creating data view 1](https://3824385214-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MIs6FnSQk86FxD8nNwy-659326392%2Fuploads%2Fgit-blob-a8a5fbca6b4d686bc976daef98c837c8c0bf8e80%2Felastic_cloud_testing_f2.png?alt=media)
4. Fill out the form to create a data view:

   a) pick `Name` (it doesn't matter what you enter here) b) enter index pattern `escloud:kibana*` c) one index should be matched: `escloud:kibana_sample_logs` d) click `Save data view to Kibana`

   ![Creating data view 2](https://3824385214-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MIs6FnSQk86FxD8nNwy-659326392%2Fuploads%2Fgit-blob-36343b91caa0664bd852bfa90a09aabc9925f47e%2Felastic_cloud_testing_f3.png?alt=media)
5. Pick `Discover` in the Kibana menu. You should see the data. It's great, but currently, you are logged as `admin` who has access to all indices. Let's try with a different user. Click `Log out`.

   ![Discover - admin](https://3824385214-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MIs6FnSQk86FxD8nNwy-659326392%2Fuploads%2Fgit-blob-3044a3e566adfb9d743f72a496b9461a40b21ac3%2Felastic_cloud_testing_f4.png?alt=media)
6. Let's log in as `user1` (`user1:test`). This user has RO access and should be able to see `escloud:kibana_sample*` indices (check `readonlyrest.yml` or ROR's settings editor while being logged as `admin`). Go to `Discover` in the Kibana menu and check if you see all the logs from the Elastic Cloud cluster.

   ![Discover - user1](https://3824385214-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MIs6FnSQk86FxD8nNwy-659326392%2Fuploads%2Fgit-blob-3044a3e566adfb9d743f72a496b9461a40b21ac3%2Felastic_cloud_testing_f4.png?alt=media)
7. As you saw, the cross-cluster search and Kibana integration works well :) This is the basic setup and the simple use case. Now, you can play with it and try to do something more complicated.
