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改為自定義的主機名,然后就好了。。。原因暫時沒搞清楚,先記錄一下

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM