小生博客:http://xsboke.blog.51cto.comcss
-------謝謝您的參考,若有疑問,歡迎交流
version:html
centos==7.2 jdk==1.8 confluence==6.15.4 jira-software==8.2.1 docker==18.09
安裝前提示:java
1. 須要準備2個數據庫,由於confluence和jira-software的mysql配置要求不同 2. confluence須要配置jdk,jira-software自帶jdk
選擇使用docker部署的緣由:mysql
1. confluence和jira-software環境需求不一樣,須要分開配置. 2. 若是直接使用物理機,須要佔用多臺. 3. 不使用虛擬機是由於docker更輕量,並且更容易遷移. 4. confluence和jira-software只是做爲公司內部員工使用,不須要過高的配置和複雜的環境
這次部署流程:linux
1. 配置jira-software須要的數據庫 2. 配置jira-software 3. 配置confluence須要的數據庫 4. 配置confluence
容器名稱和IP分佈:c++
由於wiki的帳號能夠由jira控制,因此咱們首先安裝jira-software 宿主機IP:10.0.0.25 1. jira-software jira-mysql 192.168.0.10 confluence-jira 192.168.0.100 2. confluence wiki-mysql 192.168.0.20 confluence-wiki 192.168.0.200
1、docker-ce環境配置web
1. 安裝docker $ sudo yum remove docker \ docker-client \ docker-client-latest \ docker-common \ docker-latest \ docker-latest-logrotate \ docker-logrotate \ docker-engine $ sudo yum install -y yum-utils \ device-mapper-persistent-data \ lvm2 $ sudo yum-config-manager \ --add-repo \ https://download.docker.com/linux/centos/docker-ce.repo $ sudo yum install docker-ce docker-ce-cli containerd.io $ sudo systemctl enable docker $ sudo systemctl start docker 2. 配置添加自定義網橋,用於指定docker容器IP $ docker network create \ --driver=bridge \ --subnet=192.168.0.0/24 \ --ip-range=192.168.0.0/24 \ --gateway=192.168.0.254 \ br-custom 3. 下載由官方提供的容器基礎鏡像 docker pull centos:7.5.1511 docker pull mysql:5.7.26 4. 遷移docker容器默認存放目錄 systemctl stop docker mv /var/lib/docker /data/docker ln -s /data/docker /var/lib/docker systemctl start docker
2、jira-software部署sql
建立目錄: mkdir -p /docker-storage/confluence/jira/{etc,data,mysql} 釋: /docker-storage/confluence/jira/mysql : MySQL容器的數據目錄 /docker-storage/confluence/jira/etc : jira-software容器的安裝目錄 /docker-storage/confluence/jira/data : jira-software容器的數據目錄 1. 部署而且配置jira須要的MySQL # 啓動容器 docker run --name jira-mysql --network br-custom --ip 192.168.0.10 \ -v /docker-storage/confluence/jira/mysql:/var/lib/mysql \ -e MYSQL_ROOT_PASSWORD='123456Qr!' \ -d mysql:5.7.26 # 進入容器修改MySQL配置,而且建立jira-software須要的數據庫 docker exec -it jira-mysql "/bin/bash" apt update apt-get install vim vim /etc/mysql/mysql.conf.d/mysqld.cnf [mysqld] default-storage-engine=INNODB character_set_server=utf8mb4 innodb_default_row_format=DYNAMIC innodb_large_prefix=ON innodb_file_format=Barracuda innodb_log_file_size=2G sql_mode = NO_AUTO_VALUE_ON_ZERO mysql -uroot -p123456Qr! CREATE DATABASE jiradb CHARACTER SET utf8mb4 COLLATE utf8mb4_bin; GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,REFERENCES,ALTER,INDEX on jiradb.* TO 'confluence-jira'@'192.168.0.%' IDENTIFIED BY '123456Qr!'; flush privileges; # 重啓容器使MySQL配置生效 docker restart jira-mysql 2. 部署jira-software # 安裝jira-software的四個重要選項 安裝類型 - 選擇選項2(自定義)以得到最多控制權. 目標目錄 - 這是安裝Jira的地方. 主目錄 - 這是存儲日誌,搜索索引和文件等Jira數據的地方. TCP端口 - 這些是HTTP鏈接器端口和Jira將運行的控制端口.除非您在同一端口上運行其餘應用程序,不然請使用默認值. 安裝爲服務 - 使用"/etc/init.d/jira [stop | start]"命令來控制jira服務. # 部署容器而且安裝jira-software docker run -dit --name confluence-jira --network br-custom --ip 192.168.0.100 -p 10.0.0.25:10010:8080 \ -v /docker-storage/confluence/jira/:/usr/local/confluence/ \ -v /docker-storage/confluence/jira/etc/:/usr/local/confluence/etc/ \ -v /docker-storage/confluence/jira/data/:/usr/local/confluence/data/ \ centos:7.2.1511 "/bin/bash" docker exec -it confluence-jira "/bin/bash" yum -y install epel-release yum -y install libffi-devel gcc gcc-c++ make automake zlib zlib-devel openssl-devel wget gcc gcc-c++ make automake zlib zlib-devel openssl-devel dejavu-sans-fonts vim lrzsz wget https://product-downloads.atlassian.com/software/jira/downloads/atlassian-jira-software-8.2.1-x64.bin chmod a+x atlassian-jira-software-8.2.1-x64.bin ./atlassian-jira-software-8.2.1-x64.bin > 交互式安裝過程: Unpacking JRE ... Starting Installer ... > 這會在你的計算機中安裝jira software,回車便可 This will install JIRA Software 8.2.1 on your computer. OK [o, Enter], Cancel [c] Click Next to continue, or Cancel to exit Setup. > 這裏輸入1是默認安裝,2是自定義安裝,3是更新,選擇2 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 > 選擇你的jira安裝目錄 Select the folder where you would like JIRA Software to be installed. Where should JIRA Software be installed? [/opt/atlassian/jira] /usr/local/confluence/etc > 選擇你的jira數據目錄 Default location for JIRA Software data [/var/atlassian/application-data/jira] /usr/local/confluence/data > 能夠指定服務端口,這裏是默認 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] > 是否將jira安裝爲服務,安裝爲服務後使用"/etc/init.d/jira [stop | start]"來控制jira的中止和啓動. JIRA can be run in the background. You may choose to run JIRA as a service, which means it will start automatically whenever the computer restarts. Install JIRA as Service? Yes [y, Enter], No [n] y > 這裏列出了你以前輸入的配置信息,詢問你否安裝,回車便可 Details on where JIRA Software will be installed and the settings that will be used. Installation Directory: /usr/local/confluence/etc Home Directory: /usr/local/confluence/data HTTP Port: 8080 RMI Port: 8005 Install as service: Yes Install [i, Enter], Exit [e] Extracting files ... Please wait a few moments while JIRA Software is configured. > jira software已經安裝成功,是否如今啓動 Installation of JIRA Software 8.2.1 is complete Start JIRA Software 8.2.1 now? Yes [y, Enter], No [n] y Please wait a few moments while JIRA Software starts up. Launching JIRA Software ... Installation of JIRA Software 8.2.1 is complete Your installation of JIRA Software 8.2.1 is now ready and can be accessed via your browser. JIRA Software 8.2.1 can be accessed at http://localhost:8080 Finishing installation ... # 由於jira並無自帶java鏈接mysql的驅動器,因此這裏須要本身下載,而且放入對應目錄. wget https://cdn.mysql.com//Downloads/Connector-J/mysql-connector-java-5.1.47.tar.gz tar zxf mysql-connector-java-5.1.47.tar.gz cp mysql-connector-java-5.1.47/mysql-connector-java-5.1.47-bin.jar /usr/local/confluence/etc/lib/ /etc/init.d/jira stop /etc/init.d/jira start # 到此就能夠訪問"http://10.0.0.25:10010"初始化你的jira-software配置,暫時先使用jira的試用受權許可(普通版) # 破解jira-software > 備份原文件 mv /usr/local/confluence/etc/atlassian-jira/WEB-INF/lib/atlassian-extras-3.2.jar /root/ > 將破解文件移動到源位置 cp atlassian-extras-3.2.jar /usr/local/confluence/etc/atlassian-jira/WEB-INF/lib/atlassian-extras-3.2.jar > 重啓服務 /etc/init.d/jira stop /etc/init.d/jira start > 查看許可證過時時間 許可證狀態查看http://10.0.0.25:10010/plugins/servlet/applications/versions-licenses
3、jira-software啓動後問題處理.docker
處理/usr/local/confluence/etc/logs/catalina.out警告: Fri May 31 12:05:49 UTC 2019 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification. 問題 vim /usr/local/confluence/data/dbconfig.xml <url>jdbc:mysql://address=(protocol=tcp)(host=192.168.0.10)(port=3306)/jiradb?sessionVariables=default_storage_engine=InnoDB</url> 改成 <url>jdbc:mysql://address=(protocol=tcp)(host=192.168.0.10)(port=3306)/jiradb?useSSL=false&sessionVariables=default_storage_engine=InnoDB</url> 重啓jira /etc/init.d/jira stop /etc/init.d/jira start
4、confluence部署數據庫
建立目錄: mkdir -p /docker-storage/confluence/wiki/{etc,data,mysql} 釋: /docker-storage/confluence/wiki/mysql : MySQL容器的數據目錄 /docker-storage/confluence/wiki/etc : wiki容器的安裝目錄 /docker-storage/confluence/wiki/data : wiki容器的數據目錄 1. 部署而且配置wiki須要的MySQL # 啓動容器 docker run --name wiki-mysql --network br-custom --ip 192.168.0.20 \ -v /docker-storage/confluence/wiki/mysql:/var/lib/mysql \ -e MYSQL_ROOT_PASSWORD='123456Qr!' \ -d mysql:5.7.26 # 進入容器修改MySQL配置,而且建立jira-software須要的數據庫 docker exec -it wiki-mysql "/bin/bash" apt update apt-get install vim vim /etc/mysql/mysql.conf.d/mysqld.cnf [mysqld] character-set-server=utf8 collation-server=utf8_bin default-storage-engine=INNODB max_allowed_packet=256M innodb_log_file_size=2GB sql_mode = NO_AUTO_VALUE_ON_ZERO transaction-isolation=READ-COMMITTED binlog_format=row mysql -uroot -p123456Qr! CREATE DATABASE confluence CHARACTER SET utf8 COLLATE utf8_bin; GRANT ALL PRIVILEGES ON confluence.* TO 'confluence_user'@'192.168.0.%' IDENTIFIED BY '123456Qr!'; flush privileges; # 重啓容器使MySQL配置生效 docker restart wiki-mysql 2. 部署wiki # 安裝wiki的選項和jira幾乎相同 # 部署容器而且安裝wiki docker run -dit --name confluence-wiki --network br-custom --ip 192.168.0.200 -p 10.0.0.25:10020:8090 \ -v /docker-storage/confluence/wiki/:/usr/local/confluence/ \ -v /docker-storage/confluence/wiki/etc/:/usr/local/confluence/etc/ \ -v /docker-storage/confluence/wiki/data/:/usr/local/confluence/data/ \ centos:7.2.1511 "/bin/bash" docker exec -it confluence-wiki "/bin/bash" yum -y install epel-release yum -y install libffi-devel gcc gcc-c++ make automake zlib zlib-devel openssl-devel wget gcc gcc-c++ make automake zlib zlib-devel openssl-devel dejavu-sans-fonts vim lrzsz # wiki須要手動配置jdk wget https://download.oracle.com/otn/java/jdk/8u202-b08/1961070e4c9b4e26a04e7f5a083f551e/jdk-8u202-linux-x64.tar.gz tar zxf jdk-8u202-linux-x64.tar.gz mv jdk1.8.0_202 /usr/local/jdk1.8 vim /etc/profile export JAVA_HOME=/usr/local/jdk1.8 export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar export PATH=$PATH:$JAVA_HOME/bin source /etc/profile # 安裝wiki wget https://product-downloads.atlassian.com/software/confluence/downloads/atlassian-confluence-6.15.4-x64.bin chmod a+x atlassian-confluence-6.15.4-x64.bin ./atlassian-confluence-6.15.4-x64.bin > 交互式安裝過程: This will install Confluence 6.15.4 on your computer. OK [o, Enter], Cancel [c] Click Next to continue, or Cancel to exit Setup. Choose the appropriate installation or upgrade option. Please choose one of the following: Express Install (uses default settings) [1], 快速安裝 Custom Install (recommended for advanced users) [2, Enter], 自定義安裝 - Upgrade an existing Confluence installation [3] 升級 2 Select the folder where you would like Confluence 6.15.4 to be installed, 選擇要安裝Confluence 6.15.4的文件夾, then click Next. 而後單擊Next。 Where should Confluence 6.15.4 be installed? 6.15.4應安裝在何處? [/opt/atlassian/confluence] /usr/local/confluence/etc Default location for Confluence data confluence數據的默認位置 [/var/atlassian/application-data/confluence] /usr/local/confluence/data Configure which ports Confluence will use. Confluence requires two TCP ports that are not being used by any other applications on this machine. The HTTP port is where you will access Confluence through your browser. The Control port is used to Startup and Shutdown Confluence. Use default ports (HTTP: 8090, Control: 8000) - Recommended [1, Enter], Set custom value for HTTP and Control ports [2] 1=默認,2=自定義 1 Confluence can be run in the background. 能夠在後臺運行Confluence。 You may choose to run Confluence as a service, which means it will start 您能夠選擇將Confluence做爲服務運行,這意味着它將啓動 automatically whenever the computer restarts. 自動每當計算機從新啓動。 Install Confluence as Service? 安裝Confluence做爲服務? Yes [y, Enter], No [n] Yes [y, Enter], No [n] y Extracting files ... Please wait a few moments while we configure Confluence. Installation of Confluence 6.15.4 is complete Confluence 6.15.4安裝完成 Start Confluence now? 如今啓動Confluence嗎? Yes [y, Enter], No [n] y Please wait a few moments while Confluence starts up. Launching Confluence ... Installation of Confluence 6.15.4 is complete Your installation of Confluence 6.15.4 is now ready and can be accessed via your browser. Confluence 6.15.4 can be accessed at http://localhost:8090 Finishing installation ... # wiki和jira同樣並無自帶java鏈接mysql的驅動器,因此這裏須要本身下載,而且放入對應目錄. wget https://cdn.mysql.com//Downloads/Connector-J/mysql-connector-java-5.1.47.tar.gz tar zxf mysql-connector-java-5.1.47.tar.gz cp mysql-connector-java-5.1.47/mysql-connector-java-5.1.47-bin.jar /usr/local/confluence/etc/confluence/WEB-INF/lib/ /etc/init.d/confluence restart # 到此就能夠訪問"http://10.0.0.25:10020"初始化你的wiki配置,暫時不要選擇組件,直接配置到有server ID的那一頁 # 破解wiki和jira徹底不一樣,須要兩步,一是破解文件,二是獲取受權碼 > 將wiki的/usr/local/confluence/etc/confluence/WEB-INF/lib/atlassian-extras-decoder-v2-3.4.1.jar文件下載到本地重命名爲atlassian-extras-2.4.jar > 找到破解軟件,右擊confluence_keygen.jar使用java運行(須要在windows上安裝好java) > 選擇".patch"找到剛纔從wiki上下載下來而且重命名的文件打開 > 注意破解程序暫時別關閉 > 而後打開你下載的破解包的文件目錄,能夠看到atlassian-extras-2.4.jar和atlassian-extras-2.4.bak兩個文件,這裏atlassian-extras-2.4.jar已是破解好的 > 將atlassian-extras-2.4.jar名字改回爲atlassian-extras-decoder-v2-3.4.1.jar而後傳到wiki的/usr/local/confluence/etc/confluence/WEB-INF/lib/下 /etc/init.d/confluence restart > 複製網頁中的server ID,而後返回你的破解程序,將server ID填入到破解程序,而且填入其餘信息(隨意填,郵箱格式要正確) > 點擊破解程序".gen!"按鈕,而後將生成的key填入web中便可
5、confluence問題處理
對於console報錯500,atlassian的社區幫助這樣回覆
1. confluence配置完成後發現css樣式不顯示,而且console報錯500 atlassian的社區幫助這樣提示: confluence賬戶必對目錄 <confluence_home>和<confluence_install> 擁有讀/寫/執行權限 解決辦法(不要加-R): chmod 755 /usr/local/confluence/data 2. wiki登陸後提示:在您系統中的服務器 SQL 模式健康檢查失敗了. 進入wiki-mysql容器註釋以下行 vim /etc/mysql/mysql.conf.d/mysqld.cnf # sql_mode = NO_AUTO_VALUE_ON_ZERO docker restart wiki-mysql 3. 處理catalina.out警告: 處理/usr/local/confluence/etc/logs/catalina.out警告: Fri May 31 12:16:44 UTC 2019 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification. 問題 vim /usr/local/confluence/data/confluence.cfg.xml <property name="hibernate.connection.url">jdbc:mysql://192.168.0.20:3306/confluence</property> 改成 <property name="hibernate.connection.url">jdbc:mysql://192.168.0.20:3306/confluence?useSSL=false</property> /etc/init.d/confluence restart