JIRA の PostgreSQL への接続
These instructions will help you connect JIRA to a PostgreSQL database. A version of these instructions specific to Linux and JIRA is available.
はじめる前に
- Check whether your version of PostgreSQL is supported. See Supported Platforms.
- If you are Migrating JIRA to Another Server, create an export of your data as an XML backup. You will then be able to transfer data from your old database to your new database, as described in Switching databases.
- セットアップ ウィザードを実行中でなければ、はじめる前に JIRA をシャットダウンしてください。
1. PostgreSQL データベースを作成・設定する
- Create a database user (login role) which JIRA will connect as (e.g.
jiradbuser
).
Remember this database user name, as it will be used to configure JIRA's connection to this database in subsequent steps. Create a database for JIRA to store issues in (e.g.
jiradb
) with Unicode collation.
Remember this database name, as it will be used to configure JIRA's connection to this database in subsequent steps.CREATE DATABASE jiradb WITH ENCODING 'UNICODE' LC_COLLATE 'C' LC_CTYPE 'C' TEMPLATE template0;
またはコマンドラインから
$ createdb -E UNICODE -l C -T template0 jiradb
- ユーザーがデータベースに接続し、データベース中でテーブルを作成・追加できる権限を持っていることを確認します。
2. PostgreSQL JDBC ドライバをお使いのアプリケーション サーバーへコピーする(JIRA WAR 限定)
Skip this step if you installed a 'Recommended' distribution of JIRA, which includes the PostgreSQL JDBC driver. The JIRA WAR distribution does not include this driver.
- Download the PostgreSQL JDBC driver from http://jdbc.postgresql.org/download.html. (Obtain the JDBC 4 driver that matches your database version.)
- Add the PostgreSQL JDBC driver jar to the
lib/
directory of your application server.
3. お使いの PostgreSQL データベースに接続するために JIRA サーバを設定する
JIRA サーバーを PostgreSQL データベースに接続するための設定手法は 3 つあります。
- Using the JIRA setup wizard (not applicable to JIRA WAR) — Use this method, if you have just installed JIRA and are setting it up for the first time. Your settings will be saved to the
dbconfig.xml
file in your JIRA Home Directory. - Using the JIRA configuration tool (not applicable to JIRA WAR) — Use this method, if you have an existing JIRA instance. Your settings will be saved to the
dbconfig.xml
file in your JIRA Home Directory. - Manually — Only use this method if you have a JIRA WAR instance or you have a console-only connection to your JIRA server. You will be required to manually update the
dbconfig.xml
file in your JIRA Home Directory.
各設定方法の手順説明:
JIRA セットアップ ウィザード | ブラウザから初めて JIRA にアクセスすると、JIRA setup wizard が表示されます。
|
JIRA 設定ツール |
|
手動 |
|
データベース接続フィールド
セットアップウィザード / 設定ツール | dbconfig.xml | 説明 |
---|---|---|
ホスト名 |
| PostgreSQL サーバーがインストールされている PC 名または IP アドレス。 |
ポート | <url> タグに配置されます (下記の例の太字部分):<url>jdbc:postgresql:// dbserver: 5432/jiradb</url> | PostgreSQL サーバがリッスンしている TCP/IP ポート。このフィールドが空の場合、デフォルト ポートが使用されます。 |
データベース | <url> タグに配置されます (下記の例の太字部分):<url>jdbc:postgresql:// dbserver:5432/ jiradb</url> | ご使用の PostgreSQL データベースの名前 (JIRA データの保存先)。上記 ステップ 1 で作成済みのはずです。 |
ユーザ名 |
| PostgreSQL サーバーに接続するために JIRA が使用するユーザー。上記 ステップ 1 で作成済みのはずです。 |
パスワード | <password> タグに配置されます (下記の例の太字部分):<password> jiradbuser</password> | PostgreSQL サーバーとの認証に利用するユーザーのパスワード。 |
スキーマ | <schema-name> タグに配置されます (下記例の太字部分):<schema-name> public </schema-name> | PostgreSQL データベースが使用するスキーマ名。 PostgreSQL 7.2 以降の場合は、 |
dbconfig.xml ファイルのサンプル
For more information about the child elements of <jdbc-datasource/>
beginning with pool
in the dbconfig.xml
file above, see Tuning Database Connections.
<?xml version="1.0" encoding="UTF-8"?>
<jira-database-config>
<name>defaultDS</name>
<delegator-name>default</delegator-name>
<database-type>postgres72</database-type>
<schema-name>public</schema-name>
<jdbc-datasource>
<url>jdbc:postgresql://dbserver:5432/jiradb</url>
<driver-class>org.postgresql.Driver</driver-class>
<username>jiradbuser</username>
<password>password</password>
<pool-min-size>20</pool-min-size>
<pool-max-size>20</pool-max-size>
<pool-max-wait>30000</pool-max-wait>
<pool-max-idle>20</pool-max-idle>
<pool-remove-abandoned>true</pool-remove-abandoned>
<pool-remove-abandoned-timeout>300</pool-remove-abandoned-timeout>
<validation-query>select version();</validation-query>
<min-evictable-idle-time-millis>60000</min-evictable-idle-time-millis>
<time-between-eviction-runs-millis>300000</time-between-eviction-runs-millis>
<pool-test-on-borrow>false</pool-test-on-borrow>
<pool-test-while-idle>true</pool-test-while-idle>
</jdbc-datasource>
</jira-database-config>
4. JIRA を起動する
PostgreSQL データベースに接続するための JIRA の設定が完了しました。これで、起動できます!
- JIRA の『推奨』ディストリビューションを使用している場合は、起動後、エラーがないかどうかログを観察します。
- JIRA WAR ディストリビューションを使用している場合は、アプリケーションサーバーでウェブアプリケーションを再構築・再展開します。
おめでとうございます。これで PostgreSQL データベースに JIRA が接続されました。
インストールに際して
Please see JIRA and PostgreSQL for topics related to JIRA and PostgreSQL.