[Tools]迁移Confluence, JIRA, Fisheye

背景

原先的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:

  1. 直接从老的系统拷贝过来:
    1. 整个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/

    1. 整个jirahome拷贝过来:

    scp -r oecs-g2/jirahome/ sysadmin@192.168.200.242: /usr/local/oecs-g2/jira/jirahome

  2. 配置web目录下jirahome路径,在webapps/jira下面的配置文件:
    1. 配置文件:WEB-INF/classes/jira-application.properties
    2. 修改内容,红色内容,改成拷贝过来的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

  3. 配置jira的数据库,:
    1. 配置文件:/usr/local/oecs-g2/jira/jirahome/dbconfig.xml
    2. 修改内容,如果以前是使用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&amp;characterEncoding=UTF8&amp;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>

  4. 将老的JIRA停掉,然后启动新的tomcat服务器,成功,至此,JIRA迁移成功。

 

Fisheye迁移:

  1. 从200.203上拷贝Fisheye至200.241上

scp -r /usr/local/oecs-g2/fisheye/ sysadmin@192.168.200.241:/usr/local/oecs-g2/fisheye

  1. 修改Fisheye相关配置:
    1. 修改配置文件:vim /usr/local/oecs-g2/fisheye/fecru-2.10.2/config.xml
    2. 替换原Fisheye参数至新的:
      1. 更新ip参数:192.168.200.203:8060 ->192.168.200.241:8060
      2. 更新其他相关参数,由于我先前相关应用都部署在200.203上,所以我使用vim搜索200.203就能找到所有相关设置,并进行更改
        1. 数据库:jdbcurl="jdbc:mysql://192.168.200.203:3306/fisheye",如果数据库也迁移了,改成新数据库即可
        2. 服务器地址及商品号(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>

        3. JIRA与Fisheye通迅地址配置(33行):

          33 crowd.server.url=http\://192.168.200.242\:8080/jira/

  2. 启动之后,发现使用我自己的帐号不能进行登录,重新对这Fisheye和JIRA进行配置,使得这两个应用之间可以通迅:
    1. 在JIRA admin中配置,添加用户服务器:用户àJIRA用户服务器,新建立一个,这里设置的用户名密码,在Fisheye里要用到,如下图:

            

    1. 使用相应帐号进行设置Application Links:

            

    1. 在Fisheye admin中配置, Global Settings -> Application Links,将原先的link删掉,新建App Links:

        

    1. 在Fisheye里进行授权Security SettingsàAuthentication,配置Fisheye使用JIRA的用户:

        

    1. 点击Re-Sync,此时所有用户信息均已同步

4. 至此Fisheye配置完成,可以在Fisheye上使用JIRA用户进行登录并进行代码审查

Reference:

配置JIRA & FishEye:

https://confluence.atlassian.com/display/FISHEYE0210/JIRA+and+Crowd+Authentication

 

Confluence迁移:

  1. 直接从老的系统拷贝过来,使用运维给的一个牛B的命令(不愧是专门搞linux,我还使用mount来挂载共享文件至本机目录尼,真正体会到了外行的感觉HOHO),在200.203上执行:
    1. 整个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

    1. 整个confluence home拷贝过来

    scp -r /usr/local/oecs-g2/confluence/data sysadmin@192.168.200.242:/usr/local/oecs-g2/confluence/

  2. 修改confluence配置文件:
    1. WEB-INF/classes/confluence-init.properties
    2. confluence.home=/usr/local/oecs-g2/confluence/data
  3. 停掉老的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点上,数据库没有配置,先前配置JIRAFisheye的时候去改数据库配置的时候,发现都是直接用ip访问了,大意了,没在意,问题竟然出在大意的地方,让粗心给折腾的……

  1. 启动之,okay,使用用户登录,我靠,失败…………修啊修,用户终于同步,步骤见如下:
    1. jira里配置好app link    JIRA用户服务器,详细见Fisheye迁移-3.abc
    2. confluence里配置用户目录(User Directories),配置在步骤a里设置的用户名密码:

      àà

    3.  
    4. 然后,没有然后了,设置完成

 

所有用户使用JIRA里的用户登录,成功,迁移大功告成,哇哈哈哈

posted @ 2014-03-24 20:57  我是小菜鸟  阅读(6376)  评论(6编辑  收藏  举报