CentOS7 install Confluence

发布于 2019-04-07  587 次阅读


环境 Centos7

IP 172.18.119.26

[title]0x01 安装Java JDK1.8[/title]

cd /opt
wget  https://download.oracle.com/otn-pub/java/jdk/8u201-b09/42970487e3af4f5aa5bca3f542482c60/jdk-8u201-linux-x64.rpm
rpm -ivh jdk-8u201-linux-x64.rpm
[root@localhost ~]# java -version
java version "1.8.0_201"
Java(TM) SE Runtime Environment (build 1.8.0_201-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.201-b09, mixed mode)

[title]0x02 安装数据库[/title]

[root@localhost ~]# yum localinstall http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm
[root@localhost ~]# yum install mysql-community-server

#启动mysql

[root@localhost ~]# systemctl start mysqld

#设置自动启动 mysql

[root@localhost ~]# systemctl enable mysqld

#查看mysql启动状态

[root@localhost ~]# systemctl status mysqld

#查看mysql的root账号的密码

[root@localhost ~]# cat /var/log/mysqld.log | grep 'temporary password'
2019-03-11T05:33:42.505109Z 1 [Note] A temporary password is generated for root@localhost: FZnb3DA.%N#R

#登录mysql

[root@localhost ~]# mysql -uroot -p
Enter password: 【输入mysql 密码】
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.25
Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>

#修改密码

ALTER USER 'root'@'localhost' IDENTIFIED BY 'King#Soft.$%8';

#修改root用户可远程登录

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'King#Soft.$%8' WITH GRANT OPTION;

#刷新

flush privileges;

# confluence的数据库

create database confluence character set utf8 collate utf8_bin;  
create user 'confluence'@'%' identified by 'King#Soft.$%9';
grant all privileges on confluence.* to 'confluence'@'localhost' IDENTIFIED BY 'King#Soft.$%9';
grant all privileges on confluence.* to 'confluence'@'%' IDENTIFIED BY 'King#Soft.$%9';
exit;

#修改my.cnf

vi /etc/my.cnf
[mysqld]
transaction-isolation=READ-COMMITTED
character-set-server=utf8
collation-server=utf8_bin
default-storage-engine=INNODB
binlog_format=row
innodb_log_file_size=2GB
max_allowed_packet=256M

[title]0x03 安装Confluence[/title]
#下载Confluence

cd /opt
wget https://www.atlassian.com/software/confluence/downloads/binary/atlassian-confluence-6.14.1-x64.bin

#赋予执行权限

chmod +x atlassian-confluence-6.14.2-x64.bin

# 安装

./atlassian-confluence-6.14.2-x64.bin

安装过程中需要回车确认:

This will install Confluence 6.14.2 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]
Select the folder where you would like Confluence 6.14.2 to be installed,
then click Next.
Where should Confluence 6.14.2 be installed?
[/opt/atlassian/confluence]    # 回车,确认安装目录
Default location for Confluence data
[/var/atlassian/application-data/confluence]    # 回车,确认confluence的数据目录
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]  # 回车,确认端口
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]   # 回车
Extracting files ...
Please wait a few moments while we configure Confluence.
Installation of Confluence 6.14.2 is complete
Start Confluence now?
Yes [y, Enter], No [n]   # 回车

然后可以进入页面的配置安装。略

http://172.18.119.26:8090

注意:需要导入mysql-connector-java-5.1.47驱动

文件导入到

/opt/atlassian/confluence/confluence/WEB-INF/lib/

[title]0x04 修改confluence home 目录[/title]
confluence home 默认home目录在

/var/atlassian/application-data/confluence

#需修改配置文件

/opt/atlassian/confluence/confluence/WEB-INF/classes/confluence-init.properties
vi confluence-init.properties
confluence.home = /data/confluence

#修改后复制原confluence home 资料到新目录

cp -avx /var/atlassian/application-data/*  /data/

#重启confluence服务

/etc/init.d/confluence restart

[title]0x05 重装 confluence[/title]
1.先备份

登录管理员-应用管理-管理-备份与还原 ,整站备份,

2.删除home 目录的内容,或者修改配置文件opt/atlassian/confluence/confluence/WEB-INF/classes/confluence-init.properties ,新定义一个新的 confluence.home

3.删除数据库 drop database confluence;或者新建一个数据库 create database confluence_db character set utf8 collate utf8_bin;

4.重启confluence服务

/etc/init.d/confluence restart

稍等片刻后

浏览器打开 访问 confluence

[title]0x06 升级 confluence[/title]
1.先备份

登录管理员-应用管理-管理-备份与还原 ,整站备份;

2.

X-shell rz atlassian-confluence-6.15.1-x64.bin

3.

chmod +x atlassian-confluence-6.15.1-x64.bin

4..

/atlassian-confluence-6.15.1-x64.bin
Unpacking JRE ...
Starting Installer ...
This will install Confluence 6.15.1 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],  
Upgrade an existing Confluence installation [3, Enter]
3
Existing installation directory:
[/opt/atlassian/confluence]

Back Up Confluence Home
The upgrade process will automatically back up your Confluence Installation
Directory. You can also choose to back up your existing Confluence Home
Directory. Both directories are backed up as zip archive files in their
respective parent directory locations.
We strongly recommend choosing this option in the unlikely event that you
experience problems with the upgrade and may require these backups to
restore your existing Confluence installation.
If you have many attachments in your Confluence Home Directory, the zip
archive of this directory may consume a significant amount of disk space.
Back up Confluence home ?
Yes [y, Enter], No [n]

Checking for local modifications.
List of modifications made within Confluence directories.
The following provides a list of file modifications within the confluence
directory.

Modified files:
confluence/WEB-INF/lib/atlassian-extras-decoder-v2-3.4.1.jar
Removed files:
(none)
Added files:
confluence/WEB-INF/classes/log4j-diagnostic.properties
confluence/WEB-INF/lib/mysql-connector-java-5.1.47.jar

[Enter]

Checking if your instance of Confluence is running
Upgrade Check List
Back up your external database
We strongly recommend you back up your Confluence database if you have not
already done so.
Please refer to the following URL for back up guidelines:
http://docs.atlassian.com/confluence/docs-6.15.1/Production+Backup+Strategy
Check plugin compatibility
Check that your non-bundled plugins are compatible with Confluence 6.15.1.
Access the plugin manager through the following URL:
http://localhost:8090/plugins/servlet/upm#compatibility
For more information see our documentation at the following URL:
http://docs.atlassian.com/confluence/docs-6.15.1/Installing+and+Configuring+Plugins+using+the+Universal+Plugin+Manager
Please ensure you have read the above checklist before upgrading.
Your existing Confluence installation is about to be upgraded!
The upgrade process will shut down your existing Confluence installation to complete the upgrade.
Do you want to proceed?
Upgrade [u, Enter], Exit [e]
Your instance of Confluence is currently being upgraded.
Shutting down Confluence...

Checking if Confluence has been shutdown...
Backing up the Confluence installation directory
Backing up the Confluence home directory                                                                          
Deleting the previous Confluence installation directory...
Extracting files ...                                                                           

Please wait a few moments while we configure Confluence.
Installation of Confluence 6.15.1 is complete
Start Confluence now?
Yes [y, Enter], No [n]
Please wait a few moments while Confluence starts up.
Launching Confluence ...
Installation of Confluence 6.15.1 is complete
Your installation of Confluence 6.15.1 is now ready and can be accessed via
your browser.
Custom modifications
Your previous Confluence installation contains customisations that must be
manually transferred. Refer to our documentation more information:
http://docs.atlassian.com/confluence/docs-6.15.1/Upgrading+Confluence#UpgradingConfluence-custommodifications
Confluence 6.15.1 can be accessed at http://localhost:8090
Confluence 6.15.1 may take several minutes to load on first start up.
Finishing installation ...

[title]0x07 Confluence数据迁移[/title]
数据迁移原理
1.系统后台-管理-还原与备份-整站备份
2.下载到本地,然后上传到新的服务器
3.将系统装好(建议安装旧系统相同版本)
4.把备份文件上传到/restore
5.新系统后台-管理-还原与备份-恢复整站数据


一沙一世界,一花一天堂。君掌盛无边,刹那成永恒。