This commit is contained in:
Eliezer Croitoru 2024-01-08 00:49:41 +02:00
parent 79aea6bf40
commit 5b90ae9e05
5 changed files with 32 additions and 3 deletions

View File

@ -3,7 +3,11 @@
CONFIG_FILE="/etc/opensearch/opensearch.yml"
grep 'discovery.type: single-node' "${CONFIG_FILE}" || \
echo "discovery.type: single-node" >> "${CONFIG_FILE}"
cat >> "${CONFIG_FILE}" <<EOF
discovery.type: single-node
action.auto_create_index: false
plugins.security.disabled: true
EOF
sed -i -e "s@^#cluster.name:.*@cluster.name: graylog@g" \
-e "s@^cluster.name:.*@cluster.name: graylog@g" \

View File

@ -2,5 +2,5 @@
systemctl daemon-reload
systemctl enable opensearch.service
systemctl start opensearch.service
systemctl restart opensearch.service
systemctl status opensearch.service --no-pager

View File

@ -8,5 +8,5 @@ echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu $(lsb_release
apt update && apt install mongodb-org -y
systemctl start mongod
systemctl restart mongod
systemctl enable mongod

18
0055-configure-graylog.sh Executable file
View File

@ -0,0 +1,18 @@
#!/usr/bin/env bash
CONFIG_FILE="/etc/graylog/server/server.conf"
RANDOM_PW=$(pwgen -N 1 -s 96)
sed -i -e "s@^password_secret =.*@password_secret = ${RANDOM_PW}@g" \
-e "s@^#http_bind_address = 127.0.0.1:9000@http_bind_address = 0.0.0.0:9000@g" \
-e "s@^http_bind_address = .*@http_bind_address = 0.0.0.0:9000@g" \
-e "s@^root_password_sha2 =.*@root_password_sha2 = 8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918@" \
-e "s@^#elasticsearch_hosts =.*@elasticsearch_hosts = http://127.0.0.1:9200@g" \
-e "s@^elasticsearch_hosts =.*@elasticsearch_hosts = http://127.0.0.1:9200@g" \
"${CONFIG_FILE}"
systemctl daemon-reload
systemctl restart graylog-server
systemctl enable graylog-server

View File

@ -11,8 +11,15 @@ configure-opensearch:
bash 0015-configure-opensearch.sh
bash 0019-enable-opensearch.sh
test-opensearch:
curl -X GET http://localhost:9200
install-mongodb:
bash 0020-install-mongodb.sh
install-graylog:
bash 0050-install-graylog.sh
configure-graylog:
bash 0055-configure-graylog.sh