source

docker - administrator & mariadb와 함께 compose하여 데이터베이스 연결 시도 시 403을 보여줍니다.

ittop 2023. 9. 19. 21:25
반응형

docker - administrator & mariadb와 함께 compose하여 데이터베이스 연결 시도 시 403을 보여줍니다.

지난 몇 시간 동안 시스템 디버깅을 했는데 무슨 일이 일어나고 있는지 막막합니다.

저는 심플하게 사용하고 있습니다.docker-compose.yml내 Ubuntu 20.04 LTS 시스템에서 mariadb관리자 인스턴스를 시작하기 위한 파일.

도커- compose.yml:

version: '3'
services:
  database:
    image: mariadb
    restart: always
    environment:
      MYSQL_DATABASE: feedback
      MYSQL_USER: db_user
      MYSQL_PASSWORD: password
      MYSQL_ROOT_PASSWORD: root

  adminer:
    image: adminer
    restart: always
    environment: 
      ADMINER_DEFAULT_SERVER: database
    ports:
      - "127.0.0.1:8080:8080"

동료가 테스트한 결과 시스템에서 100% 작동했습니다.하지만 지난 몇 시간 동안 제 시스템을 사용하면서 많은 시도 중 두 번만 성공했습니다.

이것은 도커 합성 출력입니다.

Creating knowledge-base_database_1 ... done
Creating knowledge-base_adminer_1  ... done
Attaching to knowledge-base_adminer_1, knowledge-base_database_1
database_1  | 2021-05-31 12:17:04+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.5.10+maria~focal started.
adminer_1   | [Mon May 31 12:17:04 2021] PHP 7.4.19 Development Server (http://[::]:8080) started
database_1  | 2021-05-31 12:17:04+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
database_1  | 2021-05-31 12:17:04+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.5.10+maria~focal started.
database_1  | 2021-05-31 12:17:05+00:00 [Note] [Entrypoint]: Initializing database files
database_1  | 
database_1  | 
database_1  | PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !
database_1  | To do so, start the server, then issue the following command:
database_1  | 
database_1  | '/usr/bin/mysql_secure_installation'
database_1  | 
database_1  | which will also give you the option of removing the test
database_1  | databases and anonymous user created by default.  This is
database_1  | strongly recommended for production servers.
database_1  | 
database_1  | See the MariaDB Knowledgebase at https://mariadb.com/kb or the
database_1  | MySQL manual for more instructions.
database_1  | 
database_1  | Please report any problems at https://mariadb.org/jira
database_1  | 
database_1  | The latest information about MariaDB is available at https://mariadb.org/.
database_1  | You can find additional information about the MySQL part at:
database_1  | https://dev.mysql.com
database_1  | Consider joining MariaDB's strong and vibrant community:
database_1  | https://mariadb.org/get-involved/
database_1  | 
database_1  | 2021-05-31 12:17:06+00:00 [Note] [Entrypoint]: Database files initialized
database_1  | 2021-05-31 12:17:06+00:00 [Note] [Entrypoint]: Starting temporary server
database_1  | 2021-05-31 12:17:06+00:00 [Note] [Entrypoint]: Waiting for server startup
database_1  | 2021-05-31 12:17:06 0 [Note] mysqld (mysqld 10.5.10-MariaDB-1:10.5.10+maria~focal) starting as process 99 ...
database_1  | 2021-05-31 12:17:06 0 [Note] InnoDB: Uses event mutexes
database_1  | 2021-05-31 12:17:06 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
database_1  | 2021-05-31 12:17:06 0 [Note] InnoDB: Number of pools: 1
database_1  | 2021-05-31 12:17:06 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
database_1  | 2021-05-31 12:17:06 0 [Note] mysqld: O_TMPFILE is not supported on /tmp (disabling future attempts)
database_1  | 2021-05-31 12:17:06 0 [Note] InnoDB: Using Linux native AIO
database_1  | 2021-05-31 12:17:06 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728
database_1  | 2021-05-31 12:17:06 0 [Note] InnoDB: Completed initialization of buffer pool
database_1  | 2021-05-31 12:17:06 0 [Note] InnoDB: 128 rollback segments are active.
database_1  | 2021-05-31 12:17:06 0 [Note] InnoDB: Creating shared tablespace for temporary tables
database_1  | 2021-05-31 12:17:06 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
database_1  | 2021-05-31 12:17:06 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
database_1  | 2021-05-31 12:17:06 0 [Note] InnoDB: 10.5.10 started; log sequence number 45118; transaction id 20
database_1  | 2021-05-31 12:17:06 0 [Note] Plugin 'FEEDBACK' is disabled.
database_1  | 2021-05-31 12:17:06 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
database_1  | 2021-05-31 12:17:06 0 [Note] InnoDB: Buffer pool(s) load completed at 210531 12:17:06
database_1  | 2021-05-31 12:17:06 0 [Warning] 'user' entry 'root@5315aa145a33' ignored in --skip-name-resolve mode.
database_1  | 2021-05-31 12:17:06 0 [Warning] 'proxies_priv' entry '@% root@5315aa145a33' ignored in --skip-name-resolve mode.
database_1  | 2021-05-31 12:17:06 0 [Note] Reading of all Master_info entries succeeded
database_1  | 2021-05-31 12:17:06 0 [Note] Added new Master_info '' to hash table
database_1  | 2021-05-31 12:17:06 0 [Note] mysqld: ready for connections.
database_1  | Version: '10.5.10-MariaDB-1:10.5.10+maria~focal'  socket: '/run/mysqld/mysqld.sock'  port: 0  mariadb.org binary distribution
database_1  | 2021-05-31 12:17:07+00:00 [Note] [Entrypoint]: Temporary server started.
database_1  | Warning: Unable to load '/usr/share/zoneinfo/leap-seconds.list' as time zone. Skipping it.
database_1  | Warning: Unable to load '/usr/share/zoneinfo/leapseconds' as time zone. Skipping it.
database_1  | Warning: Unable to load '/usr/share/zoneinfo/tzdata.zi' as time zone. Skipping it.
database_1  | 2021-05-31 12:17:09 5 [Warning] 'proxies_priv' entry '@% root@5315aa145a33' ignored in --skip-name-resolve mode.
database_1  | 2021-05-31 12:17:09+00:00 [Note] [Entrypoint]: Creating database feedback
database_1  | 2021-05-31 12:17:09+00:00 [Note] [Entrypoint]: Creating user db_user
database_1  | 2021-05-31 12:17:09+00:00 [Note] [Entrypoint]: Giving user db_user access to schema feedback
database_1  | 
database_1  | 2021-05-31 12:17:09+00:00 [Note] [Entrypoint]: Stopping temporary server
database_1  | 2021-05-31 12:17:09 0 [Note] mysqld (initiated by: root[root] @ localhost []): Normal shutdown
database_1  | 2021-05-31 12:17:09 0 [Note] Event Scheduler: Purging the queue. 0 events
database_1  | 2021-05-31 12:17:09 0 [Note] InnoDB: FTS optimize thread exiting.
database_1  | 2021-05-31 12:17:09 0 [Note] InnoDB: Starting shutdown...
database_1  | 2021-05-31 12:17:09 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool
database_1  | 2021-05-31 12:17:09 0 [Note] InnoDB: Buffer pool(s) dump completed at 210531 12:17:09
database_1  | 2021-05-31 12:17:09 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
database_1  | 2021-05-31 12:17:09 0 [Note] InnoDB: Shutdown completed; log sequence number 45130; transaction id 21
database_1  | 2021-05-31 12:17:09 0 [Note] mysqld: Shutdown complete
database_1  | 
database_1  | 2021-05-31 12:17:10+00:00 [Note] [Entrypoint]: Temporary server stopped
database_1  | 
database_1  | 2021-05-31 12:17:10+00:00 [Note] [Entrypoint]: MariaDB init process done. Ready for start up.
database_1  | 
database_1  | 2021-05-31 12:17:10 0 [Note] mysqld (mysqld 10.5.10-MariaDB-1:10.5.10+maria~focal) starting as process 1 ...
database_1  | 2021-05-31 12:17:10 0 [Note] InnoDB: Uses event mutexes
database_1  | 2021-05-31 12:17:10 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
database_1  | 2021-05-31 12:17:10 0 [Note] InnoDB: Number of pools: 1
database_1  | 2021-05-31 12:17:10 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
database_1  | 2021-05-31 12:17:10 0 [Note] mysqld: O_TMPFILE is not supported on /tmp (disabling future attempts)
database_1  | 2021-05-31 12:17:10 0 [Note] InnoDB: Using Linux native AIO
database_1  | 2021-05-31 12:17:10 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728
database_1  | 2021-05-31 12:17:10 0 [Note] InnoDB: Completed initialization of buffer pool
database_1  | 2021-05-31 12:17:10 0 [Note] InnoDB: 128 rollback segments are active.
database_1  | 2021-05-31 12:17:10 0 [Note] InnoDB: Creating shared tablespace for temporary tables
database_1  | 2021-05-31 12:17:10 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
database_1  | 2021-05-31 12:17:10 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
database_1  | 2021-05-31 12:17:10 0 [Note] InnoDB: 10.5.10 started; log sequence number 45130; transaction id 20
database_1  | 2021-05-31 12:17:10 0 [Note] Plugin 'FEEDBACK' is disabled.
database_1  | 2021-05-31 12:17:10 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
database_1  | 2021-05-31 12:17:10 0 [Note] InnoDB: Buffer pool(s) load completed at 210531 12:17:10
database_1  | 2021-05-31 12:17:10 0 [Note] Server socket created on IP: '::'.
database_1  | 2021-05-31 12:17:10 0 [Warning] 'proxies_priv' entry '@% root@5315aa145a33' ignored in --skip-name-resolve mode.
database_1  | 2021-05-31 12:17:10 0 [Note] Reading of all Master_info entries succeeded
database_1  | 2021-05-31 12:17:10 0 [Note] Added new Master_info '' to hash table
database_1  | 2021-05-31 12:17:10 0 [Note] mysqld: ready for connections.
database_1  | Version: '10.5.10-MariaDB-1:10.5.10+maria~focal'  socket: '/run/mysqld/mysqld.sock'  port: 3306  mariadb.org binary distribution

root:root을 사용하여 administrator를 사용하여 데이터베이스에 로그인하려고 하면 다음과 같은 출력이 생성됩니다.

adminer_1   | [Mon May 31 12:17:54 2021] [::ffff:172.25.0.1]:38170 Accepted
adminer_1   | [Mon May 31 12:17:54 2021] [::ffff:172.25.0.1]:38170 [302]: POST /?server=database&username=root
adminer_1   | [Mon May 31 12:17:54 2021] [::ffff:172.25.0.1]:38170 Closing
adminer_1   | [Mon May 31 12:17:54 2021] [::ffff:172.25.0.1]:38174 Accepted
adminer_1   | [Mon May 31 12:18:24 2021] [::ffff:172.25.0.1]:38174 [403]: GET /?server=database&username=root
adminer_1   | [Mon May 31 12:18:24 2021] [::ffff:172.25.0.1]:38174 Closing
adminer_1   | [Mon May 31 12:18:24 2021] [::ffff:172.25.0.1]:38208 Accepted
adminer_1   | [Mon May 31 12:18:24 2021] [::ffff:172.25.0.1]:38208 [200]: GET /?file=favicon.ico&version=4.8.0
adminer_1   | [Mon May 31 12:18:24 2021] [::ffff:172.25.0.1]:38208 Closing

방화벽을 비활성화하고, 도커 및 도커 컴포지트를 다시 설치하고, 도커 컴포지트의 기본 네트워크를 사용하는 대신 도커로 사용자 지정 네트워크를 만드는 등의 작업을 시도했습니다.

저는 또한 제 시스템에 대해 잘 알려진 프로젝트를 시작했는데, 그 프로젝트에서 같은 결과가 나왔습니다.제 시스템에 무언가가 고장 난 것 같은데, 더 이상 어디를 봐야 할지 모르겠어요.

이 일을 해결하기 위해 제가 무엇을 시도할 수 있는지 아는 사람이 있습니까?

추가해보기/index.php그래서 대신에http://localhost에 가다http://localhost/index.php

언급URL : https://stackoverflow.com/questions/67773826/docker-compose-with-adminer-mariadb-shows-403-on-attempted-database-connection

반응형