From 7bd6bd7806b1c2ac5f3789bd353177a352516df7 Mon Sep 17 00:00:00 2001 From: Harun Baris Bulut Date: Sun, 24 Dec 2023 16:26:10 +0300 Subject: [PATCH] ubuntu disk resize added & graylog 5 install fixed --- .idea/.gitignore | 8 ++++++++ .idea/bash-library.iml | 8 ++++++++ .idea/modules.xml | 8 ++++++++ .idea/php.xml | 19 +++++++++++++++++++ .idea/vcs.xml | 6 ++++++ maintenance/disk/resize/ubuntu20.sh | 27 +++++++++++++++++++++++++++ setup/graylog5/readme.md | 8 ++++++++ setup/graylog5/ubuntu20-04.sh | 9 +++++++++ 8 files changed, 93 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 .idea/bash-library.iml create mode 100644 .idea/modules.xml create mode 100644 .idea/php.xml create mode 100644 .idea/vcs.xml create mode 100644 maintenance/disk/resize/ubuntu20.sh create mode 100644 setup/graylog5/readme.md diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/bash-library.iml b/.idea/bash-library.iml new file mode 100644 index 0000000..c956989 --- /dev/null +++ b/.idea/bash-library.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..2d7ba58 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/php.xml b/.idea/php.xml new file mode 100644 index 0000000..f324872 --- /dev/null +++ b/.idea/php.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/maintenance/disk/resize/ubuntu20.sh b/maintenance/disk/resize/ubuntu20.sh new file mode 100644 index 0000000..dcb64c2 --- /dev/null +++ b/maintenance/disk/resize/ubuntu20.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash +# @copyright This script is taken from the page https://superuser.com/questions/332252/how-to-create-and-format-a-partition-using-a-bash-script + +# This script will extend the root partition. Do not use if the volume is built with LVM + +# Assigning out default partition as /dev/xvda3 because we are using this partition in PlusClouds +VOL="${VARIABLE:-/dev/xvda}" + +# to create the partitions programatically (rather than manually) +# we're going to simulate the manual input to fdisk +# The sed script strips off all the comments so that we can +# document what we're doing in-line with the actual commands +# Note that a blank line (commented as "defualt" will send a empty +# line terminated with a newline to take the fdisk default. +sed -e 's/\s*\([\+0-9a-zA-Z]*\).*/\1/' << EOF | fdisk ${VOL} + d # delete the partition + 3 # selecting partition 3 for this + n # new partition + p # primary partition + 3 # partition number 3 + # enter to select minimum block + # enret to select the maximum block + w # write to partition table + q # and we're done +EOF + +resize2fs /dev/xvda3 diff --git a/setup/graylog5/readme.md b/setup/graylog5/readme.md new file mode 100644 index 0000000..4ce828d --- /dev/null +++ b/setup/graylog5/readme.md @@ -0,0 +1,8 @@ +# Graylog 5 +This group of scripts installs graylog on to an empty machine without using containers. + +# Logs + +- December 24, 2023, initial deployment test made +- December 24, 2023, [BUG] mongodb is not running +- December 24, 2023, mongodb fix made \ No newline at end of file diff --git a/setup/graylog5/ubuntu20-04.sh b/setup/graylog5/ubuntu20-04.sh index 7471b42..0c3969a 100644 --- a/setup/graylog5/ubuntu20-04.sh +++ b/setup/graylog5/ubuntu20-04.sh @@ -40,6 +40,15 @@ echo "Generated hash: $HASH" sed -i "s/password_secret =/password_secret = $PASSWORD/" /etc/graylog/server/server.conf sed -i "s/root_password_sha2 =/root_password_sha2 = $HASH/" /etc/graylog/server/server.conf +sed -i "s/#http_bind_address = 127.0.0.1:9000/http_bind_address = 0.0.0.0:9000/" /etc/graylog/server/server.conf + +sudo mkdir -p /var/run/mongodb +sudo chown mongodb:mongodb /var/run/mongodb +sudo chmod 0755 /var/run/mongodb +sudo mkdir -p /var/lib/mongo +sudo chown mongodb:mongodb /var/lib/mongo +sudo chmod 0700 /var/lib/mongo + sudo systemctl daemon-reload sudo systemctl enable graylog-server.service