新規の Confluence インストール
Confluence セットアップ ウィザードは、Tomcat 構成でデータベースを検出した場合にデータソースを使用するオプションのみを提供します。データソースを使用したい場合は、次の手順に従います。
1. Confluence を停止します
Confluence セットアップ ウィザードで、データベースを選択するようにプロンプトが出されます。この時点で、以下を実行します。
- Stop Confluence.
- 変更を元に戻す場合に備えて、次のファイルをバックアップします。
<installation-directory>/conf/server.xml
<installation-directory>/confluence/WEB-INF/web.xml
<home-directory>/confluence.cfg.xml
2. データベース ドライバーを追加する
データベース ドライバを <installation-directory>/lib
ディレクトリにコピーします。
以下は、ご使用のデータベースのドライバーがある場所です。
- PostgreSQL: Confluence にバンドル (
<installation-directory>/confluence/WEB-INF/lib/postgresql-x.x.x.jar
) - Microsoft SQL Server: Confluence にバンドル (
<installation-directory>/confluence/WEB-INF/lib/mssql-jdbc-x.x.x.x.jar
) - MySQL: head to Database JDBC Drivers to download the driver
- Oracle: head to Database JDBC Drivers to download the driver
3. Tomcat でデータソースを設定する
次に、データソース設定を Tomcat に追加します。
<installation-directory>/conf/server.xml
を編集します。
以下の行を見つけます。
<Context path="" docBase="../confluence" debug="0" reloadable="true"> <!-- Logger is deprecated in Tomcat 5.5. Logging configuration for Confluence is specified in confluence/WEB-INF/classes/log4j.properties -->
利用しているデータベースに対応した次のデータソース
Resource
要素を、上記の行の直後 (Context
要素内で、<Context.../>
行の開始直後、Manager)
の前)に挿入します。<database-user>
、<password>
、<host>
、<database-name>
(Oracle の場合は<SID>
) をご利用のデータベースの詳細と置き換えます。データベース サーバーが既定のポートで実行されていない場合は、ポートの変更も必要になる場合があります。Configure the connection pool and other properties. See the Apache Tomcat 9 Datasource documentation for more information.
- 共同編集を使用する場合は、以下を確認する必要があります。
- You're using a supported database driver. Collaborative editing will fail if you're using an unsupported or custom JDBC driver or
driverClassName
in your datasource. See Database JDBC Drivers for the list of drivers we support. - データベース接続プールは、Confluence と Synchrony の両方をサポートできる十分な接続数を許可する (既定値は最大プールサイズの 15)。
- データベースには、単純なユーザー名およびパスワード認証を使用している。
- You're using a supported database driver. Collaborative editing will fail if you're using an unsupported or custom JDBC driver or
4.Confluence Web アプリケーションを設定する
次のデータソースを使用するように Confluence を設定します。
を編集します。<CONFLUENCE_INSTALLATION>/
confluence/WEB-INF/web.xml- ファイルの末尾の近くで、
</web-app>
の直前に次の要素を挿入します。
<resource-ref> <description>Connection Pool</description> <res-ref-name>jdbc/confluence</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> </resource-ref>
5. Confluence を再起動してセットアップ プロセスを続行する
これでデータソースが設定されたので、セットアップ ウィザードを続行できます。
- Start Confluence.
http://localhost:8090
に進み、セットアップ ウィザードに戻ります。- プロンプトが出されたら、独自データベース (データソース) を選択します。
- データソースの JNDI 名を入力します (例:
java:comp/env/jdbc/confluence
)。 - プロンプトに従って、Confluence のセットアップを完了します。
6. データソースを更新して自動コミットをオフにする
Once you've confirmed that Confluence is up and running, you'll need to make a final change to your datasource to avoid a known issue with editing pages. See CONFSERVER-59524 - Getting issue details... STATUS
- Confluence を停止します。
<installation-directory>/conf/server.xml
を編集します。次のパラメーターをデータソースの Resource 要素に追加します。
defaultAutoCommit="false"
- Confluence を起動します。
- これをすべてのクラスター ノードで繰り返します。
既存の Confluence のインストール
JDBC 直接接続からデータソースへ切り替える場合:
- Stop Confluence.
- 変更を元に戻す場合に備えて、次のファイルをバックアップします。
<installation-directory>/conf/server.xml
<installation-directory>/confluence/WEB-INF/web.xml
<home-directory>/confluence.cfg.xml
- 上記ステップの説明に従って、データベース ドライバーを
<installation-directory>/lib
ディレクトリにコピーします。現在のデータベース接続に関する詳細は、<home-directory>/confluence.cfg.xml
をご確認ください。
<installation-directory>/conf/server.xml
を編集して、次のDataSource
Resource 要素を特定のデータベース (Context
要素内で<Context.../>
行の開始直後、Manager
の前) に挿入します。<database-user>
、<password>
、<host>
、<database-name>
(Oracle の場合は<SID>
) をご利用のデータベースの詳細と置き換えます。データベース サーバーが既定のポートで実行されない場合は、ポートも変更する必要が生じる場合もあります。
ファイルを編集して、<home-directory>/
confluence.cfg.xmlhibernate
で始まるプロパティを含むすべての行を削除します。
<properties>
セクションの先頭に以下を挿入します。- Start Confluence.
データソースと共に Confluence をアップグレードする
Confluene をアップグレードする場合 (手動またはインストーラーを使用)、以下を実行する必要があります。
- Confluence を停止します (起動している場合)。
- データベース ドライバを
<installation-directory>/lib
ディレクトリにコピーします。 <installation-directory>/conf/server.xml
を編集してデータソース リソースを追加します。<installation-directory>/confluence/WEB-INF/web.xml
を編集して、このデータソースを使用するように Confluence を設定します。
これらの手順を忘れると、Confluence はアップグレード後に起動せず、次のエラーが表示されます。
HTTP Status 500 - Confluence is vacant, a call to tenanted [public abstract org.hibernate.Session org.hibernate.SessionFactory.getCurrentSession()throws org.hibernate.HibernateException] is not allowed.
既知の問題
- If you experience a lot of
ContentUpdatedEvent
errors in the logs, you may need to add adddefaultAutoCommit="false"
to the datasource in theserver.xml
file. See CONFSERVER-59524 - Getting issue details... STATUS for more information and full details of the workaround. - There's a known issue where Synchrony does not start if Confluence connects to the database using a datasource. See CONFSERVER-60120 - Getting issue details... STATUS for more information and a workaround.
- There's a known issue when running Oracle with Native Network Encryption that can cause Confluence to become unresponsive. See CONFSERVER-60152 - Getting issue details... STATUS for more details and Confluence Unresponsive Due to High Database Connection Latency for some suggested mitigation strategies.