在Docker中部署Confluence和jira-software的方法步骤
version:
centos==7.2 jdk==1.8 confluence==6.15.4 jira-software==8.2.1 docker==18.09
安装前提示:
1.需要准备2个数据库,因为confluence和jira-software的mysql配置要求不一样
2.confluence需要配置jdk,jira-software自带jdk
选择使用docker部署的原因:
1.confluence和jira-software环境需求不同,需要分开配置.
2.如果直接使用物理机,需要占用多台.
3.不使用虚拟机是因为docker更轻量,而且更容易迁移.
4.confluence和jira-software只是作为公司内部员工使用,不需要太高的配置和复杂的环境
此次部署流程:
1.配置jira-software需要的数据库
2.配置jira-software
3.配置confluence需要的数据库
4.配置confluence
容器名称和IP分布:
因为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
一、docker-ce环境配置
1.安装docker
$sudoyumremovedocker\ docker-client\ docker-client-latest\ docker-common\ docker-latest\ docker-latest-logrotate\ docker-logrotate\ docker-engine $sudoyuminstall-yyum-utils\ device-mapper-persistent-data\ lvm2 $sudoyum-config-manager\ --add-repo\ https://download.docker.com/linux/centos/docker-ce.repo $sudoyuminstalldocker-cedocker-ce-clicontainerd.io $sudosystemctlenabledocker $sudosystemctlstartdocker
2.配置添加自定义网桥,用于指定docker容器IP
$dockernetworkcreate\ --driver=bridge\ --subnet=192.168.0.0/24\ --ip-range=192.168.0.0/24\ --gateway=192.168.0.254\ br-custom
3.下载由官方提供的容器基础镜像
dockerpullcentos:7.5.1511 dockerpullmysql:5.7.26
4.迁移docker容器默认存放目录
systemctlstopdocker mv/var/lib/docker/data/docker ln-s/data/docker/var/lib/docker systemctlstartdocker
二、jira-software部署
创建目录:
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
#启动容器 dockerrun--namejira-mysql--networkbr-custom--ip192.168.0.10\ -v/docker-storage/confluence/jira/mysql:/var/lib/mysql\ -eMYSQL_ROOT_PASSWORD='123456Qr!'\ -dmysql:5.7.26 #进入容器修改MySQL配置,并且创建jira-software需要的数据库 dockerexec-itjira-mysql"/bin/bash" aptupdate apt-getinstallvim 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! CREATEDATABASEjiradbCHARACTERSETutf8mb4COLLATEutf8mb4_bin; GRANTSELECT,INSERT,UPDATE,DELETE,CREATE,DROP,REFERENCES,ALTER,INDEXonjiradb.*TO'confluence-jira'@'192.168.0.%'IDENTIFIEDBY'123456Qr!'; flushprivileges; #重启容器使MySQL配置生效 dockerrestartjira-mysql
2.部署jira-software
#安装jira-software的四个重要选项 安装类型-选择选项2(自定义)以获得最多控制权. 目标目录-这是安装Jira的地方. 主目录-这是存储日志,搜索索引和文件等Jira数据的地方. TCP端口-这些是HTTP连接器端口和Jira将运行的控制端口.除非您在同一端口上运行其他应用程序,否则请使用默认值. 安装为服务-使用"/etc/init.d/jira[stop|start]"命令来控制jira服务. #部署容器并且安装jira-software dockerrun-dit--nameconfluence-jira--networkbr-custom--ip192.168.0.100-p10.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" dockerexec-itconfluence-jira"/bin/bash" yum-yinstallepel-release yum-yinstalllibffi-develgccgcc-c++makeautomakezlibzlib-developenssl-develwgetgccgcc-c++makeautomakezlibzlib-developenssl-develdejavu-sans-fontsvimlrzsz wgethttps://product-downloads.atlassian.com/software/jira/downloads/atlassian-jira-software-8.2.1-x64.bin chmoda+xatlassian-jira-software-8.2.1-x64.bin ./atlassian-jira-software-8.2.1-x64.bin >交互式安装过程: UnpackingJRE... StartingInstaller... >这会在你的计算机中安装jirasoftware,回车即可 ThiswillinstallJIRASoftware8.2.1onyourcomputer. OK[o,Enter],Cancel[c] ClickNexttocontinue,orCanceltoexitSetup. >这里输入1是默认安装,2是自定义安装,3是更新,选择2 Choosetheappropriateinstallationorupgradeoption. Pleasechooseoneofthefollowing: ExpressInstall(usedefaultsettings)[1],CustomInstall(recommendedforadvancedusers)[2,Enter],UpgradeanexistingJIRAinstallation[3] 2 >选择你的jira安装目录 SelectthefolderwhereyouwouldlikeJIRASoftwaretobeinstalled. WhereshouldJIRASoftwarebeinstalled? [/opt/atlassian/jira] /usr/local/confluence/etc >选择你的jira数据目录 DefaultlocationforJIRASoftwaredata [/var/atlassian/application-data/jira] /usr/local/confluence/data >可以指定服务端口,这里是默认 ConfigurewhichportsJIRASoftwarewilluse. JIRArequirestwoTCPportsthatarenotbeingusedbyanyother applicationsonthismachine.TheHTTPportiswhereyouwillaccessJIRA throughyourbrowser.TheControlportisusedtostartupandshutdownJIRA. Usedefaultports(HTTP:8080,Control:8005)-Recommended[1,Enter],SetcustomvalueforHTTPandControlports[2] >是否将jira安装为服务,安装为服务后使用"/etc/init.d/jira[stop|start]"来控制jira的停止和启动. JIRAcanberuninthebackground. YoumaychoosetorunJIRAasaservice,whichmeansitwillstart automaticallywheneverthecomputerrestarts. InstallJIRAasService? Yes[y,Enter],No[n] y >这里列出了你之前输入的配置信息,询问你否安装,回车即可 DetailsonwhereJIRASoftwarewillbeinstalledandthesettingsthatwillbeused. InstallationDirectory:/usr/local/confluence/etc HomeDirectory:/usr/local/confluence/data HTTPPort:8080 RMIPort:8005 Installasservice:Yes Install[i,Enter],Exit[e] Extractingfiles... PleasewaitafewmomentswhileJIRASoftwareisconfigured. >jirasoftware已经安装成功,是否现在启动 InstallationofJIRASoftware8.2.1iscomplete StartJIRASoftware8.2.1now? Yes[y,Enter],No[n] y PleasewaitafewmomentswhileJIRASoftwarestartsup. LaunchingJIRASoftware... InstallationofJIRASoftware8.2.1iscomplete YourinstallationofJIRASoftware8.2.1isnowreadyandcanbeaccessed viayourbrowser. JIRASoftware8.2.1canbeaccessedathttp://localhost:8080 Finishinginstallation... #因为jira并没有自带java连接mysql的驱动器,所以这里需要自己下载,并且放入对应目录. wgethttps://cdn.mysql.com//Downloads/Connector-J/mysql-connector-java-5.1.47.tar.gz tarzxfmysql-connector-java-5.1.47.tar.gz cpmysql-connector-java-5.1.47/mysql-connector-java-5.1.47-bin.jar/usr/local/confluence/etc/lib/ /etc/init.d/jirastop /etc/init.d/jirastart #到此就可以访问"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/ >将破解文件移动到源位置 cpatlassian-extras-3.2.jar/usr/local/confluence/etc/atlassian-jira/WEB-INF/lib/atlassian-extras-3.2.jar >重启服务 /etc/init.d/jirastop /etc/init.d/jirastart >查看许可证过期时间 许可证状态查看http://10.0.0.25:10010/plugins/servlet/applications/versions-licenses
三、jira-software启动后问题处理.
处理/usr/local/confluence/etc/logs/catalina.out警告:
FriMay3112:05:49UTC2019WARN:EstablishingSSLconnectionwithoutserver'sidentityverificationis
notrecommended.AccordingtoMySQL5.5.45+,5.6.26+and5.7.6+requirementsSSLconnectionmustbe
establishedbydefaultifexplicitoptionisn'tset.Forcompliancewithexistingapplicationsnotusing
SSLtheverifyServerCertificatepropertyissetto'false'.YouneedeithertoexplicitlydisableSSLby
settinguseSSL=false,orsetuseSSL=trueandprovidetruststoreforservercertificateverification.
问题
vim/usr/local/confluence/data/dbconfig.xmljdbc:mysql://address=(protocol=tcp)(host=192.168.0.10)(port=3306)/jiradb?sessionVariables=default_storage_engine=InnoDB
改为
jdbc:mysql://address=(protocol=tcp)(host=192.168.0.10)(port=3306)/jiradb?useSSL=false&sessionVariables=default_storage_engine=InnoDB
重启jira
/etc/init.d/jirastop /etc/init.d/jirastart
四、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
#启动容器 dockerrun--namewiki-mysql--networkbr-custom--ip192.168.0.20\ -v/docker-storage/confluence/wiki/mysql:/var/lib/mysql\ -eMYSQL_ROOT_PASSWORD='123456Qr!'\ -dmysql:5.7.26 #进入容器修改MySQL配置,并且创建jira-software需要的数据库 dockerexec-itwiki-mysql"/bin/bash" aptupdate apt-getinstallvim 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! CREATEDATABASEconfluenceCHARACTERSETutf8COLLATEutf8_bin; GRANTALLPRIVILEGESONconfluence.*TO'confluence_user'@'192.168.0.%'IDENTIFIEDBY'123456Qr!'; flushprivileges; #重启容器使MySQL配置生效 dockerrestartwiki-mysql
2.部署wiki
#安装wiki的选项和jira几乎相同 #部署容器并且安装wiki dockerrun-dit--nameconfluence-wiki--networkbr-custom--ip192.168.0.200-p10.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" dockerexec-itconfluence-wiki"/bin/bash" yum-yinstallepel-release yum-yinstalllibffi-develgccgcc-c++makeautomakezlibzlib-developenssl-develwgetgccgcc-c++makeautomakezlibzlib-developenssl-develdejavu-sans-fontsvimlrzsz #wiki需要手动配置jdk wgethttps://download.oracle.com/otn/java/jdk/8u202-b08/1961070e4c9b4e26a04e7f5a083f551e/jdk-8u202-linux-x64.tar.gz tarzxfjdk-8u202-linux-x64.tar.gz mvjdk1.8.0_202/usr/local/jdk1.8 vim/etc/profile exportJAVA_HOME=/usr/local/jdk1.8 exportCLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar exportPATH=$PATH:$JAVA_HOME/bin source/etc/profile #安装wiki wgethttps://product-downloads.atlassian.com/software/confluence/downloads/atlassian-confluence-6.15.4-x64.bin chmoda+xatlassian-confluence-6.15.4-x64.bin ./atlassian-confluence-6.15.4-x64.bin >交互式安装过程: ThiswillinstallConfluence6.15.4onyourcomputer. OK[o,Enter],Cancel[c] ClickNexttocontinue,orCanceltoexitSetup. Choosetheappropriateinstallationorupgradeoption. Pleasechooseoneofthefollowing: ExpressInstall(usesdefaultsettings)[1],快速安装 CustomInstall(recommendedforadvancedusers)[2,Enter],自定义安装- UpgradeanexistingConfluenceinstallation[3]升级 2 SelectthefolderwhereyouwouldlikeConfluence6.15.4tobeinstalled,选择要安装Confluence6.15.4的文件夹, thenclickNext.然后单击Next。 WhereshouldConfluence6.15.4beinstalled?6.15.4应安装在何处? [/opt/atlassian/confluence] /usr/local/confluence/etc DefaultlocationforConfluencedataconfluence数据的默认位置 [/var/atlassian/application-data/confluence] /usr/local/confluence/data ConfigurewhichportsConfluencewilluse. ConfluencerequirestwoTCPportsthatarenotbeingusedbyanyother applicationsonthismachine.TheHTTPportiswhereyouwillaccess Confluencethroughyourbrowser.TheControlportisusedtoStartupand ShutdownConfluence. Usedefaultports(HTTP:8090,Control:8000)-Recommended[1,Enter],SetcustomvalueforHTTPandControlports[2]1=默认,2=自定义 1 Confluencecanberuninthebackground.可以在后台运行Confluence。 YoumaychoosetorunConfluenceasaservice,whichmeansitwillstart您可以选择将Confluence作为服务运行,这意味着它将启动 automaticallywheneverthecomputerrestarts.自动每当计算机重新启动。 InstallConfluenceasService?安装Confluence作为服务? Yes[y,Enter],No[n]Yes[y,Enter],No[n] y Extractingfiles... PleasewaitafewmomentswhileweconfigureConfluence. InstallationofConfluence6.15.4iscompleteConfluence6.15.4安装完成 StartConfluencenow?现在启动Confluence吗? Yes[y,Enter],No[n] y PleasewaitafewmomentswhileConfluencestartsup. LaunchingConfluence... InstallationofConfluence6.15.4iscomplete YourinstallationofConfluence6.15.4isnowreadyandcanbeaccessedvia yourbrowser. Confluence6.15.4canbeaccessedathttp://localhost:8090 Finishinginstallation... #wiki和jira一样并没有自带java连接mysql的驱动器,所以这里需要自己下载,并且放入对应目录. wgethttps://cdn.mysql.com//Downloads/Connector-J/mysql-connector-java-5.1.47.tar.gz tarzxfmysql-connector-java-5.1.47.tar.gz cpmysql-connector-java-5.1.47/mysql-connector-java-5.1.47-bin.jar/usr/local/confluence/etc/confluence/WEB-INF/lib/ /etc/init.d/confluencerestart #到此就可以访问"http://10.0.0.25:10020"初始化你的wiki配置,暂时不要选择组件,直接配置到有serverID的那一页 #破解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/confluencerestart >复制网页中的serverID,然后返回你的破解程序,将serverID填入到破解程序,并且填入其他信息(随意填,邮箱格式要正确) >点击破解程序".gen!"按钮,然后将生成的key填入web中即可
五、confluence问题处理
对于console报错500,atlassian的社区帮助这样回复
1.confluence配置完成后发现css样式不显示,并且console报错500
atlassian的社区帮助这样提示:
confluence帐户必对目录
解决办法(不要加-R):
chmod755/usr/local/confluence/data
2.wiki登录后提示:在您系统中的服务器SQL模式健康检查失败了.
进入wiki-mysql容器注释如下行
vim/etc/mysql/mysql.conf.d/mysqld.cnf #sql_mode=NO_AUTO_VALUE_ON_ZERO dockerrestartwiki-mysql
3.处理catalina.out警告:
处理/usr/local/confluence/etc/logs/catalina.out警告:
FriMay3112:16:44UTC2019WARN:EstablishingSSLconnectionwithoutserver'sidentityverificationisnotrecommended.
AccordingtoMySQL5.5.45+,5.6.26+and5.7.6+requirementsSSLconnectionmustbeestablishedbydefaultifexplicit
optionisn'tset.ForcompliancewithexistingapplicationsnotusingSSLtheverifyServerCertificatepropertyissetto'false'.
YouneedeithertoexplicitlydisableSSLbysettinguseSSL=false,
orsetuseSSL=trueandprovidetruststoreforservercertificateverification
问题
vim/usr/local/confluence/data/confluence.cfg.xmljdbc:mysql://192.168.0.20:3306/confluence
改为
jdbc:mysql://192.168.0.20:3306/confluence?useSSL=false /etc/init.d/confluencerestart
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持毛票票。