公司使用的軟件開發和協做工具爲 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 生效