[DOCS] Add local dev setup instructions (#107913)

* [DOCS] Add local dev setup instructions

- Replace existing Run ES in Docker locally page, with simpler no-security local dev setup
- Move this file into Quickstart folder, along with existing quickstart guide
- Update self-managed instructions in Quickstart guide to use local dev approach
This commit is contained in:
Liam Thompson 2024-05-07 18:10:48 +02:00 committed by GitHub
parent 6e7afa04b4
commit d0f4966431
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 202 additions and 254 deletions

View file

@ -12,7 +12,7 @@
aria-controls="self-managed-tab-api-call"
id="self-managed-api-call"
tabindex="-1">
Self-managed
Local Dev (Docker)
</button>
</div>
<div tabindex="0"

View file

@ -50,7 +50,7 @@ terminal session.
[source,sh]
----
curl --cacert http_ca.crt -u elastic:$ELASTIC_PASSWORD https://localhost:9200
curl -u elastic:$ELASTIC_PASSWORD https://localhost:9200
----
// NOTCONSOLE

View file

@ -5,14 +5,14 @@
aria-selected="true"
aria-controls="cloud-tab-install"
id="cloud-install">
Elasticsearch Service
Elastic Cloud
</button>
<button role="tab"
aria-selected="false"
aria-controls="self-managed-tab-install"
id="self-managed-install"
tabindex="-1">
Self-managed
Local Dev (Docker)
</button>
</div>
<div tabindex="0"

View file

@ -8,64 +8,5 @@ include::{docs-root}/shared/cloud/ess-getting-started.asciidoc[tag=generic]
// end::cloud[]
// tag::self-managed[]
*Start a single-node cluster*
We'll use a single-node {es} cluster in this quick start, which makes sense for testing and development.
Refer to <<docker>> for advanced Docker documentation.
. Run the following Docker commands:
+
[source,sh,subs="attributes"]
----
docker network create elastic
docker pull {docker-image}
docker run --name es01 --net elastic -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" -t {docker-image}
----
. Copy the generated `elastic` password and enrollment token, which are output to your terminal.
You'll use these to enroll {kib} with your {es} cluster and log in.
These credentials are only shown when you start {es} for the first time.
+
We recommend storing the `elastic` password as an environment variable in your shell. Example:
+
[source,sh]
----
export ELASTIC_PASSWORD="your_password"
----
+
. Copy the `http_ca.crt` SSL certificate from the container to your local machine.
+
[source,sh]
----
docker cp es01:/usr/share/elasticsearch/config/certs/http_ca.crt .
----
+
. Make a REST API call to {es} to ensure the {es} container is running.
+
[source,sh]
----
curl --cacert http_ca.crt -u elastic:$ELASTIC_PASSWORD https://localhost:9200
----
// NOTCONSOLE
*Run {kib}*
{kib} is the user interface for Elastic.
It's great for getting started with {es} and exploring your data.
We'll be using the Dev Tools *Console* in {kib} to make REST API calls to {es}.
In a new terminal session, start {kib} and connect it to your {es} container:
[source,sh,subs="attributes"]
----
docker pull {kib-docker-image}
docker run --name kibana --net elastic -p 5601:5601 {kib-docker-image}
----
When you start {kib}, a unique URL is output to your terminal.
To access {kib}:
. Open the generated URL in your browser.
. Paste the enrollment token that you copied earlier, to connect your {kib} instance with {es}.
. Log in to {kib} as the `elastic` user with the password that was generated when you started {es}.
Refer to our <<run-elasticsearch-locally, quickstart local dev instructions>> to quickly spin up a local development environment in Docker. If you don't need {kib}, you'll only need one `docker run` command to start {es}. Please note that this setup is *not suitable for production use*.
// end::self-managed[]