WildFly18 へのアップデート
だらだらと WildFly 10.2.0 を使い続けていたが,ついに重い腰を上げてアップデートすることにした。
WildFly 18.0.1 の準備
WildFly の GitHub から branch 18.0.x を選択,"Download Zip" して解凍する。作業時点ではこれで 18.0.1.Final がダウンロードされた。
mac で WildFly 18.0.1 のビルド
brew をアップデートして mvn と ant を最新にしておく。
$ brew update ; brew upgrade
しかる後に build。ちなみに,java はまだ 1.8.0 のままである。
$ mvn install [INFO] Scanning for projects... Downloading: https://repo.maven.apache.org/maven2/org/jboss/jboss-parent/35/jboss-parent-35.pom : [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 17:02 min [INFO] Finished at: 2019-11-01T09:17:17+09:00 [INFO] ------------------------------------------------------------------------
これで wildfly-18.0.1.Final-SNAPSHOT ができる。WildFly 10.2.0 と同じく,full distributable build が欲しい場合は,build/target ではなく,dist/target の方を使う必要がある。
WildFly 18.0.1 のセットアップ
- ./standalone.sh -b 0.0.0.0 で立ち上げて,./add-user.sh で管理ユーザ登録
- JDBC の登録(ドライバは postgresql-42.2.8.jar),data-source の作成,パスワード登録
$ ./jboss-cli.sh --connect [standalone@localhost:9990 /] module add --name=org.postgres --resources=~/Downloads/postgresql-42.2.8.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
OpenDolphin の修正
WildFly 18 の pom.xml に合わせて,OpenDolphin クライアント・サーバの pom.xml のバージョンを変更する。
これでサーバは動いたが,ログに warning が出ていた。
WARN [org.hibernate.orm.deprecation] (ServerService Thread Pool -- 76) HHH90000014: Found use of deprecated [org.hibernate.id.SequenceGenerator] sequence-based id generator; use org.hibernate.id.enhanced.SequenceStyleGenerator instead. See Hibernate Domain Model Mapping Guide for details.
persistence.xml で hibernate.id.new_generator_mappings を false にして互換性を保っていたが,これだと deprecated になった SequenceGenerator を使うことになるので何とかしろと言うことらしい。Hibernate ORM 5.3.13.Final User Guide を見ると hibernate.model.generator_name_as_sequence_name のところに "Users migrating from earlier versions using the legacy hibernate_sequence name should disable this setting." と書いてあったので,hibernate.id.new_generator_mappings を消して hibernate.model.generator_name_as_sequence_name に書き換えた。
起動時に dolphin サーバを立ち上げる
wildfly を起動時に立ち上げるために /etc/init.d/jboss スクリプトを作ってルート権限で起動していたが,init.d システムは時代遅れらしく,この機会に /home/dolphin/ に wildfly を置いて,cron を使って dolphin ユーザ権限で wildfly を立ち上げることにした。lucene index も /var/lucene ではなく,${jboss.server.base.dir}/lucene に置くことにした。
$ echo "@reboot /home/dolphin/wildfly-18.0.1.Final-SNAPSHOT/bin/standalone.sh -b dolphin.server.ip.addr > /dev/null 2>&1" | crontab
lucene index の作り直し
エントリー数は WildFly 10 に移行した 2017年 の 219,617 件から 259,968 件に増加したが,爆速新サーバのおかげでインデックス作成は 1時間30分で完了。
2019-11-13 08:32:00,532 INFO [org.hibernate.search.batchindexing.impl.SimpleIndexingProgressMonitor] (Hibernate Search: identifierloader-1) HSEARCH000027: Going to reindex 259968 entities 2019-11-13 08:32:01,854 INFO [org.hibernate.search.batchindexing.impl.SimpleIndexingProgressMonitor] (Hibernate Search: entityloader-7) HSEARCH000030: 50 documents indexed in 1055 ms : 2019-11-13 10:02:34,091 INFO [org.hibernate.search.batchindexing.impl.SimpleIndexingProgressMonitor] (Hibernate Search: entityloader-8) HSEARCH000031: Indexing speed: 47.843922 documents/second; progress: 99.99% 2019-11-13 10:02:36,021 INFO [org.hibernate.search.batchindexing.impl.SimpleIndexingProgressMonitor] (default task-4) HSEARCH000028: Reindexed 259968 entities
WildFly アップデート記録
- 2008年 JBossAS 4.0.5
- 2009年 JBossAS 4.2.3
- 2010年 JBossAS 5.1.0
- 2013年 JBossAS 7.1.4
- 2015年 WildFly 8.2.1
- 2017年 WildFly 10.2.0
- 2019年 WildFly 18.0.1
« orca 5.1 に移行 | トップページ | サーバの dom0 を ubuntu 18.04 にアップグレード »
「OpenDolphin」カテゴリの記事
- 運用17年目のまとめ(2025.02.03)
- IME on/off の切換 - その2(2024.12.02)
- OrcaController オルコン(2024.11.28)
- OpenDolphin: java 21 / wildfly 34 への移行(2024.11.08)
- IME on/off の切り替え(2024.09.03)