将Docker容器迁移到新服务器
我一直在使用一个托管的CRM,称为Corteza。 我已经长大了旧的副总裁,并转移到了一个新的专用Sever,并将所有Docker容器转移到了。 我使用Docker托管了其他4个应用程序,并通过将YAML和ENV文件复制到新服务器并将其移动量来轻松传输,每个容器都可以完美地工作,除Corteza外。
我已经使用了完全相同的YAML和ENV文件,并且一生无法弄清楚问题是什么。
我已经通过各种不同的途径向他们发送了多条消息,但尚未回音,所以我希望这里有人可以提供帮助。
产生容器,但是当我导航到地址时,这就是我看到的...
in我已经将API-Corteza.domain.co.uk的Docker代理规则设置为访问端口30080和Corteza.domain.co.uk访问端口30080,并将每个域的DNS记录设置为每个域的DNS记录以指向我的服务器IP。
我的YAML文件
version: '3.5'
services:
db:
image: percona:8.0
restart: on-failure
environment:
# To be picked up by percona image when creating the database
# Must match with DB_DSN settings inside .env
MYSQL_DATABASE: DB
MYSQL_USER: DB
MYSQL_PASSWORD: PWD
MYSQL_ROOT_PASSWORD: PWD
# healthcheck: { test: ["CMD", "mysqladmin" ,"ping", "-h", "IP"], timeout: 20s, retries: 10 }
# Uncomment to use local fs for data persistence
volumes: [ "./data/db:/var/lib/mysql" ]
networks: [ internal ]
server:
image: cortezaproject/corteza-server:2020.12
restart: on-failure
env_file: [ .env ]
environment:
# Informing Corredor where it he contact us
CORREDOR_ADDR: "corredor:80"
VIRTUAL_HOST: "https://corteza.domain.com"
depends_on: [ db, corredor ]
volumes: [ "./data/server:/data" ]
healthcheck: { test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"], timeout: 20s, retries: 10 }
ports: [ "127.0.0.1:30080:80" ]
networks: [ internal ]
corredor:
image: cortezaproject/corteza-server-corredor:2020.12
restart: on-failure
env_file: [ .env ]
environment:
# Informing Corredor where it he contact us
CORREDOR_ADDR: "corredor:80"
# Binds internal port to port LOCAL_DEMO_CRD_PORT on localhost
networks: [ internal ]
volumes: [ "./corredor:/corredor/usr" ]
webapp:
image: cortezaproject/corteza-webapp:2020.12
restart: on-failure
depends_on: [ server ]
environment:
# Monolith server in the backend, all services can be found under one base URL
MONOLITH_API: 1
# Configure web application with API location
API_BASEURL: "api-corteza.domain.com"
VIRTUAL_HOST: corteza.domain.com
ports: [ "127.0.0.1:30081:80" ]
networks:
internal: {}
我的env文件
# Version of Corteza Docker images
Domain=corteza.domain.com (Tried changing this to IP but made no difference)
VERSION=2020.12
`# Database connection` `DB_DSN=db details` `AUTH_JWT_SECRET=secret` `LOG_LEVEL=info`
CORREDOR_EXT_SEARCH_PATHS=/extensions:/extensions/*:/corredor/usr:/corredor/usr/*
CORREDOR_EXEC_CSERVERS_API_HOST=api-corteza.domain.com
CORREDOR_EXEC_CSERVERS_API_BASEURL_TEMPLATE=https://{host}/{service}
将不胜感激。我不知道在哪里可以调试这个问题。
问题似乎是Percona, 我认为这与与主服务器通信的图像有关。 当我运行Docker-Compose PS时,所有图像都在运行,但Percona正在不断重新启动
日志
mysqld: Can't create/write to file '/var/lib/mysql/is_writable' (OS errno 13 - Permission denied)
2022-07-04T17:54:35.904588Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.28-20) initializing of server in progress as process 15
2022-07-04T17:54:35.907285Z 0 [ERROR] [MY-010460] [Server] --initialize specified but the data directory exists and is not writable. Aborting.
2022-07-04T17:54:35.907299Z 0 [ERROR] [MY-013236] [Server] The designated data directory /var/lib/mysql/ is unusable. You can remove all files that the server added to it.
2022-07-04T17:54:35.907378Z 0 [ERROR] [MY-010119] [Server] Aborting
2022-07-04T17:54:35.907726Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.28-20) Percona Server (GPL), Release 20, Revision fd4b5a776a6.
I have been using a docker hosted CRM called Corteza.
I have outgrown my old VPS and moved over to a new dedicated sever and transferred all of my docker containers over.
I use docker to host 4 other apps and managed to transfer easily by copying the YAML and env files to the new server and also moving the volumes over, each container worked perfectly with the exception of Corteza.
I have used the exact same YAML and env files and for the life of me cannot figure out what the issue is.
I have sent them multiple messages through various different avenues and am yet to hear back so I hoped someone on here might be able to help.
The container is produced, but when I navigate to the address, this is what I see...
In plesk, I have set the docker proxy rules for api-corteza.domain.co.uk to access port 30080 and corteza.domain.co.uk to access port 30080 and set the DNS records for each domain to point to my server IP.
My YAML file
version: '3.5'
services:
db:
image: percona:8.0
restart: on-failure
environment:
# To be picked up by percona image when creating the database
# Must match with DB_DSN settings inside .env
MYSQL_DATABASE: DB
MYSQL_USER: DB
MYSQL_PASSWORD: PWD
MYSQL_ROOT_PASSWORD: PWD
# healthcheck: { test: ["CMD", "mysqladmin" ,"ping", "-h", "IP"], timeout: 20s, retries: 10 }
# Uncomment to use local fs for data persistence
volumes: [ "./data/db:/var/lib/mysql" ]
networks: [ internal ]
server:
image: cortezaproject/corteza-server:2020.12
restart: on-failure
env_file: [ .env ]
environment:
# Informing Corredor where it he contact us
CORREDOR_ADDR: "corredor:80"
VIRTUAL_HOST: "https://corteza.domain.com"
depends_on: [ db, corredor ]
volumes: [ "./data/server:/data" ]
healthcheck: { test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"], timeout: 20s, retries: 10 }
ports: [ "127.0.0.1:30080:80" ]
networks: [ internal ]
corredor:
image: cortezaproject/corteza-server-corredor:2020.12
restart: on-failure
env_file: [ .env ]
environment:
# Informing Corredor where it he contact us
CORREDOR_ADDR: "corredor:80"
# Binds internal port to port LOCAL_DEMO_CRD_PORT on localhost
networks: [ internal ]
volumes: [ "./corredor:/corredor/usr" ]
webapp:
image: cortezaproject/corteza-webapp:2020.12
restart: on-failure
depends_on: [ server ]
environment:
# Monolith server in the backend, all services can be found under one base URL
MONOLITH_API: 1
# Configure web application with API location
API_BASEURL: "api-corteza.domain.com"
VIRTUAL_HOST: corteza.domain.com
ports: [ "127.0.0.1:30081:80" ]
networks:
internal: {}
My ENV file
# Version of Corteza Docker images
Domain=corteza.domain.com (Tried changing this to IP but made no difference)
VERSION=2020.12
`# Database connection` `DB_DSN=db details` `AUTH_JWT_SECRET=secret` `LOG_LEVEL=info`
CORREDOR_EXT_SEARCH_PATHS=/extensions:/extensions/*:/corredor/usr:/corredor/usr/*
CORREDOR_EXEC_CSERVERS_API_HOST=api-corteza.domain.com
CORREDOR_EXEC_CSERVERS_API_BASEURL_TEMPLATE=https://{host}/{service}
Any help would be much appreciated. I have no idea where to look to debug the issue.
The problem appears to be Percona,
I am thinking that it is something to do with the image communicating with the main server.
When I run docker-compose ps all images are running but Percona is constantly restarting
Logs
mysqld: Can't create/write to file '/var/lib/mysql/is_writable' (OS errno 13 - Permission denied)
2022-07-04T17:54:35.904588Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.28-20) initializing of server in progress as process 15
2022-07-04T17:54:35.907285Z 0 [ERROR] [MY-010460] [Server] --initialize specified but the data directory exists and is not writable. Aborting.
2022-07-04T17:54:35.907299Z 0 [ERROR] [MY-013236] [Server] The designated data directory /var/lib/mysql/ is unusable. You can remove all files that the server added to it.
2022-07-04T17:54:35.907378Z 0 [ERROR] [MY-010119] [Server] Aborting
2022-07-04T17:54:35.907726Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.28-20) Percona Server (GPL), Release 20, Revision fd4b5a776a6.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论