任务调度_docker-compose启动dolphinscheduler报错的排查过程

记一次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.sh
	 find  ./ -type f -name dolphinscheduler_env.sh
  4.启动后还用这么多内存--修改源码的配置文件不起作用
   查看镜像的变量方式
    首先,运行一个临时的容器(但不启动默认命令):
        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_container
        docker rm temp_container 
		
   果然镜像内的配置文件已存在
5.那就覆盖配置文件 
   覆盖配置文件
    services:
      app:
        image: your-image
        volumes:
          - ./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 参数开启:
        特权容器的权限设计初衷是为了绕过所有安全限制,因此它会自动禁用 Seccomp


9.过程中的收获 
   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	
posted @ 2025-03-06 17:47  辰令  阅读(128)  评论(0)    收藏  举报