Jira アプリケーションの SQL Server 2014 への接続
These instructions will help you connect Jira to a Microsoft SQL Server 2014 database.
はじめる前に
- Jira アプリケーションを別のサーバに移行する場合は、データのエクスポートを XML バックアップとして作成します。その後、「データベースの切り替え」の説明に従い、元のデータベースから新しいデータベースにデータを移行できます。
- Stop Jira before you begin, unless you just started the installation and are running the Setup Wizard.
1. SQL Server データベースを作成および構成する
When creating the database, remember your database name, user name, schema name, and port number, because you'll need them later to connect Jira to your database.
Create a database for Jira (e.g.
jiradb
).照合タイプでは、大文字と小文字が区別されないことに注意します。
SQL Server は Unicode エンコード形式で文字を格納します。これで、文字エンコード問題を十分回避できます。
Create a database user which Jira will connect as (e.g.
jiradbuser
). This user should not be the database owner, but should be in thedb_owner
role.Create an empty 'schema' in the database for the Jira tables (e.g.
jiraschema
).作成したデータベース ユーザーが、データベースに接続し、新しく作成したスキーマでテーブルを作成および更新できる権限を持っていることを確認します。
- SQL Server で TCP/IP が有効であり、適切なリスニング ポートが設定されていることを確認します。デフォルトの SQL Server インストールのユーザー ポート番号は 1433 です。
SQL Server が適切な認証モードで稼働していることを確認します。
- SET NOCOUNT オプションのチェックを外します。
- SQL Server Management Studio を開きます。
- [ツール] > [オプション] > [クエリ実行] > [SQL Server] > [詳細] に移動し、[SET NOCOUNT] チェック ボックスの選択を解除します。
オブジェクト エクスプローラーでサーバーを右クリックし、[プロパティ] > [接続] > [デフォルト接続] に移動します。no count オプションをクリアします。
新規作成したデータベース上で右クリックして、[クエリ コンソール] にアクセスし、 “New Query” を選択します。次のコマンドを実行し、分離レベルを設定します。
ALTER DATABASE THE-NEW-DATABASE-CREATED-FOR-JIRA SET READ_COMMITTED_SNAPSHOT ON
2. Configure Jira to connect to the database
There are two ways to configure your Jira server to connect to your SQL Server database.
Using the Jira setup wizard — 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 application home directory.Using the Jira configuration tool — Use this method, if you have an existing Jira instance. Your settings will be saved to the
dbconfig.xml
file in your Jira application home directory.
データベース接続フィールド
The table shows the fields you'll need to fill out when connecting Jira to your database. You can also refer to them, and the sample dbconfig.xml
file below, if you'd like to create or edit the dbconfig.xml
file manually.
セットアップウィザード / 設定ツール | dbconfig.xml | 説明 |
---|---|---|
ホスト名 |
| SQL Server がインストールされたサーバーマシンのマシン名または IP アドレスです。 |
ポート | <url> タグに格納されます (下記例の太字部分): | SQL Server のサーバーがリスンする TCP/IP ポートです。このフィールドが空の場合、デフォルト ポートが使用されます。 |
データベース | <url> タグに格納されます (下記例の太字部分): | The name of your SQL Server database (into which Jira will save its data). You should have created this in Step 1 above. |
ユーザ名 |
| The user that Jira uses to connect to the SQL Server server. You should have created this in Step 1 above. |
パスワード | <password> タグに格納されます (下記例の太字部分):<password> jiradbuser </password> | SQL Server サーバーが認証に使用するユーザーのパスワードです。 |
スキーマ | <schema-name> タグ格納されます (下記例の太字部分):<schema-name> dbo </schema-name> | SQL Server サーバーが使用するスキーマの名前です。上記 ステップ 1で作成済みのはずです。 |
dbconfig.xml ファイルのサンプル
上記の dbconfig.xml
ファイルに含まれる、pool
で始まる <jdbc-datasource/>
の子要素の詳細については、「データベース接続のチューニング」を参照してください。
<jira-database-config>
<name>defaultDS</name>
<delegator-name>default</delegator-name>
<database-type>mssql</database-type>
<schema-name>jiraschema</schema-name>
<jdbc-datasource>
<url>jdbc:sqlserver://serverName=dbserver;portNumber=1433;databaseName=jiradb</url>
<driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</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>
<pool-test-on-borrow>false</pool-test-on-borrow>
</jdbc-datasource>
</jira-database-config>
3. Jira を起動する
You should now have Jira configured to connect to your SQL Server database. The next step is to start it up!