mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-06-28 17:34:17 -04:00
[DOCS] Update ES quick start for security ON by default (#80735)
* [DOCS] Update ES quick start for security ON by default * Remove code.asciidoc, which is part of the overall doc build now * Update node names for cleanup * Add note with links to tools * Add --net elastic network Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
parent
fa19c3842f
commit
247d124666
9 changed files with 41 additions and 179 deletions
|
@ -17,7 +17,6 @@ The simplest way to set up {es} is to create a managed deployment with {ess} on
|
|||
{ecloud}. If you prefer to manage your own test environment, you can install and
|
||||
run {es} using Docker.
|
||||
|
||||
include::{es-repo-dir}/tab-widgets/code.asciidoc[]
|
||||
include::{es-repo-dir}/tab-widgets/quick-start-install-widget.asciidoc[]
|
||||
|
||||
[discrete]
|
||||
|
|
|
@ -302,7 +302,6 @@ exceeds 85%.
|
|||
|
||||
**Check JVM memory pressure**
|
||||
|
||||
include::{es-repo-dir}/tab-widgets/code.asciidoc[]
|
||||
include::{es-repo-dir}/tab-widgets/jvm-memory-pressure-widget.asciidoc[]
|
||||
|
||||
**Check garbage collection logs**
|
||||
|
|
|
@ -26,7 +26,6 @@ stream.
|
|||
|
||||
The steps for setting up data tiers vary based on your deployment type:
|
||||
|
||||
include::{es-repo-dir}/tab-widgets/code.asciidoc[]
|
||||
include::{es-repo-dir}/tab-widgets/data-tiers-widget.asciidoc[]
|
||||
|
||||
[discrete]
|
||||
|
|
|
@ -19,8 +19,6 @@ default.
|
|||
|
||||
Supported `path.data` and `path.logs` values vary by platform:
|
||||
|
||||
include::{es-repo-dir}/tab-widgets/code.asciidoc[]
|
||||
|
||||
include::{es-repo-dir}/tab-widgets/customize-data-log-path-widget.asciidoc[]
|
||||
|
||||
include::{es-repo-dir}/modules/node.asciidoc[tag=modules-node-data-path-warning-tag]
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
[[logging]]
|
||||
=== Logging
|
||||
|
||||
include::{es-repo-dir}/tab-widgets/code.asciidoc[]
|
||||
|
||||
You can use {es}'s application logs to monitor your cluster and diagnose issues.
|
||||
If you run {es} as a service, the default location of the logs varies based on
|
||||
your platform and installation method:
|
||||
|
|
|
@ -145,8 +145,6 @@ configuration to account for this.
|
|||
|
||||
Supported `path.repo` values vary by platform:
|
||||
|
||||
include::{es-repo-dir}/tab-widgets/code.asciidoc[]
|
||||
|
||||
include::{es-repo-dir}/tab-widgets/register-fs-repo-widget.asciidoc[]
|
||||
|
||||
[discrete]
|
||||
|
|
|
@ -1,163 +0,0 @@
|
|||
// Defining styles and script here for simplicity.
|
||||
++++
|
||||
<style>
|
||||
.tabs {
|
||||
width: 100%;
|
||||
}
|
||||
[role="tablist"] {
|
||||
margin: 0 0 -0.1em;
|
||||
overflow: visible;
|
||||
}
|
||||
[role="tab"] {
|
||||
position: relative;
|
||||
padding: 0.3em 0.5em 0.4em;
|
||||
border: 1px solid hsl(219, 1%, 72%);
|
||||
border-radius: 0.2em 0.2em 0 0;
|
||||
overflow: visible;
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
background: hsl(220, 20%, 94%);
|
||||
}
|
||||
[role="tab"]:hover::before,
|
||||
[role="tab"]:focus::before,
|
||||
[role="tab"][aria-selected="true"]::before {
|
||||
position: absolute;
|
||||
bottom: 100%;
|
||||
right: -1px;
|
||||
left: -1px;
|
||||
border-radius: 0.2em 0.2em 0 0;
|
||||
border-top: 3px solid hsl(219, 1%, 72%);
|
||||
content: '';
|
||||
}
|
||||
[role="tab"][aria-selected="true"] {
|
||||
border-radius: 0;
|
||||
background: hsl(220, 43%, 99%);
|
||||
outline: 0;
|
||||
}
|
||||
[role="tab"][aria-selected="true"]:not(:focus):not(:hover)::before {
|
||||
border-top: 5px solid hsl(218, 96%, 48%);
|
||||
}
|
||||
[role="tab"][aria-selected="true"]::after {
|
||||
position: absolute;
|
||||
z-index: 3;
|
||||
bottom: -1px;
|
||||
right: 0;
|
||||
left: 0;
|
||||
height: 0.3em;
|
||||
background: hsl(220, 43%, 99%);
|
||||
box-shadow: none;
|
||||
content: '';
|
||||
}
|
||||
[role="tab"]:hover,
|
||||
[role="tab"]:focus,
|
||||
[role="tab"]:active {
|
||||
outline: 0;
|
||||
border-radius: 0;
|
||||
color: inherit;
|
||||
}
|
||||
[role="tab"]:hover::before,
|
||||
[role="tab"]:focus::before {
|
||||
border-color: hsl(218, 96%, 48%);
|
||||
}
|
||||
[role="tabpanel"] {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
padding: 1em;
|
||||
border: 1px solid hsl(219, 1%, 72%);
|
||||
border-radius: 0 0.2em 0.2em 0.2em;
|
||||
box-shadow: 0 0 0.2em hsl(219, 1%, 72%);
|
||||
background: hsl(220, 43%, 99%);
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
[role="tabpanel"] p {
|
||||
margin: 0;
|
||||
}
|
||||
[role="tabpanel"] * + p {
|
||||
margin-top: 1em;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
window.addEventListener("DOMContentLoaded", () => {
|
||||
const tabs = document.querySelectorAll('[role="tab"]');
|
||||
const tabList = document.querySelector('[role="tablist"]');
|
||||
// Add a click event handler to each tab
|
||||
tabs.forEach(tab => {
|
||||
tab.addEventListener("click", changeTabs);
|
||||
});
|
||||
// Enable arrow navigation between tabs in the tab list
|
||||
let tabFocus = 0;
|
||||
tabList.addEventListener("keydown", e => {
|
||||
// Move right
|
||||
if (e.keyCode === 39 || e.keyCode === 37) {
|
||||
tabs[tabFocus].setAttribute("tabindex", -1);
|
||||
if (e.keyCode === 39) {
|
||||
tabFocus++;
|
||||
// If we're at the end, go to the start
|
||||
if (tabFocus >= tabs.length) {
|
||||
tabFocus = 0;
|
||||
}
|
||||
// Move left
|
||||
} else if (e.keyCode === 37) {
|
||||
tabFocus--;
|
||||
// If we're at the start, move to the end
|
||||
if (tabFocus < 0) {
|
||||
tabFocus = tabs.length - 1;
|
||||
}
|
||||
}
|
||||
tabs[tabFocus].setAttribute("tabindex", 0);
|
||||
tabs[tabFocus].focus();
|
||||
}
|
||||
});
|
||||
});
|
||||
function setActiveTab(target) {
|
||||
const parent = target.parentNode;
|
||||
const grandparent = parent.parentNode;
|
||||
// console.log(grandparent);
|
||||
// Remove all current selected tabs
|
||||
parent
|
||||
.querySelectorAll('[aria-selected="true"]')
|
||||
.forEach(t => t.setAttribute("aria-selected", false));
|
||||
// Set this tab as selected
|
||||
target.setAttribute("aria-selected", true);
|
||||
// Hide all tab panels
|
||||
grandparent
|
||||
.querySelectorAll('[role="tabpanel"]')
|
||||
.forEach(p => p.setAttribute("hidden", true));
|
||||
// Show the selected panel
|
||||
grandparent.parentNode
|
||||
.querySelector(`#${target.getAttribute("aria-controls")}`)
|
||||
.removeAttribute("hidden");
|
||||
}
|
||||
function changeTabs(e) {
|
||||
// get the containing list of the tab that was just clicked
|
||||
const tabList = e.target.parentNode;
|
||||
|
||||
// get all of the sibling tabs
|
||||
const buttons = Array.apply(null, tabList.querySelectorAll('button'));
|
||||
|
||||
// loop over the siblings to discover which index thje clicked one was
|
||||
const { index } = buttons.reduce(({ found, index }, button) => {
|
||||
if (!found && buttons[index] === e.target) {
|
||||
return { found: true, index };
|
||||
} else if (!found) {
|
||||
return { found, index: index + 1 };
|
||||
} else {
|
||||
return { found, index };
|
||||
}
|
||||
}, { found: false, index: 0 });
|
||||
|
||||
// get the tab container
|
||||
const container = tabList.parentNode;
|
||||
// read the data-tab-group value from the container, e.g. "os"
|
||||
const { tabGroup } = container.dataset;
|
||||
// get a list of all the tab groups that match this value on the page
|
||||
const groups = document.querySelectorAll('[data-tab-group=' + tabGroup + ']');
|
||||
|
||||
// for each of the found tab groups, find the tab button at the previously discovered index and select it for each group
|
||||
groups.forEach((group) => {
|
||||
const target = group.querySelectorAll('button')[index];
|
||||
setActiveTab(target);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
++++
|
|
@ -9,8 +9,8 @@ To stop your {es} and {kib} Docker containers, run:
|
|||
|
||||
[source,sh]
|
||||
----
|
||||
docker stop es01-test
|
||||
docker stop kib01-test
|
||||
docker stop es-node01
|
||||
docker stop kib-01
|
||||
----
|
||||
|
||||
To remove the containers and their network, run:
|
||||
|
@ -18,7 +18,7 @@ To remove the containers and their network, run:
|
|||
[source,sh]
|
||||
----
|
||||
docker network rm elastic
|
||||
docker rm es01-test
|
||||
docker rm kib01-test
|
||||
docker rm es-node01
|
||||
docker rm kib-01
|
||||
----
|
||||
// end::self-managed[]
|
||||
|
|
|
@ -21,9 +21,37 @@ Desktop].
|
|||
----
|
||||
docker network create elastic
|
||||
docker pull {docker-repo}:{version}
|
||||
docker run --name es01-test --net elastic -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" {docker-image}
|
||||
docker run --name es-node01 --net elastic -p 9200:9200 -p 9300:9300 -it {docker-image}
|
||||
----
|
||||
endif::[]
|
||||
+
|
||||
When you start {es} for the first time, the following security configuration
|
||||
occurs automatically:
|
||||
+
|
||||
--
|
||||
* <<elasticsearch-security-certificates,Certificates and keys>> are generated
|
||||
for the transport and HTTP layers.
|
||||
* The Transport Layer Security (TLS) configuration settings are written to
|
||||
`elasticsearch.yml`.
|
||||
* A password is generated for the `elastic` user.
|
||||
* An enrollment token is generated for {kib}.
|
||||
|
||||
NOTE: You might need to scroll back a bit in the terminal to view the password
|
||||
and enrollment token.
|
||||
--
|
||||
|
||||
. Copy the generated password and enrollment token and save them in a secure
|
||||
location. These values are shown only when you start {es} for the first time.
|
||||
You'll use these to enroll {kib} with your {es} cluster and log in.
|
||||
+
|
||||
[NOTE]
|
||||
====
|
||||
If you need to reset the password for the `elastic` user or other
|
||||
built-in users, run the <<reset-password,`elasticsearch-reset-password`>> tool.
|
||||
To generate new enrollment tokens for {kib} or {es} nodes, run the
|
||||
<<create-enrollment-token,`elasticsearch-create-enrollment-token`>> tool.
|
||||
These tools are available in the {es} `bin` directory.
|
||||
====
|
||||
|
||||
**Install and run {kib}**
|
||||
|
||||
|
@ -40,10 +68,16 @@ ifeval::["{release-state}"!="unreleased"]
|
|||
["source","txt",subs="attributes"]
|
||||
----
|
||||
docker pull docker.elastic.co/kibana/kibana:{version}
|
||||
docker run --name kib01-test --net elastic -p 5601:5601 -e "ELASTICSEARCH_HOSTS=http://es01-test:9200" docker.elastic.co/kibana/kibana:{version}
|
||||
docker run --name kib-01 --net elastic -p 5601:5601 docker.elastic.co/kibana/kibana:{version}
|
||||
----
|
||||
+
|
||||
When you start {kib}, a unique link is output to your terminal.
|
||||
|
||||
. To access {kib}, go to http://localhost:5601[http://localhost:5601]
|
||||
. To access {kib}, click the generated link in your terminal.
|
||||
|
||||
.. In your browser, paste the enrollment token that you copied and click the button 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}.
|
||||
|
||||
endif::[]
|
||||
// end::self-managed[]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue