导致问题:docker容器内存不足
- 执行docker stats 发现nacos容器占用过多内存(接近1G)
- 但单独运行nacos,容器能稳定运行
- docker默认只允许使用2G内存,明显不够
解决方案:设置nacos运行堆内存大小
1、可修改nacos及mysql配置yaml
version: "3"
services:
mysql:
container_name: mysql
image: mysql:5.7
environment:
- MYSQL_ROOT_PASSWORD=123456
volumes:
- /app/cloud/mysql/data:/var/lib/mysql
ports:
- "3306:3306"
restart: always
nacos:
image: nacos/nacos-server:1.4.1
container_name: nacos
hostname: nacos
restart: always
environment:
- MODE=standalone
- TZ=Asia/Shanghai
- NACOS_SERVER_PORT=8848
- SPRING_DATASOURCE_PLATFORM=mysql
- MYSQL_SERVICE_HOST=120.71.86.257
- MYSQL_