supersonic icon indicating copy to clipboard operation
supersonic copied to clipboard

[Bug] dependency failed to start: container supersonic_mysql is unhealthy

Open Upcreat opened this issue 1 year ago • 5 comments

Search before asking

  • [X] I had searched in the issues and found no similar issues.

Version

默认使用docker拉去的最新版本

What's Wrong?

dependency failed to start: container supersonic_mysql is unhealthy

What You Expected?

1

How to Reproduce?

No response

Anything Else?

No response

Are you willing to submit PR?

  • [X] Yes I am willing to submit a PR!

Code of Conduct

Upcreat avatar Jul 30 '24 09:07 Upcreat

可以提供更详细信息吗,包括docker compose版本,docker版本,以及触发方式;

lexluo09 avatar Jul 31 '24 01:07 lexluo09

遇到类似问题, @Upcreat

默认的volumns被占用了,需要换一个目录重启起一下容器。 volumes: - mysql_data:/var/lib/mysql

换一个目录,比如: volumes: - mysql_data:/data1/docker/mysql

wzcyc avatar Aug 09 '24 02:08 wzcyc

遇到类似问题, @Upcreat

默认的volumns被占用了,需要换一个目录重启起一下容器。 volumes: - mysql_data:/var/lib/mysql

换一个目录,比如: volumes: - mysql_data:/data1/docker/mysql

还是不行,出现错误:24-08-19 17:57:09+00:00 [Note] [Entrypoint]: Temporary server stopped

2024-08-19 17:57:09+00:00 [Note] [Entrypoint]: MySQL init process done. Ready for start up.

2024-08-19T17:57:09.281301Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.39) starting as process 1 2024-08-19T17:57:09.281348Z 0 [ERROR] [MY-010338] [Server] Can't find error-message file '/usr/share/mysql-8.0/errmsg.sys'. Check error-message file location and 'lc-messages-dir' configuration directive. 2024-08-19T17:57:09.286815Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started. 2024-08-19T17:57:09.490434Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended. 2024-08-19T17:57:09.764592Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed. 2024-08-19T17:57:09.764658Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel. 2024-08-19T17:57:09.773318Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location '/var/lib/mysql' in the path is accessible to all OS users. Consider choosing a different directory. 2024-08-19T17:57:09.814041Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /var/run/mysqld/mysqlx.sock 2024-08-19T17:57:09.814191Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.39' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server - GPL.

ITMeow avatar Aug 19 '24 18:08 ITMeow

services:
  chroma:
    image: chromadb/chroma:0.5.3
    privileged: true
    container_name: supersonic_chroma
    ports:
      - "8111:8000"
    volumes:
      - chroma_data:/chroma
    networks:
      - supersonic_network
    dns:
      - 114.114.114.114
      - 8.8.8.8
      - 8.8.4.4
    healthcheck:
      test: [ "CMD", "curl", "http://0.0.0.0:8000" ]
      interval: 10s
      timeout: 5s
      retries: 10

  mysql:
    image: mysql:8.0
    privileged: true
    container_name: supersonic_mysql
    environment:
      LANG: 'C.UTF-8' # 设置环境变量
      MYSQL_ROOT_PASSWORD: 1qazxsw2
      MYSQL_DATABASE: supersonic_db
      MYSQL_USER: user
      MYSQL_PASSWORD: 1qazxsw2
    ports:
      - "13306:3306"
    volumes:
      - mysql_data:/data/docker/supersonic_db
    networks:
      - supersonic_network
    dns:
      - 114.114.114.114
      - 8.8.8.8
      - 8.8.4.4
    depends_on:
      chroma:
        condition: service_healthy
    healthcheck:
      test: [ "CMD", "mysqladmin", "ping", "-h", "localhost" ]
      interval: 10s
      timeout: 5s
      retries: 5

  db_init:
    image: supersonicbi/supersonic:${SUPERSONIC_VERSION:-latest}
    privileged: true
    container_name: supersonic_db_init
    depends_on:
      mysql:
        condition: service_healthy
    networks:
      - supersonic_network
    command: >
      sh -c " sleep 15 && if ! mysql -h supersonic_mysql -uuser -p1qazxsw2 -e 'use supersonic_db; show tables;' | grep -q 's2_database'; then
        mysql -h supersonic_mysql -uuser -p1qazxsw2 supersonic_db < /usr/src/app/supersonic-standalone-${SUPERSONIC_VERSION:-latest}/conf/db/schema-mysql.sql &&
        mysql -h supersonic_mysql -uuser -p1qazxsw2 supersonic_db < /usr/src/app/supersonic-standalone-${SUPERSONIC_VERSION:-latest}/conf/db/data-mysql.sql
      else
        echo 'Database already initialized.'
      fi "
    dns:
      - 114.114.114.114
      - 8.8.8.8
      - 8.8.4.4

  supersonic_standalone:
    image: supersonicbi/supersonic:${SUPERSONIC_VERSION:-latest}
    privileged: true
    container_name: supersonic_standalone
    environment:
      DB_HOST: supersonic_mysql
      DB_NAME: supersonic_db
      DB_USERNAME: user
      DB_PASSWORD: 1qazxsw2
      CHROMA_HOST: supersonic_chroma
    ports:
      - "9080:9080"
    depends_on:
      chroma:
        condition: service_healthy
      mysql:
        condition: service_healthy
      db_init:
        condition: service_completed_successfully
    networks:
      - supersonic_network
    dns:
      - 114.114.114.114
      - 8.8.8.8
      - 8.8.4.4
    volumes:
      #1.Named Volumes are best for persistent data managed by Docker.
      - supersonic_data:/usr/src/app/supersonic-standalone-${SUPERSONIC_VERSION:-latest}
      #2.Bind Mounts are suitable for frequent modifications and debugging.
      #      - ./conf/application-prd.yaml:/usr/src/app/supersonic-standalone-${SUPERSONIC_VERSION:-latest}/conf/application-prd.yaml
      #3.Detailed Bind Mounts offer more control over the mount behavior.
      #      - type: bind
      #        source: ./supersonic-standalone-${SUPERSONIC_VERSION:-latest}/logs
      #        target: /usr/src/app/supersonic-standalone-${SUPERSONIC_VERSION:-latest}/logs
      #        bind:
      #          propagation: rprivate
      #          create_host_path: true
volumes:
  mysql_data:
  chroma_data:
  supersonic_data:


networks:
  supersonic_network:

这是我的 docker-compose.yml ,一样的报了这个问题

wangzi1325 avatar Sep 03 '24 07:09 wangzi1325

services:
  chroma:
    image: chromadb/chroma:0.5.3
    privileged: true
    container_name: supersonic_chroma
    ports:
      - "8111:8000"
    volumes:
      - chroma_data:/chroma
    networks:
      - supersonic_network
    dns:
      - 114.114.114.114
      - 8.8.8.8
      - 8.8.4.4
    healthcheck:
      test: [ "CMD", "curl", "http://0.0.0.0:8000" ]
      interval: 10s
      timeout: 5s
      retries: 10

  mysql:
    image: mysql:8.0
    privileged: true
    container_name: supersonic_mysql
    environment:
      LANG: 'C.UTF-8' # 设置环境变量
      MYSQL_ROOT_PASSWORD: 1qazxsw2
      MYSQL_DATABASE: supersonic_db
      MYSQL_USER: user
      MYSQL_PASSWORD: 1qazxsw2
    ports:
      - "13306:3306"
    volumes:
      - mysql_data:/data/docker/supersonic_db
    networks:
      - supersonic_network
    dns:
      - 114.114.114.114
      - 8.8.8.8
      - 8.8.4.4
    depends_on:
      chroma:
        condition: service_healthy
    healthcheck:
      test: [ "CMD", "mysqladmin", "ping", "-h", "localhost" ]
      interval: 10s
      timeout: 5s
      retries: 5

  db_init:
    image: supersonicbi/supersonic:${SUPERSONIC_VERSION:-latest}
    privileged: true
    container_name: supersonic_db_init
    depends_on:
      mysql:
        condition: service_healthy
    networks:
      - supersonic_network
    command: >
      sh -c " sleep 15 && if ! mysql -h supersonic_mysql -uuser -p1qazxsw2 -e 'use supersonic_db; show tables;' | grep -q 's2_database'; then
        mysql -h supersonic_mysql -uuser -p1qazxsw2 supersonic_db < /usr/src/app/supersonic-standalone-${SUPERSONIC_VERSION:-latest}/conf/db/schema-mysql.sql &&
        mysql -h supersonic_mysql -uuser -p1qazxsw2 supersonic_db < /usr/src/app/supersonic-standalone-${SUPERSONIC_VERSION:-latest}/conf/db/data-mysql.sql
      else
        echo 'Database already initialized.'
      fi "
    dns:
      - 114.114.114.114
      - 8.8.8.8
      - 8.8.4.4

  supersonic_standalone:
    image: supersonicbi/supersonic:${SUPERSONIC_VERSION:-latest}
    privileged: true
    container_name: supersonic_standalone
    environment:
      DB_HOST: supersonic_mysql
      DB_NAME: supersonic_db
      DB_USERNAME: user
      DB_PASSWORD: 1qazxsw2
      CHROMA_HOST: supersonic_chroma
    ports:
      - "9080:9080"
    depends_on:
      chroma:
        condition: service_healthy
      mysql:
        condition: service_healthy
      db_init:
        condition: service_completed_successfully
    networks:
      - supersonic_network
    dns:
      - 114.114.114.114
      - 8.8.8.8
      - 8.8.4.4
    volumes:
      #1.Named Volumes are best for persistent data managed by Docker.
      - supersonic_data:/usr/src/app/supersonic-standalone-${SUPERSONIC_VERSION:-latest}
      #2.Bind Mounts are suitable for frequent modifications and debugging.
      #      - ./conf/application-prd.yaml:/usr/src/app/supersonic-standalone-${SUPERSONIC_VERSION:-latest}/conf/application-prd.yaml
      #3.Detailed Bind Mounts offer more control over the mount behavior.
      #      - type: bind
      #        source: ./supersonic-standalone-${SUPERSONIC_VERSION:-latest}/logs
      #        target: /usr/src/app/supersonic-standalone-${SUPERSONIC_VERSION:-latest}/logs
      #        bind:
      #          propagation: rprivate
      #          create_host_path: true
volumes:
  mysql_data:
  chroma_data:
  supersonic_data:


networks:
  supersonic_network:

这是我的 docker-compose.yml ,一样的报了这个问题

自答一下,把 mysql 的 image 换了一下就好了。 从 mysql:8.0 换成了 mysql:8.0-debian, 原因还没时间深研究。

wangzi1325 avatar Sep 09 '24 10:09 wangzi1325