Adjustments, apt key and repo line fixes. Added OpenSearch service parameters.

This commit is contained in:
2024-04-16 13:27:41 +01:00
parent c7500358a0
commit e1858b60a8
3 changed files with 64 additions and 8 deletions

View File

@ -14,9 +14,8 @@ echo "Installing dependencies..."
# Install prerequisites for Graylog, OpenSearch, and MongoDB
apt install -y apt-transport-https openjdk-11-jre-headless uuid-runtime pwgen wget gnupg
# Function to check if the system meets the minimum requirements for Graylog
check_system_requirements() {
echo "Checking system requirements for Graylog..."
echo "Checking the minimum system requirements for Graylog..."1
# Minimum required RAM (in MB)
minimum_ram=4096
@ -60,8 +59,8 @@ echo "vm.max_map_count=262144" >> /etc/sysctl.conf
# Add the OpenSearch repository and its GPG key
echo "Adding OpenSearch repository..."
wget -qO - https://d3g5vo6xdbdb9a.cloudfront.net/GPG-KEY-opensearch | apt-key add -
echo "deb https://d3g5vo6xdbdb9a.cloudfront.net/debian stable main" | tee /etc/apt/sources.list.d/opensearch.list
curl -o- https://artifacts.opensearch.org/publickeys/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
# Add the MongoDB repository
echo "Adding MongoDB repository..."
@ -101,6 +100,11 @@ chown -R opensearch:opensearch /var/log/opensearch
chmod -R 2750 /graylog/opensearch/
chmod -R 2750 /var/log/opensearch/
# Add OpenSearch service and set it to start automatically
echo "Adding OpenSearch service and enabling autostart..."
systemctl enable opensearch
systemctl start opensearch
#Install MongoDB
echo "Installing MongoDB"
sudo apt install -y MongoDB