Docker安装Redis

mkdir -pv /mydata/redis/{conf,data}
cat >> /mydata/redis/conf/redis.conf <<EOF
# 添加如下内容
appendonly yes
EOF
docker run -p 6379:6379 --name redis -v /mydata/redis/conf/redis.conf:/etc/redis/redis.conf -v /mydata/redis/data:/data -d redis redis-server /etc/redis/redis.conf --appendonly yes

Docker安装RabbitMQ

docker run -d --name rabbitmq -p 5671:5671 -p 5672:5672 -p 4369:4369 -p 25672:25672 -p 15671:15671 -p 15672:15672 rabbitmq:management

Docker安装Nginx

docker run -p 80:80 --name nginx -v /mydata/nginx/html:/usr/share/nginx/html -v /mydata/nginx/logs:/var/log/nginx -v /mydata/nginx/conf/:/etc/nginx -d nginx:1.10

Docker安装ElasticSearch

mkdir  -pv /mydata/elasticsearch/{config,data,plugins/ik}

wget  -P /mydata/elasticsearch/plugins  https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v7.4.2/elasticsearch-analysis-ik-7.4.2.zip

unzip elasticsearch-analysis-ik-7.4.2.zip

cd /mydata/elasticsearch/plugin

cp elasticsearch-analysis-ik ./ik

docker run --name elasticsearch -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" -e ES_JAVA_OPTS="-Xms64m -Xmx512m" -v /mydata/elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml -v /mydata/elasticsearch/data/:/usr/share/elasticsearch/data -v /mydata/elasticsearch/plugins:/usr/share/elasticsearch/plugins --restart=always -d elasticsearch:7.4.2 && docker logs -f  elasticsearch

docker run --name kibana -e ELASTICSEARCH_HOSTS=http://11.1.1.21:9200 -p 5601:5601  --restart=always -d kibana:7.4.2 && docker logs -f  kibana

chmod -R /mydataelasticsearch

docker安装MySQL

docker run -p 3306:3306 --name mysql -v /mydata/mysql/log:/var/log/mysql -v /mydata/mysql/data:/var/lib/mysql -v /mydata/mysql/conf:/etc/mysql -e MYSQL_ROOT_PASSWORD=root -d mysql:5.7

docker 安装FastdFS

TRACKER_IP: 为宿主机IP

docker run -d --name tracker --net=host morunchang/fastdfs sh tracker.sh
docker run -d --name storage --net=host -e TRACKER_IP=11.1.1.21:22122 -e GOURP_NAME=group1 morunchang/fastdfs sh storage.sh
docker update --restart=always tracker
docker update --restart=always storage

docker 安装nacos

docker run --name nacos \
-e MODE=standalone \
-e TZ="Asia/Shanghai" \
-e SPRING_DATASOURCE_PLATFORM=mysql \
-e MYSQL_SERVICE_HOST=11.1.1.21 \
-e MYSQL_SERVICE_USER=root \
-e MYSQL_SERVICE_PASSWORD=root \
-e MYSQL_SERVICE_DB_NAME=nacos_config \
-e MYSQL_DATABASE_NUM=1 \
--restart=always \
-v /home/nacos/logs/:/mydata/nacos/logs \
-p 8848:8848 \
-d nacos/nacos-server && docker logs -f nacos

docker 安装 yapi

docker run -it --rm  --link mongo-yapi:mongo  --entrypoint npm  --workdir /api/vendors --restart=always  registry.cn-hangzhou.aliyuncs.com/anoy/yapi  run install-server
docker run -d  --name yapi  --link mongo-yapi:mongo  --workdir /api/vendors  -p 3000:3000  --restart=always registry.cn-hangzhou.aliyuncs.com/anoy/yapi  server/app.js

docker 安装zookeeper

docker run -d --name zookeeper -p 2181:2181 -d zookeeper

docker 安装mycat

mkdir -pv /mydata/mycat/{conf,logs}
docker run -d --name mycat -p 8066:8066 -v /mydata/mycat/conf/:/usr/local/mycat/conf -v /mydata/mycat/logs/:/usr/local/mycat/logs --restart=always longhronshens/mycat-docker

docker 安装 clickhouse-server


	TODO

docker 创建自定义网络

# 创建一个自定义的桥接网络  名称为:mynet
docker network create --driver bridge \
--subnet=172.25.0.0/16 \
--gateway=172.25.0.1 mynet   
# 查看自定义网络
docker network inspect mynet

docker 安装固定IP的centos:7 以后搭建mysql 集群使用

docker pull centos:7

docker run -d --name mysql-cluster-master \
-h mysql-cluster-master \
-p 20022:22 -p23306:3306 \
-p 23310-23320:3310:3320 \
--network=mynet \
--ip 172.25.0.11 --privileged=true \
centos:7 /usr/sbin/init