-
Notifications
You must be signed in to change notification settings - Fork 9
/
setup_gather
executable file
·35 lines (27 loc) · 1.05 KB
/
setup_gather
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/bash
#Script to setup VM
apt update && apt -y upgrade
groupadd -r mongodb && useradd -r -g mongodb mongodb
apt update && DEBIAN_FRONTEND='noninteractive' apt install -y wget curl gnupg apt-transport-https
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4
wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | apt-key add -
echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.4 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-4.4.list
apt update
apt install -y mongodb-org-shell mongodb-org-server \
mongodb-org-tools mongodb-org-mongos \
libssl-dev \
libcurl4-openssl-dev \
openssh-server \
lsof sudo \
vim \
git \
curl lsb-release \
vim-runtime tmux zsh zip \
python3-pymongo python3-requests
rm -rf /var/lib/apt/lists/*
rm -f /usr/local/bin/systemctl
rm -rf /var/lib/mongodb
mv /etc/mongod.conf /etc/mongod.conf.orig
mkdir -p /data/db /data/configdb \
&& chown -R mongodb:mongodb /data/db /data/configdb
return 0