【背景】
原先的Confluence, JIRA, Fisheye都部署在一台服務器(192.168.200.203)上,導致這台機器太卡,公司又分配了兩台虛擬機來分開這幾個應用(192.168.200.241, 192.168.200.242),按照以下進行分配:
Fisheye: 192.168.200.241,考慮到Fisheye是代碼審查工具,開發人員有18個人同時使用,而且訪問頻率很高,故單獨給Fisheye放在一台機器上
Confluence, JIRA:192.168.200.242:這兩個放在一台機器上,訪問人數不是特別多,訪問頻率不是很高
【開工】
JIRA:
-
直接從老的系統拷貝過來:
-
整個tomcat拷貝過來:
scp -r oecs-g2/apache-tomcat-6.0.35-jira/ sysadmin@192.168.200.242:/usr/local/oecs-g2/apache-tomcat-6.0.35-jira/
-
整個jirahome拷貝過來:
scp -r oecs-g2/jirahome/ sysadmin@192.168.200.242: /usr/local/oecs-g2/jira/jirahome
-
-
配置web目錄下jirahome路徑,在webapps/jira下面的配置文件:
-
配置文件:WEB-INF/classes/jira-application.properties
-
修改內容,紅色內容,改成拷貝過來的jirahome
# Do not modify this file unless instructed. It is here to store the location of the JIRA home directory only and is typically written to by the installer.
jira.home=/usr/local/oecs-g2/jira/jirahome
-
-
配置jira的數據庫,:
-
配置文件:/usr/local/oecs-g2/jira/jirahome/dbconfig.xml
-
修改內容,如果以前是使用localhost,需要改成對應的IP,如果換了數據庫,則需要配置成新的數據庫(以下紅色連接)及用戶名密碼:
<?xml version="1.0" encoding="UTF-8"?>
<jira-database-config>
<name>defaultDS</name>
<delegator-name>default</delegator-name>
<database-type>mysql</database-type>
<jdbc-datasource>
<url>jdbc:mysql://192.168.200.203:3306/jira?useUnicode=true&characterEncoding=UTF8&sessionVariables=storage_engine=InnoDB</url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<username>jira</username>
<password>jira</password>
<pool-min-size>20</pool-min-size>
<pool-max-size>20</pool-max-size>
<pool-max-wait>30000</pool-max-wait>
<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-max-idle>20</pool-max-idle>
<pool-remove-abandoned>true</pool-remove-abandoned>
<pool-remove-abandoned-timeout>300</pool-remove-abandoned-timeout>
<pool-test-while-idle>true</pool-test-while-idle>
<validation-query-timeout>3</validation-query-timeout>
</jdbc-datasource>
</jira-database-config>
-
-
將老的JIRA停掉,然后啟動新的tomcat服務器,成功,至此,JIRA遷移成功。
Fisheye遷移:
-
從200.203上拷貝Fisheye至200.241上
scp -r /usr/local/oecs-g2/fisheye/ sysadmin@192.168.200.241:/usr/local/oecs-g2/fisheye
-
修改Fisheye相關配置:
-
修改配置文件:vim /usr/local/oecs-g2/fisheye/fecru-2.10.2/config.xml
-
替換原Fisheye參數至新的:
-
更新ip參數:192.168.200.203:8060 ->192.168.200.241:8060
-
更新其他相關參數,由於我先前相關應用都部署在200.203上,所以我使用vim搜索200.203就能找到所有相關設置,並進行更改
-
數據庫:jdbcurl="jdbc:mysql://192.168.200.203:3306/fisheye",如果數據庫也遷移了,改成新數據庫即可
-
服務器地址及商品號(22-24行):
22 <web-server site-url="http://192.168.200.241:8060">
23 <http bind=":8060" proxy-port="8060" proxy-scheme="http" proxy-host="192.168.200.241"/>
24 </web-server>
-
JIRA與Fisheye通迅地址配置(33行):
33 crowd.server.url=http\://192.168.200.242\:8080/jira/
-
-
-
-
啟動之后,發現使用我自己的帳號不能進行登錄,重新對這Fisheye和JIRA進行配置,使得這兩個應用之間可以通迅:
-
在JIRA admin中配置,添加用戶服務器:用戶àJIRA用戶服務器,新建立一個,這里設置的用戶名密碼,在Fisheye里要用到,如下圖:
-
使用相應帳號進行設置Application Links:
-
在Fisheye admin中配置, Global Settings -> Application Links,將原先的link刪掉,新建App Links:
-
在Fisheye里進行授權Security SettingsàAuthentication,配置Fisheye使用JIRA的用戶:
-
點擊Re-Sync,此時所有用戶信息均已同步
-
4. 至此Fisheye配置完成,可以在Fisheye上使用JIRA用戶進行登錄並進行代碼審查
Reference:
配置JIRA & FishEye:
https://confluence.atlassian.com/display/FISHEYE0210/JIRA+and+Crowd+Authentication
Confluence遷移:
-
直接從老的系統拷貝過來,使用運維給的一個牛B的命令(不愧是專門搞linux,我還使用mount來掛載共享文件至本機目錄尼,真正體會到了外行的感覺HOHO),在200.203上執行:
-
整個tomcat拷貝過來
scp -r /usr/local/oecs-g2/confluence/apache-tomcat-6.0.35.confluence sysadmin@192.168.200.242:/usr/local/oecs-g2/apache-tomcat-6.0.35.confluence
-
整個confluence home拷貝過來
scp -r /usr/local/oecs-g2/confluence/data sysadmin@192.168.200.242:/usr/local/oecs-g2/confluence/
-
-
修改confluence配置文件:
-
WEB-INF/classes/confluence-init.properties
-
confluence.home=/usr/local/oecs-g2/confluence/data
-
-
停掉老的confluence,啟動失敗,報以下錯誤:
com.atlassian.util.concurrent.lazyreference$initializationexception java.lang.nullpointerexception
百度了好久,找不到關鍵信息,再次使用google,找到不少信息,技術搜索還得用谷哥
解決辦法,以下為E文原版內容:
This error is most commonly caused by either of the following:
-
corrupted plugin cache - this can be fixed by clearing the plugin cache,清除以下幾個目錄下的內容
-
<confluence-home>/bundled-plugins
-
<confluence-home>/plugins-cache
-
<confluence-home>/plugins-osgi-cache
-
<confluence-home>/plugins-temp
-
<confluence-home>/bundled-plugins_language
-
-
Confluence database not available - check the connection parameters in <CONFLUENCE-HOME>/confluence.cfg.xml and verify if the database user has access to all confluence tables,數據未配置好
-
<CONFLUENCE-HOME> not writable - check the permission of the directory and sub-directories,目錄權限不夠
我的問題出在第2點上,數據庫沒有配置,先前配置JIRA和Fisheye的時候去改數據庫配置的時候,發現都是直接用ip訪問了,大意了,沒在意,問題竟然出在大意的地方,讓粗心給折騰的……
-
啟動之,okay,使用用戶登錄,我靠,失敗…………修啊修,用戶終於同步,步驟見如下:
-
在jira里配置好app link及 JIRA用戶服務器,詳細見Fisheye遷移-3.abc
-
在confluence里配置用戶目錄(User Directories),配置在步驟a里設置的用戶名密碼:
à
à
-
-
然后,沒有然后了,設置完成
-
所有用戶使用JIRA里的用戶登錄,成功,遷移大功告成,哇哈哈哈