98 lines
2.6 KiB
Bash
98 lines
2.6 KiB
Bash
#######################################
|
|
# Installation de MongoDB
|
|
#######################################
|
|
|
|
apt update
|
|
|
|
apt full-upgrade
|
|
|
|
timedatectl set-timezone Europe/Paris
|
|
|
|
apt install -y curl lsb-release ca-certificates gnupg2 pwgen wget
|
|
|
|
curl -fsSL https://www.mongodb.org/static/pgp/server-6.0.asc | sudo gpg -o /usr/share/keyrings/mongodb-server-6.0.gpg --dearmor
|
|
|
|
echo "deb [ signed-by=/usr/share/keyrings/mongodb-server-6.0.gpg] http://repo.mongodb.org/apt/debian bullseye/mongodb-org/6.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list
|
|
|
|
apt update
|
|
|
|
apt install -y mongodb-org
|
|
|
|
wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.23_amd64.deb
|
|
|
|
dpkg -i libssl1.1_1.1.1f-1ubuntu2.23_amd64.deb
|
|
|
|
apt install -y mongodb-org
|
|
|
|
systemctl daemon-reload
|
|
systemctl enable mongod.service
|
|
systemctl restart mongod.service
|
|
systemctl --type=service --state=active | grep mongod
|
|
|
|
#######################################
|
|
# Installation d'OpenSearch
|
|
#######################################
|
|
|
|
curl -o- https://artifacts.opensearch.org/publickeys/opensearch.pgp | sudo 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" | sudo tee /etc/apt/sources.list.d/opensearch-2.x.list
|
|
|
|
apt update
|
|
|
|
env OPENSEARCH_INITIAL_ADMIN_PASSWORD=IT-Connect2024! apt-get install opensearch
|
|
|
|
nano /etc/opensearch/opensearch.yml
|
|
|
|
cluster.name: graylog
|
|
node.name: ${HOSTNAME}
|
|
path.data: /var/lib/opensearch
|
|
path.logs: /var/log/opensearch
|
|
discovery.type: single-node
|
|
network.host: 127.0.0.1
|
|
action.auto_create_index: false
|
|
plugins.security.disabled: true
|
|
|
|
#######################################
|
|
# Configurer Java (JVM)
|
|
#######################################
|
|
|
|
nano /etc/opensearch/jvm.options
|
|
|
|
-Xms1g
|
|
-Xmx1g
|
|
|
|
-Xms4g
|
|
-Xmx4g
|
|
|
|
cat /proc/sys/vm/max_map_count
|
|
|
|
sysctl -w vm.max_map_count=262144
|
|
|
|
systemctl daemon-reload
|
|
systemctl enable opensearch
|
|
systemctl restart opensearch
|
|
|
|
#######################################
|
|
# Installation de Graylog
|
|
#######################################
|
|
|
|
wget https://packages.graylog2.org/repo/packages/graylog-6.1-repository_latest.deb
|
|
dpkg -i graylog-6.1-repository_latest.deb
|
|
apt update
|
|
apt install graylog-server
|
|
|
|
pwgen -N 1 -s 96
|
|
wVSGYwOmwBIDmtQvGzSuBevWoXe0MWpNWCzhorBfvMMhia2zIjHguTbfl4uXZJdHOA0EEb1sOXJTZKINhIIBm3V57vwfQV59
|
|
|
|
nano /etc/graylog/server/server.conf
|
|
|
|
echo -n "PuitsDeLogs@" | shasum -a 256
|
|
6b297230efaa2905c9a746fb33a628f4d7aba4fa9d5c1b3daa6846c68e602d71
|
|
|
|
nano /etc/graylog/server/server.conf
|
|
|
|
root_password_sha2
|
|
|
|
systemctl enable --now graylog-server
|
|
|
|
tail -f /var/log/graylog-server/server.log |