公司使用的软件开发和协做工具为 Atlassian 系列软件,近期须要从腾讯云迁移到阿里云环境,简单记录下安装和配置过程。(Atlassian 的文档很是详尽,过程当中遇见的问题均可以找到解决办法。)java
名称 | 简介 |
---|---|
Crowd | 易于使用、管理和集成的单点登陆和身份管理工具。除了支持 Atlassian 系列软件,也支持 SonarQube,Jenkins,Nexus 等 |
JIRA | 使用敏捷团队的首选软件开发工具,规划、追踪和发布世界一流的软件。 |
Confluence | 可减小东找西找所花的时间,将更多的时间用在完成工做上。可在同一位置整理工做、建立文档并讨论一切内容。 |
Bitbucket | 经过内嵌的评论和拉取请求协做编写代码。整个团队管理并共享 Git 代码库以构建和交付软件。 |
Bamboo | 持续集成、部署和发布管理。 |
写在最前面,避免安装过程当中的坑坑坑。mysql
友情提示:安装过程当中遇见任何问题,直接上 google 或者 Atlassian 官网搜索,通常都有详细的文档支持linux
操做系统字符集:数据备份迁移时,可能会出现未知错误,如: Crowd 备份导入时,会出现日期转换错误。nginx
Mysql 驱动:支持 Mysql 数据库,可是未集成 Mysql jdbc 驱动,请提早准备。web
Mysql 字符集:库表字符集:utf8,排序字符集:utf8_bin。sql
阿里云 RDS 控制台,建立的 UTF8 数据库,默认排序字符集为:utf8_general_ci,须要修改成:utf8_bin。数据库
Git 版本:安装 Bitbucket 时,Git 版本须要是 2.2.0+。apache
软件 | 版本 | 说明 |
---|---|---|
Centos | V7.7 | 阿里云 ECS |
Oracle JDK | V1.8.0_171 | |
Git | V2.8.3 | Bitbucket 依赖 Git 2.2.0+ |
Mysql | V5.7 | 阿里云 RDS |
# 建立独立安装帐号 $ useradd crowd $ passwd crowd $ su - crowd # 下载 $ wget https://product-downloads.atlassian.com/software/crowd/downloads/atlassian-crowd-3.2.3.tar.gz # 解压 $ tar -zxvf atlassian-crowd-3.2.3.tar.gz # 设置 crowd.home $ vi /home/crowd/atlassian-crowd-3.2.3/crowd-webapp/WEB-INF/classes/crowd-init.properties ############### ## ## ## UNIX ## ## ## ############### ## On Unix-based operating systems, uncomment the following ## line and set crowd.home to a directory Crowd should use to ## store its configuration. crowd.home=/home/crowd/atlassian-crowd-3.2.3 # Crowd 支持 Mysql 数据库,可是未集成 Mysql jdbc 驱动 $ cp mysql-connector-java-5.1.46.jar /home/crowd/atlassian-crowd-3.2.3/apache-tomcat/lib # 启动 crowd $ sh /home/crowd/atlassian-crowd-3.2.3/start_crowd.sh
浏览器中访问 http://yourip:8095 进入初始化页面,输入 License
浏览器
选择导入备份
tomcat
设置数据库信息
参数设置
设置管理员帐号
设置完成
备份以前 Crowd 数据
导入备份数据便可
操做系统字符集不一致问题
# 修改操做系统字符集一致 $ echo 'LANG=zh_CN.UTF-8' > /etc/locale.conf $ source /etc/locale.conf
# 建立独立安装帐号 $ useradd jira $ passwd jira $ su - jira # 下载 $ wget https://product-downloads.atlassian.com/software/jira/downloads/atlassian-jira-software-7.10.0-x64.bin # 安装,一路回车便可 $ ./atlassian-jira-software-7.10.0-x64.bin Unpacking JRE ... Starting Installer ... 三月 26, 2020 7:00:44 下午 java.util.prefs.FileSystemPreferences$1 run 信息: Created user preferences directory. 三月 26, 2020 7:00:44 下午 java.util.prefs.FileSystemPreferences$2 run 信息: Created system preferences directory in java.home. You do not have administrator rights to this machine and as such, some installation options will not be available. Are you sure you want to continue? Yes [y, Enter], No [n] y This will install JIRA Software 7.10.0 on your computer. OK [o, Enter], Cancel [c] o Choose the appropriate installation or upgrade option. Please choose one of the following: Express Install (use default settings) [1], Custom Install (recommended for advanced users) [2, Enter], Upgrade an existing JIRA installation [3] 2 Where should JIRA Software be installed? [/home/jira/atlassian/jira] Default location for JIRA Software data [/home/jira/atlassian/application-data/jira] Configure which ports JIRA Software will use. JIRA requires two TCP ports that are not being used by any other applications on this machine. The HTTP port is where you will access JIRA through your browser. The Control port is used to startup and shutdown JIRA. Use default ports (HTTP: 8080, Control: 8005) - Recommended [1, Enter], Set custom value for HTTP and Control ports [2] Details on where JIRA Software will be installed and the settings that will be used. Installation Directory: /home/jira/atlassian/jira Home Directory: /home/jira/atlassian/application-data/jira HTTP Port: 8080 RMI Port: 8005 Install as service: No Install [i, Enter], Exit [e] Extracting files ... Please wait a few moments while JIRA Software is configured. Installation of JIRA Software 7.10.0 is complete Start JIRA Software 7.10.0 now? Yes [y, Enter], No [n] y Please wait a few moments while JIRA Software starts up. Launching JIRA Software ... Installation of JIRA Software 7.10.0 is complete Your installation of JIRA Software 7.10.0 is now ready and can be accessed via your browser. JIRA Software 7.10.0 can be accessed at http://localhost:8080 Finishing installation ... # 与 Crowd 相似,须要把 Mysql 驱动包 放到 atlassian/jira/lib 目录下,须要重启生效。 $ cp mysql-connector-java-5.1.46.jar /home/jira/atlassian/jira/lib # 重启 $ sh /home/jira/atlassian/jira/bin/stop-jira.sh $ sh /home/jira/atlassian/jira/bin/start-jira.sh
设置过程与 Crowd 相似。
# 建立独立安装帐号 $ useradd confluence $ passwd confluence $ su - confluence # 下载 $ wget https://product-downloads.atlassian.com/software/confluence/downloads/atlassian-confluence-6.9.1-x64.bin # 安装过程与 JIRA 相似 $ ./atlassian-confluence-6.9.1-x64.bin # 与 JIRA 相似,须要把 Mysql 驱动包 放到 /home/confluence/atlassian/confluence/confluence/WEB-INF/lib 目录下,须要重启生效。 $ cp mysql-connector-java-5.1.46.jar /home/confluence/atlassian/confluence/confluence/WEB-INF/lib # 重启 $ sh /home/confluence/atlassian/confluence/bin/stop-confluence.sh $ sh /home/confluence/atlassian/confluence/bin/stop-confluence.sh
设置过程与 JIRA 相似。
# 建立独立安装帐号 $ useradd bitbucket $ passwd bitbucket $ su - bitbucket # 下载 $ wget https://product-downloads.atlassian.com/software/stash/downloads/atlassian-bitbucket-5.11.1-linux-x64.bin # 安装前提条件:Git 版本须要 2.2.0+ # 安装过程与 JIRA 和 Confluence 相似 $ ./atlassian-bitbucket-5.11.1-linux-x64.bin # 与 JIRA 相似,须要把 Mysql 驱动包 放到 /home/bitbucket/atlassian/bitbucket/5.11.1/app/WEB-INF/lib 目录下,须要重启生效。 $ cp mysql-connector-java-5.1.46.jar /home/bitbucket/atlassian/bitbucket/5.11.1/app/WEB-INF/lib # 重启 $ sh /home/bitbucket/atlassian/bitbucket/5.11.1/bin/stop-bitbucket.sh $ sh /home/bitbucket/atlassian/bitbucket/5.11.1/bin/start-bitbucket.sh
设置过程与 JIRA 和 Confluence 相似。
# 建立独立安装帐号 $ useradd bamboo $ passwd bamboo $ su - bamboo # 下载 $ wget https://product-downloads.atlassian.com/software/bamboo/downloads/atlassian-bamboo-6.6.0.tar.gz # 解压 $ tar -zxvf atlassian-bamboo-6.6.0.tar.gz # 设置 bamboo.home $ vi /home/bamboo/atlassian-bamboo-6.6.0/atlassian-bamboo/WEB-INF/classes/bamboo-init.properties bamboo.home=/home/bamboo/atlassian-bamboo-6.6.0 # Crowd 支持 Mysql 数据库,可是未集成 Mysql jdbc 驱动 $ cp mysql-connector-java-5.1.46.jar /home/crowd/atlassian-crowd-3.2.3/apache-tomcat/lib # 启动 crowd $ sh atlassian-crowd-3.2.3/start_crowd.sh
设置过程与 Bitbucket 等都相似。
添加用户
新建Application
点击 “Applications” --> “Add application”,输入名称、描述、密码,点击建立。
输入 JIRA 地址 和 其 ip 地址,点击下一步。
选择容许访问 JIRA 的组,加入进去
确认信息,点击 “Add application” ,添加应用完成。
使用 JIRA 管理员,登陆 JIRA。
点击用户管理 --> 用户目录 --> 添加目录,选择 “Atlassian 人群”,点击下一步。
输入 Crowd 服务器的配置,点击测试,并保存。
名称:Crowd Server
服务器的URL: Crowd的URL地址,好比:http://www.example.com:8095/crowd/
应用程序名称:与在 Crowd 里配置的 Application 名称一致
应用程序密码:与在 Crowd 里配置的 Application 密码一致
系统默认每 1 小时从 Crowd 同步一次用户(系统管理员可修改),点击同步按钮也可手动同步。
注销管理员用户,使用 Crowd 里的用户尝试登录 JIRA,发现可以登陆进去了。
参考 Crowd 与 JIRA 集成。
默认安装好的 Atlassian 各应用是这样的:
为了快捷访问,须要设置 Atlassian 各应用的访问地址为统一规范,以下:
# jira 的 nginx 设置,其余相似 location ^~ /jira { proxy_pass http://x.x.x.x:8080/jira; sendfile off; proxy_set_header Host $host:$server_port; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_max_temp_file_size 0; # This is the maximum upload size client_max_body_size 10m; client_body_buffer_size 128k; proxy_connect_timeout 90; proxy_send_timeout 90; proxy_read_timeout 90; proxy_temp_file_write_size 64k; # Required for new HTTP-based CLI proxy_http_version 1.1; proxy_request_buffering off; proxy_buffering off; # Required for HTTP-based CLI to work over SSL }
默认支持,无需修改。
# server.xml,在 Context 标签中添加 path="/jira" $ vi /home/jira/atlassian/jira/conf/server.xml <Context path="/jira" docBase="${catalina.home}/atlassian-jira" reloadable="false" useHttpOnly="true"> # 重启生效
# server.xml,在 Context 标签中添加 path="/confluence" $ vi /home/confluence/atlassian/confluence/conf/server.xml <Context path="/confluence" docBase="../confluence" debug="0" reloadable="false" useHttpOnly="true"> # 重启生效
# bitbucket.properties $ echo "server.context-path=/bitbucket" >> /home/bitbucket/atlassian/application-data/bitbucket/shared/bitbucket.properties # 重启生效
# server.xml,在 Context 标签中添加 path="/bamboo" $ vi /home/bamboo/atlassian-bamboo-6.6.0/conf/server.xml <Context path="/bamboo" docBase="${catalina.home}/atlassian-bamboo" reloadable="false" useHttpOnly="true"> # 重启生效
单点登陆(SSO)须要有域名支持,也就是说,在配置sso以前,各应用系统已配置好相应的域名。
# 编辑 seraph-config.xml $ vi /home/confluence/atlassian/confluence/confluence/WEB-INF/classes/seraph-config.xml # 注释掉 <!--<authenticator class="com.atlassian.confluence.user.ConfluenceGroupJoiningAuthenticator"/>--> # 打开注释 <authenticator class="com.atlassian.confluence.user.ConfluenceCrowdSSOAuthenticator"/> # 修改 crowd.properties $ vi /home/confluence/atlassian/confluence/confluence/WEB-INF/classes/crowd.xml application.name:配置 crowd 里该 Application 的名称 application.password:配置 crowd 里该 Application 的密码 application.login.url:配置 crowd 的地址 crowd.server.url:配置 crowd 的 services 地址 crowd.base.url:配置 crowd 的 baseurl 地址 session.tokenkey:与 crowd 管理页面的SSO cookie name保持一致 # 重启 Confluence 生效
验证
先登陆crowd,而后在打开一个页面,输入confluence地址,发现不须要在手动输入帐户密码,直接就登进去了
注意:必须使用带域名的地址,登陆的用户必须是同步过的用户。
参考 Confluence 配置 sso,基本同样,只是 JIRA 的安装目录里没有 crowd.properties 文件,能够从 Confluence 或者 Crowd 拷贝一份,而后修改配置的内容便可。
# 编辑 bitbucket.properties $ vi /home/bitbucket/atlassian/application-data/bitbucket/shared/bitbucket.properties # 添加下面的属性 plugin.auth-crowd.sso.enabled=true # 重启 Bitbucket 生效
# 编辑 seraph-config.xml $ vi /home/bamboo/atlassian-bamboo-6.6.0/atlassian-bamboo/WEB-INF/classes/seraph-config.xml # 注释掉 <!--<authenticator class="com.atlassian.bamboo.user.authentication.BambooAuthenticator"/>--> # 打开注释 <authenticator class="com.atlassian.crowd.integration.seraph.v25.BambooAuthenticator"/> # 修改 crowd.properties $ vi /home/bamboo/atlassian-bamboo-6.6.0/xml-data/configuration/crowd.properties application.name:配置 crowd 里该 Application 的名称 application.password:配置 crowd 里该 Application 的密码 application.login.url:配置 crowd 的地址 crowd.server.url:配置 crowd 的 services 地址 crowd.base.url:配置 crowd 的 baseurl 地址 session.tokenkey:与 crowd 管理页面的SSO cookie name保持一致 # 重启 Bamboo 生效