####安装mysql###
#下载mysql镜像#
docker pull mysql:5.7
ps:不指定版本默认下载最新版本
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
#以交互模式进入mysql控制台#
docker exec -it mysql /bin/bash
###安装redis###
docker pull redis
ps:不指定版本默认下载最新版本
mkdir -p /mydata/redis/conf
touch /mydata/redis/conf/redis.conf
docker run -p 6379:6379 --name redis -v /mydata/redis/data:/data -v /mydata/redis/conf/redis.conf:/etc/redis/redis.conf -d redis redis-server /etc/redis/redis.conf
#以交互模式进入redis客户端
docker exec -it redis redis-cli
###安装ElasticSearch###
docker pull elasticsearch:7.4.2
ps:不指定版本默认下载最新版本
mkdir -p /mydata/elasticsearch/data
mkdir -p /mydata/elasticsearch/config
echo " http.host: 0.0.0.0" >> /mydata/elasticsearch/config/elasticsearch.yml
docker run --name elasticsearch -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" -e ES_JAVA_OPTS="-Xms64m -Xmx128m" -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 -d elasticsearch:7.4.2
##安装es可视化kibana##
docker pull kibana:7.4.2
docker run --name kibana -e ELASTICSEARCH_HOSTS=http://ip:9200 -p 5601:5601 -d kibana:7.4.2