Dolphin Scheduler初始化Postgresql数据库失败
在执行sh script/create-dolphinscheduler.sh初始化数据库时报错:
07:05:03.070 [main] ERROR com.alibaba.druid.pool.DruidDataSource - init datasource error, url: jdbc:postgresql://localhost:5432/dolphinscheduler org.postgresql.util.PSQLException: FATAL: Ident authentication failed for user "postgres" at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:438) at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:222) at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49) at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:194) at org.postgresql.Driver.makeConnection(Driver.java:450) at org.postgresql.Driver.connect(Driver.java:252) at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1578) at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1644) at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:918) at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:1300) at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:1296) at org.apache.dolphinscheduler.dao.upgrade.UpgradeDao.getCurrentDbType(UpgradeDao.java:80) at org.apache.dolphinscheduler.dao.upgrade.UpgradeDao.<clinit>(UpgradeDao.java:45) at org.apache.dolphinscheduler.dao.upgrade.DolphinSchedulerManager.initUpgradeDao(DolphinSchedulerManager.java:37) at org.apache.dolphinscheduler.dao.upgrade.DolphinSchedulerManager.<init>(DolphinSchedulerManager.java:57) at org.apache.dolphinscheduler.dao.upgrade.shell.CreateDolphinScheduler.main(CreateDolphinScheduler.java:36)
检查pg_hba.conf文件:
# TYPE DATABASE USER ADDRESS METHOD # "local" is for Unix domain socket connections only local all all peer # IPv4 local connections: host all all 127.0.0.1/32 ident # IPv6 local connections: host all all ::1/128 ident # Allow replication connections from localhost, by a user with the # replication privilege. #local replication postgres peer #host replication postgres 127.0.0.1/32 ident #host replication postgres ::1/128 ident host all all 0.0.0.0/0 password
解决办法:
将conf/application.properties中
spring.datasource.url=jdbc:postgresql://localhost:5432/dolphinscheduler
localhost改为自定义的主机名,然后就好了。。。原因暂时没搞清楚,先记录一下