Trying to export variables

This commit is contained in:
Tsvetomir Hristov 2024-10-11 11:26:08 +02:00
parent 552f3dbbe0
commit 1985110fa3
2 changed files with 19 additions and 7 deletions

View file

@ -81,5 +81,11 @@ build_container
description
msg_ok "Completed Successfully!\n"
echo -e "${APP} should be reachable on port 9200
${BL}http://${IP}:9200${CL} \n"
echo -e "${APP} is installed, you can check it's health by running:
${BL}curl -XGET --insecure --fail --user $ELASTIC_USER:$ELASTIC_PASSWORD https://localhost:$ELASTIC_PORT/_cluster/health?pretty${CL}
Elasticsearch credentials are:
User: ${BL}${ELASTIC_USER}${CL}
Password: ${BL}${ELASTIC_PASSWORD}${CL}
Enrollment and Kibana tokens were also generated for you:
Kibana Token: ${BL}${KIBANA_TOKEN}${CL}
Enrollment Token: ${BL}${ENROLLMENT_TOKEN}${CL} \n"

View file

@ -34,6 +34,13 @@ $STD apt-get update
$STD apt-get install elasticsearch
msg_ok "Installed Elastcisearch"
msg_info "Configuring User"
ELASTIC_USER=elastic
ELASTIC_PASSWORD=$(/usr/share/elasticsearch/bin/elasticsearch-reset-password -sbf -u $ELASTIC_USER)
KIBANA_TOKEN=$(/usr/share/elasticsearch/bin/elasticsearch-create-enrollment-token -s kibana)
ENROLLMENT_TOKEN=$(/usr/share/elasticsearch/bin/elasticsearch-create-enrollment-token -s node)
msg_ok "Installed Elastcisearch"
msg_info "Configuring Elasticsearch Memory"
$STD sed -i -E 's/## -Xms[0-9]+[Ggm]/-Xms3g/' /etc/elasticsearch/jvm.options
$STD sed -i -E 's/## -Xmx[0-9]+[Ggm]/-Xmx3g/' /etc/elasticsearch/jvm.options
@ -46,12 +53,9 @@ $STD /bin/systemctl start elasticsearch.service
msg_ok "Created Service"
msg_info "Checking Health"
ELASTIC_USER=elastic
ELASTIC_PASSWORD=$(/usr/share/elasticsearch/bin/elasticsearch-reset-password -u $ELASTIC_USER -b -s -f)
ELASTIC_PORT=9200
echo $ELASTIC_USER
echo $ELASTIC_PASSWORD
echo $ELASTIC_IP
echo "User: $ELASTIC_USER"
echo "Password: $ELASTIC_PASSWORD"
curl -XGET --insecure --fail --user $ELASTIC_USER:$ELASTIC_PASSWORD https://localhost:$ELASTIC_PORT/_cluster/health?pretty
msg_ok "Checked Health"
@ -62,3 +66,5 @@ msg_info "Cleaning up"
$STD apt-get -y autoremove
$STD apt-get -y autoclean
msg_ok "Cleaned"
export ELASTIC_USER ELASTIC_PASSWORD KIBANA_TOKEN ENROLLMENT_TOKEN