本文已参与「新人创作礼」活动,一起开启掘金创作之路。
Confluence简介
Confluence是一个企业级的专业知识管理平台和协同平台,我们可以在Confluence上面进行创建,分享和讨论文件,想法,备忘录,规格,实体模型,图表和项目, 通过Confluence平台进行小组工作的协同和知识分享。
环境准备
- 系统:Ubuntu18.04
- 依赖:JDK8+
- 数据库:本文使用MySQL5.7
安装过程
-
下载安装程序。官网
- 建议下载长期支持版本,亲测当前最新版本7.18.0激活失败,7.4.6版本激活成功
root@admin:/home# wget https://product-downloads.atlassian.com/software/confluence/downloads/atlassian-confluence-7.4.6-x64.bin -P /home -
下载MySQL驱动程序,并解压出需要的jar包。后续连接MySQL时会用到,使用其他数据库的请下线对应数据库驱动。官网
- 由于confluence使用mysql-5.4.18进行测试,需要下载5.4.18版本的JDBC驱动程序。
root@admin:/home# wget https://cdn.mysql.com/archives/mysql-connector-java-5.1/mysql-connector-java-5.1.48.tar.gz -P /home
-
本地电脑下载激活程序。链接:pan.baidu.com/s/1l5O1I8eg… 提取码:WIKI
-
新建自定义安装目录并执行安装程序。
# 创建自定义目录
root@admin:/home# mkdir wiki-7.4.6
# 执行安装程序
root@admin:/home# sh atlassian-confluence-7.4.6-x64.bin
Unpacking JRE ...
Starting Installer ...
# 确认安装 OK/Cancel
This will install Confluence 7.4.6 on your computer.
OK [o, Enter], Cancel [c]
o
Click Next to continue, or Cancel to exit Setup.
# 设置安装目录 1 默认,2 自定义,3 更新已经存在的设置
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 7.4.6 to be installed,
then click Next.
Where should Confluence 7.4.6 be installed?
[/opt/atlassian/confluence]
/home/wiki-7.4.6/server
# 输入自定义数据目录,不设置使用默认
Default location for Confluence data
[/var/atlassian/application-data/confluence]
/home/wiki-7.4.6/data
# 设置服务端口,默认HTTP: 8090, Control: 8000
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
# 注册系统服务
Confluence can be run in the background.
You may choose to run Confluence as a service, which means it will start
automatically whenever the computer restarts.
Install Confluence as Service?
Yes [y, Enter], No [n]
y
Extracting files ...
====================================================================done
Please wait a few moments while we configure Confluence.
# 安装完成,是否立即启动
Installation of Confluence 7.4.6 is complete
Start Confluence now?
Yes [y, Enter], No [n]
y
Please wait a few moments while Confluence starts up.
Launching Confluence ...
# 启动完成,浏览器访问测试
Installation of Confluence 7.4.6 is complete
Your installation of Confluence 7.4.6 is now ready and can be accessed via
your browser.
Confluence 7.4.6 can be accessed at http://localhost:8090
Finishing installation ...
激活及配置。支持正版,企业建议购买。
-
浏览器访问:http://192.168.x.x:8090 (启动后confluence的地址),设置语言->产品安装->下一步
-
扩展应用,不勾选,直接下一步。
-
激活页面,下载confluence安装目录
/home/wiki-7.4.6/server/confluence/WEB-INF/lib下的atlassian-extras-decoder-v2-3.4.1.jar包到本地电脑,并重命名为atlassian-extras-2.4.jar(激活工具固定读取的名称)。 -
激活。支持正版,企业建议购买。
- 打开激活程序
confluence_keygen.jar,复制激活页面的服务器ID粘贴到激活工具,选择上面下载的jar包,点击gen获取授权码,这时atlassian-extras-2.4.jar已经是激活之后的了。 - 到这里不要着急复制授权码到激活页面,需要先将
atlassian-extras-2.4.jar重命名为原来的atlassian-extras-decoder-v2-3.4.1.jar,并上传覆盖到/home/wiki-7.4.6/server/confluence/WEB-INF/lib目录(注意先备份原jar包,失败可重试)。 - 同时将上面下载的数据库驱动包
mysql-connector-java-5.1.48.jar也放到该目录,重启confluence服务再复制授权码激活。
root@admin:/home/wiki-7.4.6/server/confluence/WEB-INF/lib# cd /home/wiki-7.4.6/server/bin/ root@admin:/home/wiki-7.4.6/server/bin# ./stop-confluence.sh # ... root@admin:/home/wiki-7.4.6/server/bin# ./start-confluence.sh # ... - 打开激活程序
-
设置数据库。选择MySQL数据库(使用其他数据库的选择对应的类型),通过连接字符串连接(方便设置连接的字符编码等连接参数,否则会出现中文乱码),新建数据库
confluence,并复制数据库连接地址到配置页面。测试连接,连接通过后下一步等待数据库初始化。- 使用连接字符串的方式(
&符号需要转义为&):
jdbc:mysql://127.0.0.1:3306/confluence?characterEncoding=UTF-8&useUnicode=true&sessionVariables=tx_isolation=READ-COMMITTED&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai- 如果提示找不到驱动包则是上面的驱动包没有放对位置。检查数据库驱动包并重启confluence服务。
- 提示数据库必须使用READ-COMMITTED则是数据库事务隔离级别不对。设置隔离级别:
SET GLOBAL TRANSACTION ISOLATION LEVEL READ COMMITTED;,重启MySQL服务。
- 使用连接字符串的方式(
-
加载内容。首次安装选择空白站点。
-
配置用户管理,这里只安装了Confluence,选择在Confluence中管理用户与组。
-
配置系统管理员账户。
-
至此搭建完成。
参考:
- 数据库事务隔离级别:blog.csdn.net/m0_51060165…