Jira資料庫配置

yuzhangqi發表於2014-02-12
Jira必須使用關聯式資料庫來儲存issue資料。
如果你正在進行全新的Jira安裝,Jira安裝嚮導將為你配置資料庫連線--Jira內部的HSQL資料庫或者外部的關聯式資料庫。
Jira內部的HSQL資料庫適合於評估用途。然而,HSQL資料庫容易損壞。如果用於生產目的,我們強烈推薦連線Jira到支援的外部關聯式資料庫。這使得你能夠利用你的資料庫系統自帶的備份與恢復功能。
欲瞭解Jira的平臺依賴性,請參考 。

下面以SQL Server 2008為例,說明如何配置Jira資料庫。

一、安裝必備


1. JDK/JRE
無論你使用哪個版本的Windows系統,必須安裝JDK 1.7。

2. Web瀏覽器
需要Chrome、Firefox、Safari的最新穩定版本,IE8.0/9.0/10.0。

3. JTDS 1.2.4 driver
jTDS is an open source 100% pure Java (type 4) JDBC 3.0 driver for Microsoft SQL Server (6.5, 7, 2000, 2005, 2008 and 2012) and Sybase Adaptive Server Enterprise (10, 11, 12 and 15). jTDS is based on FreeTDS and is currently the fastest production-ready JDBC driver for SQL Server and Sybase ASE.
Being a type 4 driver, jTDS does not need any special installation. Just drop the jar file into your application's classpath and you're done.
3.a 下載JTDS 1.2.4 driver

解壓到比如D:\jtds-1.2.4-dist。
3.b 設定CLASS_PATH環境變數
執行cmd開啟命令列視窗。
set CLASS_PATH = %CLASS_PATH%;D:\jtds-1.2.4-dist\jtds-1.2.4.jar

4. SQL Server 2008
確保你已經安裝了SQL Server 2008 或 R2。

二、建立、配置SQL Server資料庫


1. 建立Jira用來儲存issue的資料庫(比如叫做jiradb)。
Collation type must be case-insensitive, for example, 'SQL_Latin1_General_CP437_CI_AI' is case-insensitive collation type.
SQL Server uses Unicode encoding to store characters. This is sufficient to prevent any possible encoding problems.

2. 建立一個用於Jira連線資料庫的資料庫使用者,比如叫做jiradbuser。
該使用者不應該是資料庫owner,但是應該具有db_owner角色。

3. 為Jira資料庫表建立一個空的schema,比如叫做jiraschema。
A 'schema' in SQL Server 2008 is a distinct namespace used to contain objects and is different from a traditional database schema.

4. 確保該使用者(jiradbuser)具有連線到jiradb資料庫的許可權,以及在新建的schema中建立、查詢表的許可權。

5. 確保SQL Server啟用了TCP/IP,並且監聽埠是正確的(預設埠是1433)。

6. 確保SQL Server執行於適當的身份驗證模式。
建議使用“混合身份驗證模式”。

7. 關閉SET NOCOUNT選項。
  • Open SQL Server Management Studio and navigate to Tools > Options > Query Execution > SQL Server > Advanced. Ensure that the SET NOCOUNT option is not selected.
  • You will also need to access the Server > Properties > Connections > Default Connections properties box and clear the no count option.
  • Access the Query Console by right clicking on the newly created database and selecting 'New Query'. Execute the following command to set the isolation level.
        ALTER DATABASE THE-NEW-DATABASE-CREATED-FOR-JIRA SET READ_COMMITTED_SNAPSHOT ON

參考
 

三、 用Jira安裝嚮導配置資料庫連線


各項引數配置如下:
For the "Database Connection" select "My Own Database"
For "Database Type" select "Microsoft SQL Server"
For "Hostname" enter "{你的SQL Server主機名稱或IP}"
Leave "Port" as "1433"
For "Database" enter "jiradb" (如果SQL Server安裝指定了命名例項,則應該為"jiradb;instance={myInstanceName}")
Fill in "Username", "Password" and "Schema"
Click "Test Connection"
正常情況下你將看到“資料庫連線配置成功”。

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/13651903/viewspace-1080109/,如需轉載,請註明出處,否則將追究法律責任。

相關文章