-
Notifications
You must be signed in to change notification settings - Fork 1
/
server.sh
88 lines (77 loc) · 2.14 KB
/
server.sh
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/bin/bash
## author by wjl
## wechat wjl695788976
##### 删除none镜像
# shellcheck disable=SC2046
docker rmi $(docker images | grep "none" | awk '{print $3}')
#### nginx 服务
docker stop nginx
docker rm nginx
docker run -itd --net=host \
-p 80:80 \
-p 443:443 \
--name nginx --restart=always -e TZ="Asia/Shanghai" \
-v /docker/nginx/html:/usr/share/nginx/html:ro \
-v /docker/nginx/conf.d:/etc/nginx/conf.d:ro \
-v /docker/nginx/log:/var/log/nginx \
nginx
#### mysql 服务
docker stop mysql
docker rm mysql
docker run --net=host --name mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=123456 -v /docker/mysql:/var/lib/mysql -itd mysql:5.7
##### redis 服务
docker stop redis
docker rm redis
echo "Start Redis Service..."
docker run --net=host --name redis -itd \
--publish 6379:6379 \
--env 'REDIS_PASSWORD=123456' \
--volume /docker/redis:/var/lib/redis \
sameersbn/redis:latest
#### etcd 服务
docker stop etcd && \
docker rm etcd || true && \
docker run --net=host -itd \
-p 2379:2379 \
-p 2380:2380 \
--mount type=bind,source=/docker/etcd,destination=/etcd-data \
--name etcd \
quay.io/coreos/etcd \
/usr/local/bin/etcd \
--name s1 \
--data-dir /etcd-data \
--listen-client-urls https://0.0.0.0:2379 \
--advertise-client-urls https://0.0.0.0:2379 \
--listen-peer-urls https://0.0.0.0:2380 \
--initial-advertise-peer-urls https://0.0.0.0:2380 \
--initial-cluster s1=https://0.0.0.0:2380 \
--initial-cluster-token tkn \
--initial-cluster-state new
#### jaeger服务
docker stop jaeger
docker rm jaeger
docker run -itd --net=host --name jaeger \
-e COLLECTOR_ZIPKIN_HTTP_PORT=9411 \
-p 5775:5775/udp \
-p 6831:6831/udp \
-p 6832:6832/udp \
-p 5778:5778 \
-p 16686:16686 \
-p 14268:14268 \
-p 9411:9411 \
jaegertracing/all-in-one:latest
#### prometheus服务
docker stop prometheus
docker rm prometheus
docker run -itd --net=host \
--name prometheus \
-p 9090:9090 \
-v /docker/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml \
prom/prometheus
#### grafana服务
docker stop grafana
docker rm grafana
docker run -itd --net=host \
--name=grafana \
-p 3000:3000 \
grafana/grafana