fix: rename endpoint in configs and scripts with patter .local

This commit is contained in:
Denis Tarasov
2022-12-26 16:33:00 +03:00
parent bff72b7cfa
commit d329bcba3e
5 changed files with 19 additions and 19 deletions
@@ -16,7 +16,7 @@ datasources:
# <string, required> access mode. proxy or direct (Server or Browser in the UI). Required
access: Server
# <string> url
url: http://victoriametrics:8428
url: http://victoriametrics.local:8428
# <string> Deprecated, use secureJsonData.password
version: 1
# <bool> allow users to edit datasources from the UI.
@@ -27,7 +27,7 @@ datasources:
# <string, required> access mode. proxy or direct (Server or Browser in the UI). Required
access: Server
# <string> url
url: http://jaeger:16686
url: http://jaeger.local:16686
# <string> Deprecated, use secureJsonData.password
version: 1
# <bool> allow users to edit datasources from the UI.
+1 -1
View File
@@ -51,7 +51,7 @@ es:
password: PASSWORD-TEMPLATE
remote-read-clusters: ""
send-get-body-as: ""
server-urls: http://elasticsearch:9200
server-urls: http://elasticsearch.local:9200
sniffer: false
sniffer-tls-enabled: false
tags-as-fields:
+5 -5
View File
@@ -23,15 +23,15 @@ receivers:
- job_name: 'otel-collector'
scrape_interval: 10s
static_configs:
- targets: ['node-exporter:9100']
- targets: ['node-exporter.local:9100']
- job_name: 'otel-elastic'
scrape_interval: 10s
static_configs:
- targets: ['elasticsearch_exporter:9114']
- targets: ['elasticsearch-exporter.local:9114']
- job_name: 'jaeger-collector'
scrape_interval: 10s
static_configs:
- targets: ['jaeger:14269']
- targets: ['jaeger.local:14269']
processors:
batch:
@@ -42,11 +42,11 @@ exporters:
logging:
loglevel: error
jaeger:
endpoint: "jaeger:14250"
endpoint: "jaeger.local:14250"
tls:
insecure: true
prometheusremotewrite:
endpoint: "http://victoriametrics:8428/api/v1/write"
endpoint: "http://victoriametrics.local:8428/api/v1/write"
service:
pipelines:
+4 -4
View File
@@ -5,7 +5,7 @@ cp /opt/soldr_observability/config/elasticsearch/* /usr/share/elasticsearch/conf
chmod -R 0775 /usr/share/elasticsearch/config
while true; do
RETURNCODE=$(curl -s -o return_code.txt -w "%{http_code}" "http://elasticsearch:9200/")
RETURNCODE=$(curl -s -o return_code.txt -w "%{http_code}" "http://elasticsearch.local:9200/")
if [ $RETURNCODE == "401" ]; then
echo "Connect to Elasticsearch was successful"
break
@@ -20,7 +20,7 @@ if [[ -f /usr/share/elasticsearch/config/passfile && $(cat /usr/share/elasticsea
ELASTIC_PASS=$(cat /usr/share/elasticsearch/config/passfile)
if [[ $MASTER_PASSWORD == $ELASTIC_PASS ]]; then
echo "MASTER_PASSWORD env and password in /usr/share/elasticsearch/config/passfile is equel"
RETURNCODE=$(curl -s -o return_code.txt -w "%{http_code}" -u "elastic:$ELASTIC_PASS" "http://elasticsearch:9200/_xpack/security/_authenticate")
RETURNCODE=$(curl -s -o return_code.txt -w "%{http_code}" -u "elastic:$ELASTIC_PASS" "http://elasticsearch.local:9200/_xpack/security/_authenticate")
if [[ $RETURNCODE != "200" ]]; then
echo "Password in /usr/share/elasticsearch/config/passfile is incorrect"
else
@@ -28,7 +28,7 @@ if [[ -f /usr/share/elasticsearch/config/passfile && $(cat /usr/share/elasticsea
fi
else
echo "Change password to MASTER_PASSWORD env"
RETURNCODE=$(curl -s -o return_code.txt -w "%{http_code}" -XPOST -u elastic:$ELASTIC_PASS 'http://elasticsearch:9200/_security/user/elastic/_password?pretty' -H 'Content-Type: application/json' -d '{"password": "'"$MASTER_PASSWORD"'"}')
RETURNCODE=$(curl -s -o return_code.txt -w "%{http_code}" -XPOST -u elastic:$ELASTIC_PASS 'http://elasticsearch.local:9200/_security/user/elastic/_password?pretty' -H 'Content-Type: application/json' -d '{"password": "'"$MASTER_PASSWORD"'"}')
if [[ $RETURNCODE != "200" ]]; then
echo "Change password failed"
else
@@ -44,7 +44,7 @@ else
date +%s | sha256sum | base64 | head -c 20 > /usr/share/elasticsearch/config/passfile
fi
ELASTIC_PASS=$(cat /usr/share/elasticsearch/config/passfile)
RETURNCODE=$(curl -s -o return_code.txt -w "%{http_code}" -XPOST -u elastic:changeme 'http://elasticsearch:9200/_security/user/elastic/_password?pretty' -H 'Content-Type: application/json' -d '{"password": "'"$ELASTIC_PASS"'"}')
RETURNCODE=$(curl -s -o return_code.txt -w "%{http_code}" -XPOST -u elastic:changeme 'http://elasticsearch.local:9200/_security/user/elastic/_password?pretty' -H 'Content-Type: application/json' -d '{"password": "'"$ELASTIC_PASS"'"}')
if [[ $RETURNCODE != "200" ]]; then
echo "Change password failed"
else
+7 -7
View File
@@ -74,7 +74,7 @@ echo "Check Elasticsearch"
while true; do
RETURN_CODE=$(curl -s -o return_code -w "%{http_code}" \
-u elastic:$ELASTIC_PASS \
-k 'http://elasticsearch:9200/_cluster/health?wait_for_status=yellow&timeout=50s&pretty')
-k 'http://elasticsearch.local:9200/_cluster/health?wait_for_status=yellow&timeout=50s&pretty')
if [[ $RETURN_CODE != 200 ]]; then
echo "Waiting for Elasticsearch ..."
sleep 1
@@ -85,29 +85,29 @@ while true; do
done
echo "Check ILM policy for Jaeger"
ELASTIC_ILM_POLICY_RETURN_CODE=$(curl -u elastic:$ELASTIC_PASS -s 'http://elasticsearch:9200/_ilm/policy/jaeger-ilm-policy?pretty' | jq -r '.["jaeger-ilm-policy"].version')
ELASTIC_ILM_POLICY_RETURN_CODE=$(curl -u elastic:$ELASTIC_PASS -s 'http://elasticsearch.local:9200/_ilm/policy/jaeger-ilm-policy?pretty' | jq -r '.["jaeger-ilm-policy"].version')
if [[ $ELASTIC_ILM_POLICY_RETURN_CODE == null ]]; then
echo "Create ILM policy for Jaeger"
ELASTIC_CREATE_ILM_RETURN_CODE=$(curl -X PUT -u elastic:$ELASTIC_PASS -s 'http://elasticsearch:9200/_ilm/policy/jaeger-ilm-policy' \
ELASTIC_CREATE_ILM_RETURN_CODE=$(curl -X PUT -u elastic:$ELASTIC_PASS -s 'http://elasticsearch.local:9200/_ilm/policy/jaeger-ilm-policy' \
-H 'Content-Type: application/json; charset=utf-8' \
-d '{"policy": {"phases": {"hot": {"min_age": "0ms","actions": {"rollover": {"max_age": "1d"},"set_priority": {"priority": 100}}},"delete": {"min_age": "14d","actions": {"delete": {}}}}}}' | jq -r '.acknowledged')
if [[ $ELASTIC_CREATE_ILM_RETURN_CODE == "true" ]]; then
echo "ILM policy for Jaeger created successfully"
echo "Create Jaeger index temptlate jaeger-span, jaeger-service, jaeger-dependencies"
JAEGER_SPAN_INDEX_TEMPLATE_RETURN_CODE=$(curl -X PUT -u elastic:$ELASTIC_PASS -s 'http://elasticsearch:9200/_template/jaeger-span' \
JAEGER_SPAN_INDEX_TEMPLATE_RETURN_CODE=$(curl -X PUT -u elastic:$ELASTIC_PASS -s 'http://elasticsearch.local:9200/_template/jaeger-span' \
-H 'Content-Type: application/json; charset=utf-8' \
-d '{"index_patterns":["jaeger-span-*"],"settings":{"index":{"lifecycle":{"name":"jaeger-ilm-policy","rollover_alias":"jaeger-span-write"},"mapping":{"nested_fields":{"limit":"50"}},"requests":{"cache":{"enable":"true"}},"number_of_shards":"1","number_of_replicas":"0"}},"mappings":{"dynamic_templates":[{"span_tags_map":{"path_match":"tag.*","mapping":{"ignore_above":256,"type":"keyword"}}},{"process_tags_map":{"path_match":"process.tag.*","mapping":{"ignore_above":256,"type":"keyword"}}}],"properties":{"traceID":{"ignore_above":256,"type":"keyword"},"process":{"properties":{"tag":{"type":"object"},"serviceName":{"ignore_above":256,"type":"keyword"},"tags":{"dynamic":false,"type":"nested","properties":{"tagType":{"ignore_above":256,"type":"keyword"},"value":{"ignore_above":256,"type":"keyword"},"key":{"ignore_above":256,"type":"keyword"}}}}},"startTimeMillis":{"format":"epoch_millis","type":"date"},"references":{"dynamic":false,"type":"nested","properties":{"traceID":{"ignore_above":256,"type":"keyword"},"spanID":{"ignore_above":256,"type":"keyword"},"refType":{"ignore_above":256,"type":"keyword"}}},"flags":{"type":"integer"},"operationName":{"ignore_above":256,"type":"keyword"},"parentSpanID":{"ignore_above":256,"type":"keyword"},"tags":{"dynamic":false,"type":"nested","properties":{"tagType":{"ignore_above":256,"type":"keyword"},"value":{"ignore_above":256,"type":"keyword"},"key":{"ignore_above":256,"type":"keyword"}}},"spanID":{"ignore_above":256,"type":"keyword"},"duration":{"type":"long"},"startTime":{"type":"long"},"tag":{"type":"object"},"logs":{"dynamic":false,"type":"nested","properties":{"fields":{"dynamic":false,"type":"nested","properties":{"tagType":{"ignore_above":256,"type":"keyword"},"value":{"ignore_above":256,"type":"keyword"},"key":{"ignore_above":256,"type":"keyword"}}},"timestamp":{"type":"long"}}}}},"aliases":{"jaeger-span-read":{}}}' | jq -r '.acknowledged')
JAEGER_SERVICE_INDEX_TEMPLATE_RETURN_CODE=$(curl -X PUT -u elastic:$ELASTIC_PASS -s 'http://elasticsearch:9200/_template/jaeger-service' \
JAEGER_SERVICE_INDEX_TEMPLATE_RETURN_CODE=$(curl -X PUT -u elastic:$ELASTIC_PASS -s 'http://elasticsearch.local:9200/_template/jaeger-service' \
-H 'Content-Type: application/json; charset=utf-8' \
-d '{"index_patterns":["jaeger-service-*"],"settings":{"index":{"lifecycle":{"name":"jaeger-ilm-policy","rollover_alias":"jaeger-service-write"},"mapping":{"nested_fields":{"limit":"50"}},"requests":{"cache":{"enable":"true"}},"number_of_shards":"1","number_of_replicas":"0"}},"mappings":{"dynamic_templates":[{"span_tags_map":{"path_match":"tag.*","mapping":{"ignore_above":256,"type":"keyword"}}},{"process_tags_map":{"path_match":"process.tag.*","mapping":{"ignore_above":256,"type":"keyword"}}}],"properties":{"operationName":{"ignore_above":256,"type":"keyword"},"serviceName":{"ignore_above":256,"type":"keyword"}}},"aliases":{"jaeger-service-read":{}}}' | jq -r '.acknowledged')
if [[ $JAEGER_SPAN_INDEX_TEMPLATE_RETURN_CODE == "true" && $JAEGER_SERVICE_INDEX_TEMPLATE_RETURN_CODE == "true" ]]; then
echo "Jaeger index template created successfully"
echo "Create Jaeger indexes"
JAEGER_SPAN_INDEX_RETURN_CODE=$(curl -X PUT -u elastic:$ELASTIC_PASS -s 'http://elasticsearch:9200/jaeger-span-000001' \
JAEGER_SPAN_INDEX_RETURN_CODE=$(curl -X PUT -u elastic:$ELASTIC_PASS -s 'http://elasticsearch.local:9200/jaeger-span-000001' \
-H 'Content-Type: application/json; charset=utf-8' \
-d '{"aliases" : {"jaeger-span-write": {"is_write_index": "true"}},"settings" : {"number_of_shards" : 1,"number_of_replicas" : 0}}' | jq -r '.acknowledged')
JAEGER_SERVICE_INDEX_RETURN_CODE=$(curl -X PUT -u elastic:$ELASTIC_PASS -s 'http://elasticsearch:9200/jaeger-service-000001' \
JAEGER_SERVICE_INDEX_RETURN_CODE=$(curl -X PUT -u elastic:$ELASTIC_PASS -s 'http://elasticsearch.local:9200/jaeger-service-000001' \
-H 'Content-Type: application/json; charset=utf-8' \
-d '{"aliases" : {"jaeger-service-write": {"is_write_index": "true"}},"settings" : {"number_of_shards" : 1,"number_of_replicas" : 0}}' | jq -r '.acknowledged')
if [[ $JAEGER_SPAN_INDEX_RETURN_CODE == "true" && $JAEGER_SERVICE_INDEX_RETURN_CODE == "true" ]];then