« 2017年6月 | トップページ | 2017年10月 »
$ ./jboss-cli.sh --connect [standalone@localhost:9990 /] module add --name=org.postgres --resources=~/Downloads/postgresql-42.1.4.jar --dependencies=javax.api,javax.transaction.api [standalone@localhost:9990 /] /subsystem=datasources/jdbc-driver=postgres:add(driver-name="postgres",driver-module-name="org.postgres",driver-class-name=org.postgresql.Driver) [standalone@localhost:9990 /] data-source add --jndi-name=java:jboss/datasouces/DolphinDS --name=DolphinDS --connection-url=jdbc:postgresql://localhost/dolphin --driver-name=postgres --user-name=dolphin [standalone@localhost:9990 /] /subsystem=datasources/data-source=DolphinDS:write-attribute(name=password, value=dolphin) [standalone@localhost:9990 /] quit
13:05:30,906 INFO [org.hibernate.search.batchindexing.impl.SimpleIndexingProgressMonitor] (Hibernate Search: identifierloader-1) HSEARCH000027: Going to reindex 219617 entities 13:05:34,786 INFO [org.hibernate.search.batchindexing.impl.SimpleIndexingProgressMonitor] (Hibernate Search: entityloader-2) HSEARCH000030: 50 documents indexed in 3391 ms : 16:33:16,248 INFO [org.hibernate.search.batchindexing.impl.SimpleIndexingProgressMonitor] (Hibernate Search: entityloader-3) HSEARCH000030: 219600 documents indexed in 12465287 ms 16:33:16,248 INFO [org.hibernate.search.batchindexing.impl.SimpleIndexingProgressMonitor] (Hibernate Search: entityloader-3) HSEARCH000031: Indexing speed: 17.616922 documents/second; progress: 99.99% 16:33:22,187 INFO [org.hibernate.search.batchindexing.impl.SimpleIndexingProgressMonitor] (Hibernate Search: batch coordinator-1) HSEARCH000028: Reindexed 219617 entities
多忙な夏を乗り越えて少し余裕ができたので,久しぶりに OpenDophin のメンテをしようと,開発マシンの Dolphin サーバを aptitude upgrade でアップデートしたところ,サーバが立ち上がらなくなった。ログを見ると,postgres の認証で失敗していた。しかし,もともと postgres にはパスワードは設定しておらず,アップデート前はそのまま使えていたはずである。
: Caused by: org.postgresql.util.PSQLException: FATAL: password authentication failed for user "dolphin" at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:420) :
原因は,アップデートで postgres が 9.3.18 にアップデートされていたことであった。このバージョンから,空パスワードが許されなくなっていた。
・ Disallow empty passwords in all password-based authentication methods
postgres の dolphin ユーザと wildfly の DolphinDS にパスワードを設定して無事サーバが立ち上がるようになった。
dolphin=# alter user dolphin with password 'dolphin';
$ ./jboss-cli.sh --connect Authenticating against security realm: ManagementRealm Username: xxxx Password: xxxx [standalone@localhost:9990 /] /subsystem=datasources/data-source=DolphinDS:write-attribute(name=password, value=dolphin) { "outcome" => "success", "response-headers" => { "operation-requires-reload" => true, "process-state" => "reload-required" } }これで standalone/configuration/standalone.xml に反映される
<datasource jndi-name="java:jboss/datasouces/DolphinDS" pool-name="DolphinDS" enabled="true"> <connection-url>jdbc:postgresql://localhost/dolphin</connection-url> <driver>postgres</driver> <security> <user-name>dolphin</user-name> <password>dolphin</password> </security> </datasource>