安装docker
1. 安装软件包
yum install -y yum-utils
2. 设置仓库镜像
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
3.更新包索引
yum makecache
4.安装docker ce
yum install docker-ce docker-ce-cli containerd.io
5.启动docker
systemctl start docker
6.
sudo mkdir -p /etc/docker
7.配置加速
sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors":["https://qiyb9988.mirror.aliyuncs.com"]
}
EOF
8.重启
sudo systemctl daemon-reload
sudo systemctl restart docker
常用镜像安装
1.安装mysql5.7 / 用户名root 密码123456
docker run --name mysql5.7 -p 3306:3306 -v /data/mysql/data:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=123456 -d mysql:5.7
2.安装Redis
docker run -d --name redis --restart always -p 6379:6379 -v /usr/local/redis/data:/data redis
3.安装aerospike
docker run -tid -v /opt/aerospike/data:/opt/aerospike/data -v /opt/aerospike/usr/lua:/opt/aerospike/usr/udf/lua -v /opt/aerospike/config:/opt/aerospike/etc --name aerospike1 -p 3000:3000 -p 3001:3001 -p 3002:3002 aerospike/aerospike-server /usr/bin/asd --foreground --config-file /opt/aerospike/etc/aerospike.conf
4.ES指定内存
docker run -d --name elasticsearch -p 9200:9200 -p 9300:9300 -v /home/es/data:/usr/share/elasticsearch/data -e "discovery.type=single-node" -e ES_JAVA_OPTS="-Xms64m -Xmx512m" elasticsearch:7.6.2
5.fastDfs (注意更改里面的ip)
docker run -dti --network=host --name storage -e TRACKER_SERVER=127.0.0.1:22122 -v /var/fdfs/storage:/var/fdfs -v /etc/localtime:/etc/localtime delron/fastdfs storage
6.Kafka
(1) 安装zk
docker run -d --name zookeeper -p 2181:2181 -v /etc/localtime:/etc/localtime wurstmeister/zookeeper
(2) 安装kafka (注意更改里面的ip)
docker run -d --name kafka -p 9092:9092 -e KAFKA_BROKER_ID=0 -e KAFKA_ZOOKEEPER_CONNECT=127.0.0.1:2181 -e KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://127.0.0.1:9092 -e KAFKA_LISTENERS=PLAINTEXT://0.0.0.0:9092 -t wurstmeister/kafka
7.RabbitMq / 用户名密码都是root
docker run -d --hostname my-rabbit --name rabbit -e RABBITMQ_DEFAULT_USER=root -e RABBITMQ_DEFAULT_PASS=root -p 15672:15672 -p 5672:5672 rabbitmq:management
|