使用 Docker Compose 部署:参考的是官网地址https://docs.halo.run/getting-started/install/docker-compose
为啥启动不了,拉取的镜像halohub/halo:2.11 ,启动halo日志报错:
[root@VM-16-12-centos opt]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
00f0d40ea9ab mysql:8.1.0 "docker-entrypoint.s…" 16 seconds ago Up 16 seconds (healthy) 0.0.0.0:3306->3306/tcp, 33060/tcp halodb
[root@VM-16-12-centos opt]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
636f60a40ce8 halohub/halo:2.11 "sh -c 'java ${JVM_O…" 26 seconds ago Exited (1) 12 seconds ago halo
00f0d40ea9ab mysql:8.1.0 "docker-entrypoint.s…" 26 seconds ago Up 26 seconds (healthy) 0.0.0.0:3306->3306/tcp, 33060/tcp halodb
[root@VM-16-12-centos opt]# docker logs -f 636f60a40ce8
Error: Port Library failed to initialize: -86
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Error: Port Library failed to initialize: -86
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Error: Port Library failed to initialize: -86
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Error: Port Library failed to initialize: -86
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
[root@VM-16-12-centos opt]#
如下配置文件yaml:
`
version: "3"
services:
halo:
image: halohub/halo:2.11
container_name: halo
restart: on-failure:3
depends_on:
halodb:
condition: service_healthy
networks:
halo_network:
volumes:
- ./halo2:/root/.halo2
ports:
- "8090:8090"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8090/actuator/health/readiness"]
interval: 30s
timeout: 5s
retries: 5
start_period: 30s
command:
- --spring.r2dbc.url=r2dbc:pool:mysql://halodb:3306/halo
- --spring.r2dbc.username=root
- --spring.r2dbc.password=o#DwN&JSa56
- --spring.sql.init.platform=mysql
- --halo.external-url=http://localhost:8090/
halodb:
image: mysql:8.1.0
container_name: halodb
restart: on-failure:3
networks:
halo_network:
command:
- --default-authentication-plugin=caching_sha2_password
- --character-set-server=utf8mb4
- --collation-server=utf8mb4_general_ci
- --explicit_defaults_for_timestamp=true
volumes:
- ./mysql:/var/lib/mysql
- ./mysqlBackup:/data/mysqlBackup
ports:
- "3306:3306"
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "127.0.0.1", "--silent"]
interval: 3s
retries: 5
start_period: 30s
environment:
- MYSQL_ROOT_PASSWORD=o#DwN&JSa56
- MYSQL_DATABASE=halo
networks:
halo_network:
`