1
This commit is contained in:
commit
79aea6bf40
6
0001-install-deps.sh
Executable file
6
0001-install-deps.sh
Executable file
@ -0,0 +1,6 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
apt update
|
||||||
|
apt install -y wget apt-transport-https gnupg2 software-properties-common
|
||||||
|
|
||||||
|
apt install -y vim apt-transport-https uuid-runtime pwgen curl dirmngr
|
12
0010-install-opensearch.sh
Executable file
12
0010-install-opensearch.sh
Executable file
@ -0,0 +1,12 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
wget "https://artifacts.opensearch.org/publickeys/opensearch.pgp" -O "opensearch.pgp"
|
||||||
|
cat "opensearch.pgp"| gpg --dearmor --batch --yes -o /usr/share/keyrings/opensearch-keyring
|
||||||
|
|
||||||
|
echo "deb [signed-by=/usr/share/keyrings/opensearch-keyring] https://artifacts.opensearch.org/releases/bundle/opensearch/2.x/apt stable main" | tee /etc/apt/sources.list.d/opensearch-2.x.list
|
||||||
|
|
||||||
|
apt update && apt install opensearch -y
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
34
0015-configure-opensearch.sh
Executable file
34
0015-configure-opensearch.sh
Executable file
@ -0,0 +1,34 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
CONFIG_FILE="/etc/opensearch/opensearch.yml"
|
||||||
|
|
||||||
|
grep 'discovery.type: single-node' "${CONFIG_FILE}" || \
|
||||||
|
echo "discovery.type: single-node" >> "${CONFIG_FILE}"
|
||||||
|
|
||||||
|
sed -i -e "s@^#cluster.name:.*@cluster.name: graylog@g" \
|
||||||
|
-e "s@^cluster.name:.*@cluster.name: graylog@g" \
|
||||||
|
-e "s@^#node.name:.*@node.name: ${HOSTNAME}@g" \
|
||||||
|
-e "s@^node.name:.*@node.name: ${HOSTNAME}@g" \
|
||||||
|
-e "s@^#path.data:.*@path.data: /var/lib/opensearch@g" \
|
||||||
|
-e "s@^path.data:.*@path.data: /var/lib/opensearch@g" \
|
||||||
|
-e "s@^#path.log:.*@path.log: /var/log/opensearch@g" \
|
||||||
|
-e "s@^path.log:.*@path.log: /var/log/opensearch@g" \
|
||||||
|
-e "s@^#discovery.type:.*@discovery.type: single-node@g" \
|
||||||
|
-e "s@^discovery.type:.*@discovery.type: single-node@g" \
|
||||||
|
-e "s@^#network.host:.*@network.host: 0.0.0.0@g" \
|
||||||
|
-e "s@^network.host:.*@network.host: 0.0.0.0@g" \
|
||||||
|
-e "s@^#action.auto_create_index:.*@action.auto_create_index: false@g" \
|
||||||
|
-e "s@^action.auto_create_index:.*@action.auto_create_index: false@g" \
|
||||||
|
-e "s@^#plugins.security.disabled:.*@plugins.security.disabled: true@g" \
|
||||||
|
-e "s@^plugins.security.disabled:.*@plugins.security.disabled: true@g" \
|
||||||
|
"${CONFIG_FILE}"
|
||||||
|
|
||||||
|
|
||||||
|
sed -i -e "s@^\-Xms1g@-Xms4g@g" \
|
||||||
|
-e "s@^\-Xmx1g@-Xmx4g@g" \
|
||||||
|
"/etc/opensearch/jvm.options"
|
||||||
|
|
||||||
|
echo 'vm.max_map_count=262144' > /etc/sysctl.conf.d/010-opensearch.conf
|
||||||
|
sysctl --system
|
||||||
|
|
||||||
|
|
6
0019-enable-opensearch.sh
Executable file
6
0019-enable-opensearch.sh
Executable file
@ -0,0 +1,6 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
systemctl daemon-reload
|
||||||
|
systemctl enable opensearch.service
|
||||||
|
systemctl start opensearch.service
|
||||||
|
systemctl status opensearch.service --no-pager
|
12
0020-install-mongodb.sh
Executable file
12
0020-install-mongodb.sh
Executable file
@ -0,0 +1,12 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
wget "https://www.mongodb.org/static/pgp/server-6.0.asc"
|
||||||
|
cat "server-6.0.asc" | gpg --dearmor -o /etc/apt/trusted.gpg.d/mongodb-6.gpg
|
||||||
|
|
||||||
|
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu $(lsb_release -cs)/mongodb-org/6.0 multiverse" | \
|
||||||
|
tee /etc/apt/sources.list.d/mongodb-org-6.0.list
|
||||||
|
|
||||||
|
apt update && apt install mongodb-org -y
|
||||||
|
|
||||||
|
systemctl start mongod
|
||||||
|
systemctl enable mongod
|
10
0050-install-graylog.sh
Executable file
10
0050-install-graylog.sh
Executable file
@ -0,0 +1,10 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
wget "https://packages.graylog2.org/repo/packages/graylog-5.2-repository_latest.deb" \
|
||||||
|
-O "graylog-5.2-repository_latest.deb"
|
||||||
|
|
||||||
|
apt install -y ./graylog-5.2-repository_latest.deb
|
||||||
|
|
||||||
|
apt update
|
||||||
|
apt install graylog-server -y
|
||||||
|
|
18
Makefile
Normal file
18
Makefile
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
all:
|
||||||
|
echo OK
|
||||||
|
|
||||||
|
install-deps:
|
||||||
|
bash 0001-install-deps.sh
|
||||||
|
|
||||||
|
install-opensearch:
|
||||||
|
bash 0010-install-opensearch.sh
|
||||||
|
|
||||||
|
configure-opensearch:
|
||||||
|
bash 0015-configure-opensearch.sh
|
||||||
|
bash 0019-enable-opensearch.sh
|
||||||
|
|
||||||
|
install-mongodb:
|
||||||
|
bash 0020-install-mongodb.sh
|
||||||
|
|
||||||
|
install-graylog:
|
||||||
|
bash 0050-install-graylog.sh
|
Loading…
Reference in New Issue
Block a user