1. 程式人生 > >Confluence 6 新 Confluence 安裝配置一個數據源連接

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

繼續 postgres 連接 server 數據源 wait microsoft double sna

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

1. 停止 Confluence

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

  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 目錄中。

下面的連接是有關如果找到你的數據庫驅動:

  • 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 中。

  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.

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

  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 的安裝進程了。

  1. 使用 bin/start-confluence.shbin/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

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