# **Custom OpenSearch Storage in Zeppelin** ### **Requirement:** - Use Zeppelin as a backend service for OpenSearch Dashboards Notebooks and store notebooks as OpenSearch indices - Use Zeppelin’s storage adaptor interface and implement a new storage adaptor using OpenSearch Client ### **Design:** - [“Transport client API“](https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/transport-client.html) is getting deprecated in favor of high level client. - Finalized, [“High level client API”](https://www.elastic.co/guide/en/elasticsearch/client/java-rest/7.8/java-rest-high.html) for ease of use and minimal operations needed for Adaptor. - Notebooks will be indexed as* .notebooks/\_doc/{Unique_id} →* Unique ID is generated by zeppelin ### **Design Details:** 1. Implements the interface common for all Zeppelin Storage adaptors 2. Implementation of functions in OpenSearch Zeppelin storage adaptor: - Init - Get all config params - List - List all notebooks - Get - fetch a notebook - save - save a notebook - remove - a note - close - client connection - Upgrade client to Https requests - Done using keystore ### **Usage:** 1. POC for OpenSearch adapter is stored in branch 'zeppelin-opensearch' of dashboards-notebooks ``` git checkout zeppelin-opensearch ``` 2. Clone Apache Zeppelin and checkout to 'v0.9.0-preview2' branch in a separate folder ``` cd /your/folder/ git clone https://github.com/apache/zeppelin.git cd zeppelin git checkout v0.9.0-preview2 ``` 3. Apply patch from dashboards-notebooks ``` git apply /path/to/zeppelin-patch ``` 4. Once, in this branch copy "opensearch" storage adaptor to your zeppelin files ``` cp -r /path/to/dashboards-notebooks/zeppelin/zeppelin-plugins/notebookrepo/opensearch path/to/your/zeppelin ``` 4. Add OpenSearch storage property in zeppelin config file "conf/zeppelin-site.xml" and you should comment default git storage ``` zeppelin.notebook.storage org.apache.zeppelin.notebook.repo.OpenSearchNotebookRepo versioned notebook persistence layer implementation ``` 5. [Build Zeppelin](https://zeppelin.apache.org/docs/0.9.0/setup/basics/how_to_build.html) using Open-JDK 8 ``` mvn clean package -DskipTests ```