Confluence 6 新 Confluence 安裝配置一個數據源鏈接

若是在你的 Tomcat 中配置了數據源,而且Confluence 設置指南在安裝的時候檢測到這個配置的時候,配置數據源的選項將會提供給你進行配置。入股你但願使用數據源,請參考下面的配置。html

1. 中止 Confluence

在 Confluence 的配置指南中,你將會提示選擇你的數據庫,在這個時候,你應該:java

  1. 使用 bin/stop-confluence.sh or bin/stop-confuence.bat 中止  Confluence。
  2. 備份下面的文件,以防止你可能須要從新恢復你的配置:
    • <installation-directory>/conf/server.xml
    • <installation-directory>/confluence/WEB-INF/web.xml
    • <home-directory>/confluence.cfg.xml

2. 添加你的數據庫驅動

拷貝你的數據庫驅動到  <installation-directory>/lib 目錄中。mysql

下面的鏈接是有關若是找到你的數據庫驅動:web

  • 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:進入 Database JDBC Drivers  頁面來下載驅動
  • Oracle:進入 Database JDBC Drivers  頁面來下載驅動

3. 在 Tomcat 中配置數據源

下一步,將數據源配置到 Tomcat 中。sql

  1. 編輯 <installation-directory>/conf/server.xml
  2. 找到下面的行:
    < 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 -->
  3. 插入下面的數據源資源  Resource  元素。針對你具體使用的數據庫不一樣,須要作一些修改(插入 Context  元素,在 <Context.../> 行,同時在 Manager 以前)。
     PostgreSQL...
    <Resource name= "jdbc/confluence" auth= "Container" type= "javax.sql.DataSource"
         username= "<database-user>"
         password= "<password>"
         driverClassName= "org.postgresql.Driver"
         url= "jdbc:postgresql://<host>:5432/<database-name>"
         maxTotal= "60"
         maxIdle= "20"
         validationQuery= "select 1" />  
     Microsoft SQL Server...
    <Resource name= "jdbc/confluence" auth= "Container" type= "javax.sql.DataSource"
         username= "<database-user>"
         password= "<password>"
        driverClassName= "com.microsoft.sqlserver.jdbc.SQLServerDriver"
         url= "jdbc:sqlserver://<host>:1433;database=<database-name>"
         maxTotal= "60"
         maxIdle= "20"
         validationQuery= "select 1" />

    若是你正在使用的 Confluence 6.3 及其早期的版本,針對 SQL Server 數據庫服務器,你 制定jTDS 驅動。請參考  Configuring a SQL Server Datasource in Apache Tomcat 中的文檔來進行配置。數據庫

     MySQL...
    <Resource name= "jdbc/confluence" auth= "Container" type= "javax.sql.DataSource"
         username= "<database-user>"
         password= "<password>"
         driverClassName= "com.mysql.jdbc.Driver"
         url= "jdbc:mysql://<host>:3306/<database-name>?useUnicode=true&amp;characterEncoding=utf8"
         maxTotal= "60"
         maxIdle= "20"
         defaultTransactionIsolation= "READ_COMMITTED"
         validationQuery= "Select 1" />
     Oracle...
    <Resource name= "jdbc/confluence" auth= "Container" type= "javax.sql.DataSource"
         driverClassName= "oracle.jdbc.OracleDriver"
         url= "jdbc:oracle:thin:@<host>:1521:<SID>"
         username= "<database-user>"
         password= "<password>"
         connectionProperties= "SetBigStringTryClob=true"
         accessToUnderlyingConnectionAllowed= "true"
         maxTotal= "60"
         maxIdle= "20"
         maxWaitMillis= "10000" />

    See how to find your Oracle URL.apache

    替換 <database-user>, <password>, <host><database-name> (或針對 Oracle 使用 <SID>  )來配置你本身的數據庫。你同事還須要修改這個端口,若是你的數據庫沒有在默認端口中運行的話。tomcat

  4. 配置鏈接池和其餘屬性,請參考 Apache Tomcat 8 Datasource documentation 頁面來得到更多的信息。
     配置屬性...
  5. 若是你計劃使用協做編輯,你須要肯定:
    • 你須要使用支持的數據庫驅動。若是你使用了不支持的數據庫驅動或者自定義的 JDBC 驅動,或者你數據源中的  driverClassName,協做寫編輯將會失敗。請參考 Database JDBC Drivers 頁面中的內容。
    • 你數據庫鏈接池須要容許有足夠的鏈接數來同時支持  Confluence 和 Synchrony (默認的最大鏈接池數量爲 15)。
    • 在你的數據庫中,你使用簡單用戶名和密碼受權。

4. 配置 Confluence web 應用

配置 Confluence 來使用這個數據源:服務器

  1. 編輯 <CONFLUENCE_INSTALLATION>/confluence/WEB-INF/web.xml.
  2. </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 而後繼續設置進程

如今你的數據源已經成功配置了,你能夠繼續你 Confluence 的安裝進程了。oracle

  1. 使用 bin/start-confluence.sh 或  bin/start-confuence.bat 來重啓你的 Confluence
  2. Go to http://localhost:8090 to return to the setup wizard.
  3. 當提示選擇 My own database (datasource)
  4. 輸入你數據源的 JNDI 名稱,例如,java:comp/env/jdbc/confluence
  5. 針對彈出的內容來完成你 Confluence 的設置。

https://www.cwiki.us/display/CONFLUENCEWIKI/Configuring+a+datasource+connection

相關文章
相關標籤/搜索