Skip to content

Commit

Permalink
[docs] update dev guide to connect to external cluster (opensearch-pr…
Browse files Browse the repository at this point in the history
…oject#9080)

* [docs] update dev guide to connect to external cluster

An alternative to developing locally and setting up OpenSearch locally
by pointing to a running cluster.

Issue:
n/a

Signed-off-by: Kawika Avilla <[email protected]>

* dont include port

Signed-off-by: Kawika Avilla <[email protected]>

* Changeset file for PR opensearch-project#9080 created/updated

---------

Signed-off-by: Kawika Avilla <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
  • Loading branch information
kavilla and opensearch-changeset-bot[bot] authored Dec 25, 2024
1 parent c836e60 commit a98e178
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 1 deletion.
47 changes: 46 additions & 1 deletion DEVELOPER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,59 @@ $ yarn osd clean

### Run OpenSearch

OpenSearch Dashboards requires a running version of OpenSearch to connect to. In a separate terminal you can run the latest snapshot built using:
OpenSearch Dashboards requires a running version of OpenSearch to connect to. You can choose to run OpenSearch locally yourself or point to an existing cluster.

#### Run a local OpenSearch cluster

In a separate terminal you can run the latest snapshot built using:

_(Linux, Windows, Darwin (MacOS) only - for others, you'll need to [set up using Docker](https://github.com/opensearch-project/OpenSearch-Dashboards/blob/main/docs/docker-dev/docker-dev-setup-manual.md) or [run OpenSearch from a tarball](#alternative---run-opensearch-from-tarball) instead)_

```bash
$ yarn opensearch snapshot
```

#### Alternative - Connect to an external OpenSearch cluster

Instead of running OpenSearch locally, you can point OpenSearch Dashboards to an existing OpenSearch cluster:

1. Clone the security dashboards plugin inside your OpenSearch Dashboards plugins folder and bootstrap:
```bash
$ cd plugins
$ git clone https://github.com/opensearch-project/security-dashboards-plugin.git
$ cd ..
$ yarn osd bootstrap --single-version=loose
```
2. Create a configuration directory outside your repository to avoid accidentally committing credentials. For example:
```bash
$ mkdir -p /configs/me
$ mkdir -p /configs/prod
```
3. Create `opensearch_dashboards.yml` file(s) in your config directories. Here's an example config:
```yaml
opensearch.hosts: ["https://your-opensearch-host"]
opensearch.username: 'admin'
opensearch.password: 'your-password'
opensearch.ignoreVersionMismatch: true
opensearch.ssl.verificationMode: none
opensearch.requestHeadersWhitelist: [authorization]
opensearch_security.multitenancy.enabled: false
opensearch_security.readonly_mode.roles: [kibana_read_only]
opensearch_security.cookie.secure: false
```
4. Set the `OSD_PATH_CONF` environment variable to point to your config directory:
```bash
$ export OSD_PATH_CONF=/absolute/path/to/configs/me
```

This approach allows you to:
- Develop against a production-like environment
- Avoid running resource-intensive local clusters
- Maintain different configurations for different environments
- Keep sensitive credentials out of your repository

Note: Make sure your OpenSearch cluster is accessible and credentials are valid before starting OpenSearch Dashboards.

### Run OpenSearch Dashboards

_**Warning:** Starting the OpenSearch Dashboards instance before the OpenSearch server is fully initialized can cause Dashboards to misbehave. Ensure that the OpenSearch server instance is up and running first. You can validate by running `curl localhost:9200` in another console tab or window (see [OpenSearch developer guide](https://github.com/opensearch-project/OpenSearch/blob/main/DEVELOPER_GUIDE.md#run-opensearch))._
Expand Down
2 changes: 2 additions & 0 deletions changelogs/fragments/9080.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
doc:
- Update dev guide to connect to external cluster ([#9080](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/9080))

0 comments on commit a98e178

Please sign in to comment.