-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbase_install.sh
More file actions
56 lines (43 loc) · 1.46 KB
/
base_install.sh
File metadata and controls
56 lines (43 loc) · 1.46 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash
# Basic Readme operations automation
apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
apt-key fingerprint 0EBFCD88 |& grep '9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88' || echo 'Warning - fingerprint nod match, see https://docs.docker.com/install/linux/docker-ce/ubuntu/'
add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
apt-get update
apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose
docker run hello-world |& grep 'Hello from Docker' || echo 'Error - docker hello-world failed'
echo \
'{
"metrics-addr" : "0.0.0.0:9323",
"experimental" : true,
"log-driver": "json-file",
"log-opts": {
"max-size": "10m",
"max-file": "3"
}
}' > /etc/docker/daemon.json
systemctl restart docker.service
apt install -y apache2-utils
cd /data/monitoring/prometheus
cp add_variables.sh.example add_variables.sh
bash ./add_variables.sh
# Create storage directories
mkdir prometheus/storage/
mkdir grafana/storage/
mkdir alertmanager/storage/
chmod -R 777 */storage/
# Install and run as service
cp docker_monitoring.service /etc/systemd/system/
systemctl daemon-reload
systemctl enable docker_monitoring.service
systemctl restart docker_monitoring.service
journalctl -f -u docker_monitoring.service