记一次docker-compose启动报错的排查过程
1.动dolphinscheduler所有服务,指定profile为all$ docker-compose --profile all up -d执行后查看容器没有启动起来2.查看日志 docker logs 对应的容器 There is insufficient memory for the Java Runtime Environment to continue.Cannot create GC thread. Out of system resources.3.以为是内存限制--查看Linux 的内存 free -h 发现内存还有很多以为是源码的配置文件问题,find ./ -type f -name jvm_args_env.shfind ./ -type f -name dolphinscheduler_env.sh4.启动后还用这么多内存--修改源码的配置文件不起作用查看镜像的变量方式首先,运行一个临时的容器(但不启动默认命令):docker run -d --name temp_container [镜像名] tail -f /dev/null这里tail -f /dev/null确保容器不会立即退出。然后,使用docker exec来查看文件:docker exec temp_container ls /path/to/file或者查看文件内容:docker exec temp_container cat /path/to/file最后,停止并移除临时容器:docker stop temp_containerdocker rm temp_container 果然镜像内的配置文件已存在
5.那就覆盖配置文件 覆盖配置文件services:app:image: your-imagevolumes:- ./config.yml:/app/config/config.yml
6.重启后,配置文件生效,但问题还是存在-查询 有参考文献指出Seccomp 是一种安全机制,通过禁止在执行过程中进行的系统调用来帮助程序员将自己的程序沙箱化. 我们将看到3种使用seccomp的方法 ,Seccomp(Secure Computing Mode)是一种内核安全机制,用来限制容器内的程序可以调用哪些系统调用(Syscalls)特权容器(--privileged)直接绕过 Seccomp,无法配置任何策略。Seccomp Capabilities作用 限制系统调用(Syscalls)。 限制操作权限(Privileges) 修改docker-compose.yml--增加security_opt:- seccomp:unconfined
7.发现可以启动服务了8.探查原理和更合理的解决方式Docker 容器中,Seccomp(Secure Computing Mode) 是一种内核安全机制,用来限制容器内的程序可以调用哪些系统调用(Syscalls)特权容器(Privileged Container)是 Docker 中一种特殊模式,启动时通过 --privileged 参数开启:特权容器的权限设计初衷是为了绕过所有安全限制,因此它会自动禁用 Seccomp9.过程中的收获 docker update 可以更新环境变量以通过以下命令查看服务的运行状态:docker-compose ps
pg_database
docker exec -it docker_dolphinscheduler-postgresql_1 psql -U root -d dolphinscheduler查看数据库 SELECT datname FROM pg_database;## 查看当前数据库 select current_database();查询pg_tables表 获取当前数据库中所有表的信息(pg_tables是系统视图)select * from pg_tables租户相关的数据库表(如 t_ds_tenant 表) DolphinScheduler 创建一个新数据库,现在你可以通过快速的 Shell 脚本来初始化数据库bash tools/bin/upgrade-schema.sh初始化数据库,导入 sql/dolphinscheduler_postgre.sql 进行创建表及基础数据导入 apache-dolphinscheduler-3.2.2-bin\tools\sql\sql
参考
https://stackoverflow.com/questions/72841549/container-fails-to-start-insufficient-memory-for-the-java-runtime-environment-t