Guacamole Docker 版本 - 必须登录 mySQL 才能工作

问题描述 投票:0回答:1

我在 OCI 上的 Oracle Linux 8 上很好地安装了 Guacamole。可以在 https://github.com/timyshark/guacamole 找到存储库。

总结:

docker-compose.yaml

# import .env file from volt
# Generate ./initdb.sql : $ mkdir initdb && docker run --rm guacamole/guacamole /opt/guacamole/bin/initdb.sh --mysql > ./initdb/initdb.sql

# networks
# create a network 'guacamole_net' in mode 'bridged'
networks:
  guac-net:
driver: bridge
  haproxy_net:
external: true

# services
services:
  # guacd
  guacd:
container_name: guac-guacd
image: guacamole/guacd
networks:
  guac-net:
restart: always

  # mysql
  mysql:
container_name: guac-mysql
environment:
  MYSQL_ROOT_PASSWORD: '${MYSQL_ROOT_PASSWORD}'
  MYSQL_DATABASE: '${MYSQL_DATABASE}'
  MYSQL_USER: '${MYSQL_USER}'
  MYSQL_PASSWORD: '${MYSQL_PASSWORD}'
image: mysql:oraclelinux8
networks:
  guac-net:
restart: always
volumes:
- ./initdb:/docker-entrypoint-initdb.d

  # guacamole
  guacamole:
container_name: guac-guacamole
depends_on:
- guacd
- mysql
environment:
  GUACD_HOSTNAME: guacd
  MYSQL_HOSTNAME: mysql
  MYSQL_DATABASE: '${MYSQL_DATABASE}'
  MYSQL_USER: '${MYSQL_NAME}'
  MYSQL_PASSWORD: '${MYSQL_PASSWORD}'
  MYSQL_SSL_MODE: disabled
image: guacamole/guacamole
ports:
- "8080:8080"
links:
- guacd
networks:
  - guac-net
restart: always

一切正常,除了第一个

docker compose up
我收到错误

 An error has occurred and this action cannot be completed. If the problem persists, please notify your system administrator or check your system logs.

日志:

guac-guacamole  | Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
guac-guacamole  | 21:17:00.399 [http-nio-8080-exec-7] WARN  o.a.g.e.AuthenticationProviderFacade - The "mysql" authentication provider has encountered an internal error which will halt the authentication process. If this is unexpected or you are the developer of this authentication provider, you may wish to enable debug-level logging. If this is expected and you wish to ignore such failures in the future, please set "skip-if-unavailable: mysql" within your guacamole.properties.
guac-guacamole  | 21:17:00.404 [http-nio-8080-exec-7] ERROR o.a.g.rest.RESTExceptionMapper - Unexpected internal error:
guac-guacamole  | ### Error querying database.  Cause: java.sql.SQLNonTransientConnectionException: Public Key Retrieval is not allowed
guac-guacamole  | ### The error may exist in org/apache/guacamole/auth/jdbc/user/UserMapper.xml
guac-guacamole  | ### The error may involve org.apache.guacamole.auth.jdbc.user.UserMapper.selectOne
guac-guacamole  | ### The error occurred while executing a query
guac-guacamole  | ### Cause: java.sql.SQLNonTransientConnectionException: Public Key Retrieval is not allowed

我不确定如何解决问题,或者按照日志中的说明更改驱动程序。

如果我在进入 http://guacamole-server:8080/guacamole 后就使用用户 guacamole/password 登录 mysql 容器

$docker exec -it guac-mysql bash
#mysql -u guacamole guacamoledb -p
docker guacamole
1个回答
0
投票

这个设置对我来说可靠:

version: "3.7"

services:
  guacd:
    image: guacamole/guacd
    restart: always

  mysql:
    environment:
      MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
      MYSQL_DATABASE: ${MYSQL_DATABASE}
      MYSQL_USER: ${MYSQL_USER}
      MYSQL_PASSWORD: ${MYSQL_PASSWORD}
    healthcheck:
      test: ["CMD", "mysqladmin", "-uroot", "-p${MYSQL_ROOT_PASSWORD}", "ping"]
      interval: 5s
      timeout: 5s
      retries: 5
    image: mysql:5.7.22
    restart: always
    volumes:
      - ./initdb:/docker-entrypoint-initdb.d

  guacamole:
    depends_on:
      guacd:
        condition: service_started
      mysql:
        condition: service_healthy
    environment:
      GUACD_HOSTNAME: guacd
      MYSQL_HOSTNAME: ${MYSQL_HOSTNAME}
      MYSQL_DATABASE: ${MYSQL_DATABASE}
      MYSQL_USER: ${MYSQL_USER}
      MYSQL_PASSWORD: ${MYSQL_PASSWORD}
      MYSQL_DRIVER: mysql
      MYSQL_SSL_MODE: disabled
    image: guacamole/guacamole
    ports:
      - 8080:8080
    links:
      - guacd
    restart: always

我改变的事情:

  1. 使用早期的 MySQL 映像 (
    mysql:5.7.22
    )。
  2. mysql
    服务指定显式运行状况检查,以确保 MySQL 在 Guacamole 启动之前就已做好连接准备。

我使用的是默认网络,但您可以集成您的特定网络。

© www.soinside.com 2019 - 2024. All rights reserved.