JIRA の SQL Server 2005 への接続
ここでは、JIRA を Microsoft SQL Server 2005 データベースに接続する手順を説明します。
はじめる前に
- Check whether your version of SQL Server is supported. See Supported Platforms.
Note, SQL Server Express is not supported, however, it is possible to set up JIRA to work with this database. As it's not supported, we have no docs available for this configuration. - 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. SQL Server データベースの作成と設定
- Create a database for JIRA to store issues in (e.g.
jiradb
).
Remember your database name, as it will be used to configure JIRA's connection to this database in subsequent steps.- 照合タイプは、大文字と小文字の区別を無視、アクセントの区別を無視、および言語非依存でなければなりません。たとえば、「SQL_Latin1_General_CP437_CI_AI」は、大文字と小文字の区別を無視、アクセントの区別を無視、および言語非依存の照合タイプです。ご使用の SQL Server インストールの照合タイプの設定をデフォルトから変更していない場合、照合タイプの設定を確認してください。
- SQL Server は Unicode エンコード形式で文字を格納します。これで、文字エンコード問題を十分回避できます。
- Create a database user which JIRA will connect as (e.g.
jiradbuser
).
Remember your database user name, as it will be used to configure JIRA's connection to this database in subsequent steps.- This database user should not be the database owner, but should be in the
db_owner
role.
- This database user should not be the database owner, but should be in the
- Create an empty 'schema' in the database (e.g.
jiraschema
) for the JIRA tables.
Remember this database schema name, as it will be used to configure JIRA's connection to this database in subsequent steps.- SQL Server 2005 の「スキーマ」は、オブジェクトを含むために使用されるまったく別の名前空間であり、従来のデータベーススキーマとは異なるものです。JIRA のテーブル、フィールド、または信頼関係の作成は不要です (JIRA は初回起動時に、これらのオブジェクトを空のスキーマ内に作成します)。SQL Server 2005 のスキーマに関する詳細は、Microsoft ドキュメントの関連項目を参照してください。
- 作成したデータベース ユーザーが、データベースに接続し、新しく作成したスキーマの中でテーブルを作成・追加できる権限を持つことを確認します。
- If you are having difficulties setting up your JIRA database for SQL Server, additional information is available in the Setting Up a SQL Server 2005 database for JIRA document.
- Ensure that TCP/IP is enabled on SQL Server and listening on the correct port (which is 1433 for a default SQL Server installation).
Remember this port number, as it will be used to configure JIRA's connection to this database in subsequent steps. JIRA does not support dynamic port assignment.- ネットワーク プロトコル (TCP/IP) を有効にする方法、および、SQL Server のリスニング ポートの変更方法に関しては、Microsoft のドキュメンテーションを参照してください。
- SQL Server が適切な認証モードで稼働していることを確認します。
- SQL Server はデフォルトで「Windows 認証モード」で稼働します。しかし、ユーザーが SQL Server の信頼関係接続に関連付けられていない場合、すなわち、JIRA セットアップ中に ”Microsoft SQL Server、エラー: 18452” が表示される場合、この認証モードを「混在モード」に変更する必要があります。認証モード、および、「混在モード」への認証モードの変更に関しては、Microsoft のドキュメンテーションを参照してください。
- Turn off the SET NOCOUNT option (see the Error caused by SET NOCOUNT in MS SQL Serverfor an explanation). To turn off SET NOCOUNT:
- Open SQL Server Management Studio and navigate to Tools > Options > Query Execution > SQL Server > Advanced. The following screenshot displays the configuration panel for this setting in MSSQL Server 2005. Ensure that the SET NOCOUNT option is not selected:
新規作成したデータベース上で右クリックをして、Query Console にアクセスし、 “New Query” を選択します。次のコマンドを実行し、分離レベルを設定します。
ALTER DATABASE THE-NEW-DATABASE-CREATED-FOR-JIRA SET READ_COMMITTED_SNAPSHOT ON
- Open SQL Server Management Studio and navigate to Tools > Options > Query Execution > SQL Server > Advanced. The following screenshot displays the configuration panel for this setting in MSSQL Server 2005. Ensure that the SET NOCOUNT option is not selected:
2. SQL Server の JDBC Driver をアプリケーションサーバーへコピー (JIRA WAR 限定)
Skip this step if you installed a 'Recommended' distribution of JIRA, which includes the SQL Server JDBC driver. The JIRA WAR distribution does not include this driver.
- Download the SQL Server JDBC driver (v1.2.4) from JTDS.
Microsoft have their own JDBC driver but we strongly recommend avoiding it after receiving many reports of intermittent disconnections (JRA-5760 and JRA-6872), workflow problems (JRA-8443) and Chinese character problems (JRA-5054).
- Add the SQL Server JDBC driver jar (jtds-1.2.4.jar) to the
<Tomcat install>/lib/
directory.
3. JIRA Server を SQL Server 2005 データベースに接続する設定
SQL Server 2008 データベースへ接続するための JIRA サーバーの設定方法は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 が表示されます。
- 最初の画面 の “Configure Language and Database” で、 “Database Connection” に My own database を選択します。
- ”Database Type” に ”SQL Server” を選択します。
- 下記の データベース接続関連フィールド を参照し、フィールド入力を行います。
- 接続をテストし、保存します。
JIRA 設定ツール
- 次のように JIRA 設定ツールを実行します。
- Windows: Open a command prompt and run
config.bat
in thebin
sub-directory of the JIRA Installation Directory. - Linux/Unix: Open a console and execute
config.sh
in thebin
sub-directory of the JIRA Installation Directory.This may fail with the error as described in our Unable to Start JIRA applications Config Tool due to No X11 DISPLAY variable was set error KB article. Please refer to it for the workaround.
- Windows: Open a command prompt and run
- Database タブを選択し、”Database type” に ”SQL Server” を選択します。
- 下記の データベース接続関連フィールド を参照し、フィールド入力を行います。
- 接続をテストし、保存します。
- Jira を再起動します。
手動
- Locate the
dbconfig.xml
file at the root of your JIRA Home Directory.- If this file does not exist, create the file, copy and paste the example XML code (shown below) into this file.
- Update the file, as described in the Database connection fields section below. Escape any '
&
' characters by adding 'amp;
' to the end of each one.- Note, the
<database-type/>
element must specify your type of database, e.g.mssql
. If you forget to do this and you start JIRA, your database tables may be created incorrectly. See Incorrect database type specified if this happens to you.
- Note, the
- ファイルを保存し、Jira を再起動します。
データベース接続フィールド
セットアップウィザード / 設定ツール | dbconfig.xml | 説明 |
---|---|---|
ホスト名 |
| SQL Server がインストールされたサーバーマシンのマシン名または IP アドレスです。 |
ポート |
| SQL Server のサーバーがリスンする TCP/IP ポートです。このフィールドが空の場合、デフォルト ポートが使用されます。 |
データベース |
| SQL Server データベース(JIRA のデータ保存先)の名前です。上記 ステップ 1で作成済みのはずです。 |
ユーザ名 |
| JIRA が SQL Server サーバー接続時に使用するユーザーです。上記 ステップ 1で作成済みのはずです。 |
パスワード | <password> タグに配置されます (下記の例の太字部分):<password> jiradbuser</password> | SQL Server サーバーが認証に使用するユーザーのパスワードです。 |
スキーマ | Located in the <schema-name> tag (see bold text in example below):<schema-name> dbo</schema-name> | SQL Server サーバーが使用するスキーマの名前です。上記 ステップ 1で作成済みのはずです。 |
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>mssql</database-type>
<schema-name>dbo</schema-name>
<jdbc-datasource>
<url>jdbc:jtds:sqlserver://dbserver:1433/jiradb</url>
<driver-class>net.sourceforge.jtds.jdbc.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 1</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-while-idle>true</pool-test-while-idle>
</jdbc-datasource>
</jira-database-config>
4. JIRA を起動する
ここまでで、SQL Server データベースに接続するための JIRA の設定が完了したはずです。これで、起動できます!
- JIRA の『推奨』ディストリビューションを使用している場合は、起動後、エラーがないかどうかログを観察します。
- JIRA WAR ディストリビューションを使用している場合は、アプリケーションサーバーでウェブアプリケーションを再構築・再展開します。
以上で、SQL Server データベースへの JIRA の接続は完了です。
インストールに際して
Please see JIRA and MS SQL Server 2005.