Skip to content

Commit 6553455

Browse files
committed
fix indentation
1 parent 68f9588 commit 6553455

File tree

7 files changed

+203
-3
lines changed

7 files changed

+203
-3
lines changed

elastic-start-local/.env

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
START_LOCAL_VERSION=0.9.0
2+
ES_LOCAL_VERSION=9.0.2
3+
ES_LOCAL_CONTAINER_NAME=es-local-dev
4+
ES_LOCAL_PASSWORD=DSoPdWqA
5+
ES_LOCAL_PORT=9200
6+
ES_LOCAL_URL=http://localhost:${ES_LOCAL_PORT}
7+
ES_LOCAL_HEAP_INIT=128m
8+
ES_LOCAL_HEAP_MAX=2g
9+
ES_LOCAL_DISK_SPACE_REQUIRED=1gb
10+
KIBANA_LOCAL_CONTAINER_NAME=kibana-local-dev
11+
KIBANA_LOCAL_PORT=5601
12+
KIBANA_LOCAL_PASSWORD=HZILuA73
13+
KIBANA_ENCRYPTION_KEY=TI41GPDRQiWy5AGFXkwZBgRdX6jlXLqq
14+
ES_LOCAL_API_KEY=NFZyNWdwY0J1NTJzTEtEdzVTQTQ6YUoyUWplZGVJMnhwNFZmSkwyMnBTZw==
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
start-local:
2+
version: 0.9.0
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
services:
2+
elasticsearch:
3+
image: docker.elastic.co/elasticsearch/elasticsearch:${ES_LOCAL_VERSION}
4+
container_name: ${ES_LOCAL_CONTAINER_NAME}
5+
volumes:
6+
- dev-elasticsearch:/usr/share/elasticsearch/data
7+
ports:
8+
- 127.0.0.1:${ES_LOCAL_PORT}:9200
9+
environment:
10+
- discovery.type=single-node
11+
- ELASTIC_PASSWORD=${ES_LOCAL_PASSWORD}
12+
- xpack.security.enabled=true
13+
- xpack.security.http.ssl.enabled=false
14+
- xpack.license.self_generated.type=trial
15+
- xpack.ml.use_auto_machine_memory_percent=true
16+
- ES_JAVA_OPTS=-Xms${ES_LOCAL_HEAP_INIT} -Xmx${ES_LOCAL_HEAP_MAX}
17+
- cluster.routing.allocation.disk.watermark.low=${ES_LOCAL_DISK_SPACE_REQUIRED}
18+
- cluster.routing.allocation.disk.watermark.high=${ES_LOCAL_DISK_SPACE_REQUIRED}
19+
- cluster.routing.allocation.disk.watermark.flood_stage=${ES_LOCAL_DISK_SPACE_REQUIRED}
20+
- "_JAVA_OPTIONS=-XX:UseSVE=0"
21+
ulimits:
22+
memlock:
23+
soft: -1
24+
hard: -1
25+
healthcheck:
26+
test:
27+
[
28+
"CMD-SHELL",
29+
"curl --output /dev/null --silent --head --fail -u elastic:${ES_LOCAL_PASSWORD} http://elasticsearch:9200",
30+
]
31+
interval: 10s
32+
timeout: 10s
33+
retries: 30
34+
35+
kibana_settings:
36+
depends_on:
37+
elasticsearch:
38+
condition: service_healthy
39+
image: docker.elastic.co/elasticsearch/elasticsearch:${ES_LOCAL_VERSION}
40+
container_name: kibana_settings
41+
restart: 'no'
42+
command: >
43+
bash -c '
44+
echo "Setup the kibana_system password";
45+
start_time=$$(date +%s);
46+
timeout=60;
47+
until curl -s -u "elastic:${ES_LOCAL_PASSWORD}" -X POST http://elasticsearch:9200/_security/user/kibana_system/_password -d "{\"password\":\"${KIBANA_LOCAL_PASSWORD}\"}" -H "Content-Type: application/json" | grep -q "^{}"; do
48+
if [ $$(($$(date +%s) - $$start_time)) -ge $$timeout ]; then
49+
echo "Error: Elasticsearch timeout";
50+
exit 1;
51+
fi;
52+
sleep 2;
53+
done;
54+
'
55+
56+
kibana:
57+
depends_on:
58+
kibana_settings:
59+
condition: service_completed_successfully
60+
image: docker.elastic.co/kibana/kibana:${ES_LOCAL_VERSION}
61+
container_name: ${KIBANA_LOCAL_CONTAINER_NAME}
62+
volumes:
63+
- dev-kibana:/usr/share/kibana/data
64+
- ./config/telemetry.yml:/usr/share/kibana/config/telemetry.yml
65+
ports:
66+
- 127.0.0.1:${KIBANA_LOCAL_PORT}:5601
67+
environment:
68+
- SERVER_NAME=kibana
69+
- ELASTICSEARCH_HOSTS=http://elasticsearch:9200
70+
- ELASTICSEARCH_USERNAME=kibana_system
71+
- ELASTICSEARCH_PASSWORD=${KIBANA_LOCAL_PASSWORD}
72+
- XPACK_ENCRYPTEDSAVEDOBJECTS_ENCRYPTIONKEY=${KIBANA_ENCRYPTION_KEY}
73+
- ELASTICSEARCH_PUBLICBASEURL=http://localhost:${ES_LOCAL_PORT}
74+
healthcheck:
75+
test:
76+
[
77+
"CMD-SHELL",
78+
"curl -s -I http://kibana:5601 | grep -q 'HTTP/1.1 302 Found'",
79+
]
80+
interval: 10s
81+
timeout: 10s
82+
retries: 30
83+
84+
volumes:
85+
dev-elasticsearch:
86+
dev-kibana:

elastic-start-local/start.sh

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/bin/sh
2+
# Start script for start-local
3+
# More information: https://github.com/elastic/start-local
4+
set -eu
5+
6+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
7+
cd "${SCRIPT_DIR}"
8+
today=$(date +%s)
9+
. ./.env
10+
# Check disk space
11+
available_gb=$(($(df -k / | awk 'NR==2 {print $4}') / 1024 / 1024))
12+
required=$(echo "${ES_LOCAL_DISK_SPACE_REQUIRED}" | grep -Eo '[0-9]+')
13+
if [ "$available_gb" -lt "$required" ]; then
14+
echo "----------------------------------------------------------------------------"
15+
echo "WARNING: Disk space is below the ${required} GB limit. Elasticsearch will be"
16+
echo "executed in read-only mode. Please free up disk space to resolve this issue."
17+
echo "----------------------------------------------------------------------------"
18+
echo "Press ENTER to confirm."
19+
read -r
20+
fi
21+
if [ -z "${ES_LOCAL_LICENSE:-}" ] && [ "$today" -gt 1752840833 ]; then
22+
echo "---------------------------------------------------------------------"
23+
echo "The one-month trial period has expired. You can continue using the"
24+
echo "Free and open Basic license or request to extend the trial for"
25+
echo "another 30 days using this form:"
26+
echo "https://www.elastic.co/trialextension"
27+
echo "---------------------------------------------------------------------"
28+
echo "For more info about the license: https://www.elastic.co/subscriptions"
29+
echo
30+
echo "Updating the license..."
31+
docker compose up --wait elasticsearch >/dev/null 2>&1
32+
result=$(curl -s -X POST "${ES_LOCAL_URL}/_license/start_basic?acknowledge=true" -H "Authorization: ApiKey ${ES_LOCAL_API_KEY}" -o /dev/null -w '%{http_code}\n')
33+
if [ "$result" = "200" ]; then
34+
echo "✅ Basic license successfully installed"
35+
echo "ES_LOCAL_LICENSE=basic" >> .env
36+
else
37+
echo "Error: I cannot update the license"
38+
result=$(curl -s -X GET "${ES_LOCAL_URL}" -H "Authorization: ApiKey ${ES_LOCAL_API_KEY}" -o /dev/null -w '%{http_code}\n')
39+
if [ "$result" != "200" ]; then
40+
echo "Elasticsearch is not running."
41+
fi
42+
exit 1
43+
fi
44+
echo
45+
fi
46+
docker compose up --wait

elastic-start-local/stop.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/sh
2+
# Stop script for start-local
3+
# More information: https://github.com/elastic/start-local
4+
set -eu
5+
6+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
7+
cd "${SCRIPT_DIR}"
8+
docker compose stop

elastic-start-local/uninstall.sh

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/bin/sh
2+
# Uninstall script for start-local
3+
# More information: https://github.com/elastic/start-local
4+
set -eu
5+
6+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
7+
8+
ask_confirmation() {
9+
echo "Do you want to continue? (yes/no)"
10+
read -r answer
11+
case "$answer" in
12+
yes|y|Y|Yes|YES)
13+
return 0 # true
14+
;;
15+
no|n|N|No|NO)
16+
return 1 # false
17+
;;
18+
*)
19+
echo "Please answer yes or no."
20+
ask_confirmation # Ask again if the input is invalid
21+
;;
22+
esac
23+
}
24+
25+
cd "${SCRIPT_DIR}"
26+
if [ ! -e "docker-compose.yml" ]; then
27+
echo "Error: I cannot find the docker-compose.yml file"
28+
echo "I cannot uninstall start-local."
29+
fi
30+
if [ ! -e ".env" ]; then
31+
echo "Error: I cannot find the .env file"
32+
echo "I cannot uninstall start-local."
33+
fi
34+
echo "This script will uninstall start-local."
35+
echo "All data will be deleted and cannot be recovered."
36+
if ask_confirmation; then
37+
docker compose rm -fsv
38+
docker compose down -v
39+
rm docker-compose.yml .env uninstall.sh start.sh stop.sh config/telemetry.yml
40+
if [ -z "$(ls -A config)" ]; then
41+
rm -d config
42+
fi
43+
echo "Start-local successfully removed"
44+
fi

x-pack/plugin/apm-data/src/main/resources/component-templates/[email protected]

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ template:
1212
ignore_malformed: true
1313
total_fields:
1414
ignore_dynamic_beyond_limit: true
15-
data_stream_options:
16-
failure_store:
17-
enabled: "true"
15+
data_stream_options:
16+
failure_store:
17+
enabled: true

0 commit comments

Comments
 (0)