我使用的docker-compose部署的,
services:
snail-job-server:
image: opensnail/snail-job:1.8.0
container_name: snail-job-server-mariadb
restart: unless-stopped
environment:
- SPRING_DATASOURCE_USERNAME=xxx
- SPRING_DATASOURCE_PASSWORD=xxx
- SPRING_DATASOURCE_URL=jdbc:postgresql://xxx/snail_job
- SPRING_DATASOURCE_DRIVER_CLASS_NAME=org.postgresql.Driver
ports:
- "8000:8080"
- "17888:17888"
按照步骤创建好命名空间和组后在配置里写入
snail-job:
server:
host: 127.0.0.1
port: 17888
namespace: xxx
group: test_sj_group
token: xxx
host: 127.0.0.1
port: 17889
logging:
config: classpath:logback-boot.xml
但启动后报错
***************************
APPLICATION FAILED TO START
***************************
Description:
Parameter 0 of method snailJobNetworkUtils in com.aizuda.snailjob.common.core.CommonCoreConfigure required a bean of type 'com.aizuda.snailjob.common.core.network.SnailJobNetworkProperties' that could not be found.
Action:
Consider defining a bean of type 'com.aizuda.snailjob.common.core.network.SnailJobNetworkProperties' in your configuration.
手动创建SnailJobConfig设置
@EnableConfigurationProperties({SnailJobProperties.class, SnailJobNetworkProperties.class})
后启动只有
2025-09-30T10:42:00.658+08:00 INFO 11281 --- [Test] [ main] s.SnailJobClientJobCoreAutoConfiguration : Snail-Job 客户端IP为: 192.168.1.17
这一条日志,在线机器里也没有客户端