Centos服务器配置与部署过程
其他
2020-03-21 09:33:16
阅读次数: 0
Centos服务器配置与部署过程
-
安装与配置docker
1、检查内核版本,必须是3.10及以上
uname -r
2、安装docker
yum install docker
3、输入y确认安装
4、启动docker
[root@localhost ~]
[root@localhost ~]
Docker version 1.12.6, build 3e8e77d/1.12.6
5、开机启动docker
[root@localhost ~]
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.
6、停止docker
systemctl stop docker
-
docker配置加速器
vim /etc/docker/daemon.json
{
"registry-mirrors": ["https://mirror.ccs.tencentyun.com"]
}
{
"registry-mirrors": ["https://xeizattv.mirror.aliyuncs.com"]
}
wq保存退出:
执行命令生效:
systemctl daemon-reload
systemctl restart docker
-
安装docker-compose
curl -L https://github.com/docker/compose/releases/download/1.24.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
docker-compose version
-
docker-compose 配置
docker-compose up -d
docker-comose down
docker-compose logs
-
nacos 安装
git clone https://github.com/nacos-group/nacos-docker.git
cd nacos-docker
docker-compose -f example/standalone-mysql.yaml up -d
docker-compose -f example/standalone-mysql.yaml logs -f
http://地址:8848/nacos
-
安装Mysql
version: '3.1'
services:
db:
image: mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: 123456
command:
--default-authentication-plugin=mysql_native_password
--character-set-server=utf8mb4
--collation-server=utf8mb4_general_ci
--explicit_defaults_for_timestamp=true
--lower_case_table_names=1
ports:
- 3306:3306
volumes:
- ./data:/var/lib/mysql
adminer:
image: adminer
restart: always
ports:
- 8881:8881
-
安装redis
version: '3.1'
services:
redis:
image: redis
container_name: redis
restart: always
command: redis-server --requirepass 123456
ports:
- 6379:6379
volumes:
- ./redis_data:/data
-
配置tomcat
version: '3.1'
services:
tomcat:
restart: always
image: tomcat
container_name: tomcat
ports:
- 8080:8080
volumes:
- ./webapps:/usr/local/tomcat/webapps
environment:
TZ: Asia/Shanghai
-
配置 nexus
version: '3.1'
services:
nexus:
restart: always
image: sonatype/nexus3
container_name: nexus
ports:
- 8081:8081
volumes:
- nexus-data:/nexus-data
volumes:
nexus-data:
-
交互式进入容器
docker exec -it b410b15951e4 bash
-
查看容器日志
sudo docker logs -f -t --tail 100 16154cfbafcb
发布了63 篇原创文章 ·
获赞 1 ·
访问量 4097
转载自blog.csdn.net/chenhanhao0000/article/details/105003574