Search

Private 인스턴스에서 docker-compose up 실행시 MySQL 오류

BacklogNumber
0
Domain
Issue
Status
생성 일시
2023/07/28 10:27

Description

docker-compose up 로그중에서 mysql부분만 복사
파일 경로 구성
.env
Dockerfile
docker-compose.yml
custom.cnf

Try

docker-compose.yml 파일이 문제일경우 아님;;
1.
Elastic IP를 deploy-test에 할당해서 mysql이미지를 다운받는다.
2.
Github에서 mysql.properties를 다시 수정해서 커밋
a.
Deploy가 아직 자동은 안 되던데? ./run.sh 백그라운드 설정하자
3.
다시 docker-compose up 확인 성공

Solution

[ec2-user@ip-172-31-22-18 bastion-redis-backend-deploy]$ docker-compose up [+] Running 3/0 ✔ Container mysql-container Running 0.0s ✔ Container redis-container Running 0.0s ✔ Container bastion-spring-backend-deploy-server Running 0.0s Attaching to bastion-spring-backend-deploy-server, mysql-container, redis-container ^CGracefully stopping... (press Ctrl+C again to force) Aborting on container exit... [+] Stopping 3/3 ✔ Container bastion-spring-backend-deploy-server Stopped 0.5s ✔ Container redis-container Stopped 0.7s ✔ Container mysql-container Stopped 1.3s canceled [ec2-user@ip-172-31-22-18 bastion-redis-backend-deploy]$ docker-compose down [+] Running 4/4 ✔ Container bastion-spring-backend-deploy-server Removed 0.0s ✔ Container redis-container Removed 0.0s ✔ Container mysql-container Removed 0.0s ✔ Network bastion-redis-backend-deploy_app Removed 0.4s [ec2-user@ip-172-31-22-18 bastion-redis-backend-deploy]$ docker-compose up [+] Running 4/2 ✔ Network bastion-redis-backend-deploy_app Created 0.1s ✔ Container mysql-container Created 0.0s ✔ Container bastion-spring-backend-deploy-server Created 0.0s ✔ Container redis-container Created 0.0s Attaching to bastion-spring-backend-deploy-server, mysql-container, redis-container mysql-container | 2023-07-29 08:50:56+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.34-1.el8 started. mysql-container | 2023-07-29 08:50:56+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql' mysql-container | 2023-07-29 08:50:56+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.34-1.el8 started. redis-container | 1:C 29 Jul 2023 08:50:57.236 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo redis-container | 1:C 29 Jul 2023 08:50:57.236 # Redis version=7.0.12, bits=64, commit=00000000, modified=0, pid=1, just started redis-container | 1:C 29 Jul 2023 08:50:57.236 # Configuration loaded redis-container | 1:M 29 Jul 2023 08:50:57.237 * monotonic clock: POSIX clock_gettime redis-container | 1:M 29 Jul 2023 08:50:57.239 * Running mode=standalone, port=6379. redis-container | 1:M 29 Jul 2023 08:50:57.239 # Server initialized redis-container | 1:M 29 Jul 2023 08:50:57.239 # WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. Being disabled, it can can also cause failures without low memory condition, see https://github.com/jemalloc/jemalloc/issues/1328. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect. redis-container | 1:M 29 Jul 2023 08:50:57.241 * Ready to accept connections mysql-container | '/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock' bastion-spring-backend-deploy-server | wait-for-it.sh: waiting 15 seconds for db:3306 mysql-container | 2023-07-29T08:50:57.475186Z 0 [Warning] [MY-011068] [Server] The syntax '--skip-host-cache' is deprecated and will be removed in a future release. Please use SET GLOBAL host_cache_size=0 instead. mysql-container | 2023-07-29T08:50:57.476308Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.34) starting as process 1 mysql-container | 2023-07-29T08:50:57.484414Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started. mysql-container | 2023-07-29T08:50:57.631426Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended. mysql-container | 2023-07-29T08:50:57.794670Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed. mysql-container | 2023-07-29T08:50:57.794710Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel. mysql-container | 2023-07-29T08:50:57.797037Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory. mysql-container | 2023-07-29T08:50:57.823809Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /var/run/mysqld/mysqlx.sock mysql-container | 2023-07-29T08:50:57.823905Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.34' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Community Server - GPL. bastion-spring-backend-deploy-server | wait-for-it.sh: db:3306 is available after 1 seconds bastion-spring-backend-deploy-server | bastion-spring-backend-deploy-server | . ____ _ __ _ _ bastion-spring-backend-deploy-server | bastion-spring-backend-deploy-server | /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ bastion-spring-backend-deploy-server | ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ bastion-spring-backend-deploy-server | \\/ ___)| |_)| | | | | || (_| | ) ) ) ) bastion-spring-backend-deploy-server | ' |____| .__|_| |_|_| |_\__, | / / / / bastion-spring-backend-deploy-server | =========|_|==============|___/=/_/_/_/ bastion-spring-backend-deploy-server | :: Spring Boot :: (v3.0.5) bastion-spring-backend-deploy-server | bastion-spring-backend-deploy-server | bastion-spring-backend-deploy-server | 2023-07-29T08:50:59.650Z INFO 1 --- [ main] com.example.demo.DemoApplication : Starting DemoApplication v0.0.1-SNAPSHOT using Java 17.0.2 with PID 1 (/app.jar started by root in /) bastion-spring-backend-deploy-server | 2023-07-29T08:50:59.667Z INFO 1 --- [ main] com.example.demo.DemoApplication : No active profile set, falling back to 1 default profile: "default" bastion-spring-backend-deploy-server | 2023-07-29T08:51:00.869Z INFO 1 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode bastion-spring-backend-deploy-server | 2023-07-29T08:51:00.871Z INFO 1 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode. bastion-spring-backend-deploy-server | 2023-07-29T08:51:01.136Z INFO 1 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 255 ms. Found 2 JPA repository interfaces. bastion-spring-backend-deploy-server | 2023-07-29T08:51:01.158Z INFO 1 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode bastion-spring-backend-deploy-server | 2023-07-29T08:51:01.160Z INFO 1 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data Redis repositories in DEFAULT mode. bastion-spring-backend-deploy-server | 2023-07-29T08:51:01.174Z INFO 1 --- [ main] .RepositoryConfigurationExtensionSupport : Spring Data Redis - Could not safely identify store assignment for repository candidate interface com.example.demo.mysqlTest.repository.MySqlTestRepository; If you want this repository to be a Redis repository, consider annotating your entities with one of these annotations: org.springframework.data.redis.core.RedisHash (preferred), or consider extending one of the following types with your repository: org.springframework.data.keyvalue.repository.KeyValueRepository bastion-spring-backend-deploy-server | 2023-07-29T08:51:01.175Z INFO 1 --- [ main] .RepositoryConfigurationExtensionSupport : Spring Data Redis - Could not safely identify store assignment for repository candidate interface com.example.demo.board.repository.BoardRepository; If you want this repository to be a Redis repository, consider annotating your entities with one of these annotations: org.springframework.data.redis.core.RedisHash (preferred), or consider extending one of the following types with your repository: org.springframework.data.keyvalue.repository.KeyValueRepository bastion-spring-backend-deploy-server | 2023-07-29T08:51:01.175Z INFO 1 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 5 ms. Found 0 Redis repository interfaces. bastion-spring-backend-deploy-server | 2023-07-29T08:51:02.015Z INFO 1 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 7777 (http) bastion-spring-backend-deploy-server | 2023-07-29T08:51:02.030Z INFO 1 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat] bastion-spring-backend-deploy-server | 2023-07-29T08:51:02.030Z INFO 1 --- [ main] o.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/10.1.7] bastion-spring-backend-deploy-server | 2023-07-29T08:51:02.152Z INFO 1 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext bastion-spring-backend-deploy-server | 2023-07-29T08:51:02.155Z INFO 1 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 2392 ms bastion-spring-backend-deploy-server | 2023-07-29T08:51:02.638Z INFO 1 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default] bastion-spring-backend-deploy-server | 2023-07-29T08:51:02.711Z INFO 1 --- [ main] org.hibernate.Version : HHH000412: Hibernate ORM core version 6.1.7.Final bastion-spring-backend-deploy-server | 2023-07-29T08:51:03.796Z INFO 1 --- [ main] SQL dialect : HHH000400: Using dialect: org.hibernate.dialect.MySQL8Dialect bastion-spring-backend-deploy-server | 2023-07-29T08:51:03.799Z WARN 1 --- [ main] org.hibernate.orm.deprecation : HHH90000026: MySQL8Dialect has been deprecated; use org.hibernate.dialect.MySQLDialect instead bastion-spring-backend-deploy-server | 2023-07-29T08:51:04.846Z INFO 1 --- [ main] o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform] bastion-spring-backend-deploy-server | 2023-07-29T08:51:04.867Z INFO 1 --- [ main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default' bastion-spring-backend-deploy-server | 2023-07-29T08:51:05.803Z INFO 1 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 7777 (http) with context path '' bastion-spring-backend-deploy-server | 2023-07-29T08:51:05.816Z INFO 1 --- [ main] com.example.demo.DemoApplication : Started DemoApplication in 6.902 seconds (process running for 7.534)
JSON
복사