1. 程式人生 > >Jira+confluence搭建文件

Jira+confluence搭建文件

整個安裝過程將涉及到的目錄:
系統選擇:Centos7

Atlassian各產品:
安裝目錄:/data/atlassian
資料目錄:/data/Atlassian/ApplicationData >>>>>選擇掛載一塊磁碟,方便以後的遷移擴容備份,最好是大點!

資料庫:
MySQL5.6 >>>>>考慮到有些版本是不支援5.7版本的資料庫
安裝目錄/usr/lib/mysql
資料目錄/var/lib/mysql

JAVA:
JAVA環境必須為32位(即使是在64位系統上),建議裝JDK,JDK的安裝的完整路徑必須沒有空格。JDK的版本在1.6.0-1.7.x之間。
JDK目錄:/usr/java/jdk1.8.0_60
JRE目錄:/usr/java/jdk1.8.0_60/jre

------------------------------------------------------------------------------------------------------------------------
Atlassian各產品目錄規劃:
Atlassian產品 安裝目錄 資料目錄
JIRA /data/atlassian/jira /data/atlassian/application-data/jira 
Confluence /data/atlassian/confluence /data/atlassian/application-data/confluence
Fisheye/Crucible /data/atlassian/fecru /data/atlassian/application-data/fecru


MySQL資料庫安裝
Atlassian官方目前支援MySQL 5.6、MySQL 5.7版本,本版本經過Atlassian各個產品的測試。最新版也支援MySQL 5.7了,要裝這個版本請看Centos 7上安裝及配置MySQL 5.7.20。

1、解除安裝系統自帶Mariadb
Centos7 已經不自帶MySQL,自帶內部集成了Mariadb,而安裝MySQL的話會和Mariadb的檔案衝突,所以需要先解除安裝掉Mariadb,再安裝MySQL。
[[email protected] ~]# rpm -qa | grep mariadb // 列出mariadb相關已安裝包mariadb-libs-5.5.40-1.el7_0.x86_64本例中找到的相關RPM包
[[email protected] ~]# rpm -e --nodeps mariadb-libs-5.5.40-1.el7_0.x86_64 // 解除安裝上面找到的所有相關RPM包,格式:rpm -e --nodeps [前面找到的RPM包名]
[

[email protected] ~]# rpm -qa | grep mariadb // 在解除安裝完以後再次用此命令來檢視
[[email protected] ~]# // 未查詢到,表明mariadb已經解除安裝成功!!

2、準備MySQL安裝包
MySQL-server-5.6.26-1.el7.x86_64.rpm 連結:http://pan.baidu.com/s/1kVKvcpT 密碼:swyc
MySQL-client-5.6.26-1.el7.x86_64.rpm 連結:http://pan.baidu.com/s/1i5jRwep 密碼:29cg
將這些包下載來傳到前面說的伺服器的/data/AtlassianResource中

3、開始安裝MySQL
先裝MySQL-server,再裝MySQL-client:
[[email protected] ~]# yum install -y perl-Module-Install.noarch
[[email protected] ~]# yum -y install perl
[[email protected] ~]# yum -y install libaio // CentOS7最小版本安裝MySQL找不到Perl的依賴包的解決辦法,或MySQL通過rpm包方式安裝時,不會執行mysql_install_db從而生成/root/.mysql_secret等,是缺少上面這3個依賴,所以我們先裝下(如果已有會提示你無需安裝),以免安裝過程出錯要解除安裝重灌更麻煩。
[[email protected] ~]# cd /data/AtlassianResource // 進入AtlassianResource目錄下
[[email protected] AtlassianResource]# rpm -ivh MySQL-server-5.6.26-1.el7.x86_64.rpm 
// 執行安裝MySQL-server,安裝過程有如下提示(若Centos最小化安裝,可能還需要依賴包:yum -y install libaio、yum -y install perl和yum -y install perl-Module-Install.noarch):
Preparing... ########################################### [100%]
1:MySQL-server ########################################### [100%]
warning: user mysql does not exist - using root
warning: group mysql does not exist - using root
2015-01-20 13:10:42 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2015-01-20 13:10:42 5645 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-01-20 13:10:42 5645 [Note] InnoDB: The InnoDB memory heap is disabled
2015-01-20 13:10:42 5645 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-01-20 13:10:42 5645 [Note] InnoDB: Memory barrier is not used
2015-01-20 13:10:42 5645 [Note] InnoDB: Compressed tables use zlib 1.2.3
2015-01-20 13:10:42 5645 [Note] InnoDB: Using Linux native AIO
2015-01-20 13:10:42 5645 [Note] InnoDB: Not using CPU crc32 instructions
2015-01-20 13:10:42 5645 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-01-20 13:10:42 5645 [Note] InnoDB: Completed initialization of buffer pool
2015-01-20 13:10:42 5645 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!
2015-01-20 13:10:42 5645 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB
2015-01-20 13:10:42 5645 [Note] InnoDB: Database physically writes the file full: wait...
2015-01-20 13:10:42 5645 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB
2015-01-20 13:10:42 5645 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB
2015-01-20 13:10:43 5645 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2015-01-20 13:10:43 5645 [Warning] InnoDB: New log files created, LSN=45781
2015-01-20 13:10:43 5645 [Note] InnoDB: Doublewrite buffer not found: creating new
2015-01-20 13:10:43 5645 [Note] InnoDB: Doublewrite buffer created
2015-01-20 13:10:43 5645 [Note] InnoDB: 128 rollback segment(s) are active.
2015-01-20 13:10:43 5645 [Warning] InnoDB: Creating foreign key constraint system tables.
2015-01-20 13:10:43 5645 [Note] InnoDB: Foreign key constraint system tables created
2015-01-20 13:10:43 5645 [Note] InnoDB: Creating tablespace and datafile system tables.
2015-01-20 13:10:43 5645 [Note] InnoDB: Tablespace and datafile system tables created.
2015-01-20 13:10:43 5645 [Note] InnoDB: Waiting for purge to start
2015-01-20 13:10:43 5645 [Note] InnoDB: 5.6.22 started; log sequence number 0
A random root password has been set. You will find it in '/root/.mysql_secret'.
2015-01-20 13:10:44 5645 [Note] Binlog end
2015-01-20 13:10:44 5645 [Note] InnoDB: FTS optimize thread exiting.
2015-01-20 13:10:44 5645 [Note] InnoDB: Starting shutdown...
2015-01-20 13:10:45 5645 [Note] InnoDB: Shutdown completed; log sequence number 1625977


2015-01-20 13:10:45 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2015-01-20 13:10:45 5667 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-01-20 13:10:45 5667 [Note] InnoDB: The InnoDB memory heap is disabled
2015-01-20 13:10:45 5667 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-01-20 13:10:45 5667 [Note] InnoDB: Memory barrier is not used
2015-01-20 13:10:45 5667 [Note] InnoDB: Compressed tables use zlib 1.2.3
2015-01-20 13:10:45 5667 [Note] InnoDB: Using Linux native AIO
2015-01-20 13:10:45 5667 [Note] InnoDB: Not using CPU crc32 instructions
2015-01-20 13:10:45 5667 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-01-20 13:10:45 5667 [Note] InnoDB: Completed initialization of buffer pool
2015-01-20 13:10:45 5667 [Note] InnoDB: Highest supported file format is Barracuda.
2015-01-20 13:10:45 5667 [Note] InnoDB: 128 rollback segment(s) are active.
2015-01-20 13:10:45 5667 [Note] InnoDB: Waiting for purge to start
2015-01-20 13:10:45 5667 [Note] InnoDB: 5.6.22 started; log sequence number 1625977
2015-01-20 13:10:45 5667 [Note] Binlog end
2015-01-20 13:10:45 5667 [Note] InnoDB: FTS optimize thread exiting.
2015-01-20 13:10:45 5667 [Note] InnoDB: Starting shutdown...
2015-01-20 13:10:47 5667 [Note] InnoDB: Shutdown completed; log sequence number 1625987




A RANDOM PASSWORD HAS BEEN SET FOR THE MySQL root USER !
You will find that password in '/root/.mysql_secret'. // 此句提示你預設mysql的root使用者隨機密碼存放於“/root/.mysql_secret”中

You must change that password on your first connect,
no other statement but 'SET PASSWORD' will be accepted.
See the manual for the semantics of the 'password expired' flag.

Also, the account for the anonymous user has been removed.

In addition, you can run:

/usr/bin/mysql_secure_installation

which will also give you the option of removing the test database.
This is strongly recommended for production servers.

See the manual for more instructions.

Please report any problems at http://bugs.mysql.com/

The latest information about MySQL is available on the web at

http://www.mysql.com

Support MySQL by buying support/licenses at http://shop.mysql.com

New default config file was created as /usr/my.cnf and // 此句提示你mysql的配置檔案位置“/usr/my.cnf”
will be used by default by the server when you start it.
You may edit this file to change server settings
[[email protected] AtlassianResource]# rpm -ivh MySQL-client-5.6.26-1.el7.x86_64.rpm // 執行安裝MySQL-client
Preparing... ########################################### [100%]
1:MySQL-client ########################################### [100%]
[[email protected] AtlassianResource]# // 安裝成功

MySQL啟動與關閉命令:
[[email protected] ~]# service mysql start // 啟動命令
[[email protected] ~]# service mysql stop // 停止命令

4、配置MySQL
MySQL安裝完畢後,我們還需要進行一些配置。這些配置是根據官方文件以及個人經驗整理出來的,如不做這些配置,可能造成中文字元亂碼、大檔案附件無法上傳、大外掛無法安裝等問題。

修改MySQL root使用者的預設密碼(不改的話,不能用root使用者建立新庫、查詢資料等)
[[email protected] ~]# service mysql start // 啟動MySQL
[[email protected] ~]# cat /root/.mysql_secret // 檢視MySQL root使用者的預設隨機密碼
# The random password set for the root user at Tue Jan 20 13:10:43 2015 (local time): F76Wy1A4G9ZuLcaG
[[email protected] ~]# mysqladmin -u root -pF76Wy1A4G9ZuLcaG password chumenzaiwai.2018 // 改密命令格式:mysqladmin -u 使用者名稱 -p原密碼 password 新密碼(注意-p後面不要有空格),本例將原密碼末尾字母G改成H。
Warning: Using a password on the command line interface can be insecure. // 看到此句表明密碼已經修改成功
[[email protected] ~]# mysql -u root -p // 用新密碼登入看看
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 16
Server version: 5.6.22 MySQL Community Server (GPL)
Copyright (c) 2000, 2014, 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> // 新密碼登入成功
mysql> exit // 退出MySQL
Bye
[[email protected] ~]#
[[email protected] ~]# rm -rf /root/.mysql_secret // 這個檔案可以刪除了,我們已經改密了,它已經沒有存在的價值了。(新密碼記得記錄儲存好噢噢噢!)

修改MySQL my.cnf配置檔案
[[email protected] ~]# service mysql stop // 先停止MySQL服務
[[email protected] ~]# vi /usr/my.cnf // 編輯my.cnf配置檔案,下文中標“[###]”的行為新增或修改過的配置
# For advice on how to change settings please see
http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
[mysql] // [###]
default-character-set=utf8 // [###]
[mysqld]
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
# These are commonly set, remove the # and set as required.
# basedir = .....
# datadir = .....
# port = .....
# server_id = .....
# socket = .....
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

transaction-isolation = READ-COMMITTED // [###]
max_allowed_packet=128M // [###]
innodb_log_file_size=512M // [###]
innodb_buffer_pool_size=512M // [###]
innodb_file_per_table=1 // [###]
collation-server=utf8_bin // [###]
character-set-server=utf8 // [###]
default-storage-engine=INNODB // [###]

performance_schema_max_table_instances=400 // [###] 此行和下面兩行配置,新增後,若MySQL無法啟動,則請刪除;若可正常啟動,則最好新增上。
table_definition_cache=400 // [###]
table_open_cache=256 // [###]
[[email protected] mysql]# cd /var/lib/mysql/ // 進入這個目錄,ls下我們可看到兩個檔案ib_logfile0和ib_logfile1
[[email protected] mysql]# rm -rf ib_logfile* // 刪除這兩個檔案
[[email protected] mysql]# service mysql start // 重新啟動MySQL服務,後面看配置是否生效
[[email protected] mysql]# mysql -u root -p // 登入MySQL
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 18848
Server version: 5.6.22 MySQL Community Server (GPL)
Copyright (c) 2000, 2014, 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> show VARIABLES like '%max_allowed_packet%'; // 檢視最大包限制大小
+--------------------------+------------+
| Variable_name | Value |
+--------------------------+------------+
| max_allowed_packet | 134217728 |
| slave_max_allowed_packet | 1073741824 |
+--------------------------+------------+
2 rows in set (0.00 sec)
mysql> SHOW VARIABLES LIKE 'character%'; // 檢視字符集變數
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
8 rows in set (0.00 sec)
mysql> // 看到上面這些配置,表示我們前面修改的配置已經生效了。

5、建立Atlassian各產品的資料庫
先在資料庫中建立Atlassian各產品的空庫
空庫將在Atlassian各產品安裝過程的初始化配置中用到(連線此空庫進行初始化建表等)。
mysql> CREATE DATABASE jiradb CHARACTER SET utf8 COLLATE utf8_bin; // 用此命令建立JIRA資料庫,其中“jiradb”為庫名
mysql> CREATE DATABASE confluencedb CHARACTER SET utf8 COLLATE utf8_bin; // 用此命令建立Confluence資料庫,其中“confluencedb”為庫名
mysql> CREATE DATABASE fecrudb CHARACTER SET utf8 COLLATE utf8_bin; // 用此命令建立Fisheye/Crucible資料庫,其中“fecrudb”為庫名
mysql> show databases;

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


安裝JIRA
[[email protected] ~]# df -h // 查詢當前系統磁碟分割槽情況
[[email protected] ~]# cd /data/AtlassianResource // 進入安裝資源目錄
[[email protected] AtlassianResource]# chmod a+x atlassian-jira-software-7.1.7-jira-7.1.7-x64.bin // 讓安裝包有可執行許可權
[[email protected] AtlassianResource]# ./atlassian-jira-software-7.1.7-jira-7.1.7-x64.bin // 執行安裝
Unpacking JRE ...
Starting Installer ...
May 31, 2016 11:53:47 PM java.util.prefs.FileSystemPreferences$1 run
INFO: Created user preferences directory.
May 31, 2016 11:53:47 PM java.util.prefs.FileSystemPreferences$2 run
INFO: Created system preferences directory in java.home.
This will install JIRA Software 7.1.7 on your computer.
OK [o, Enter], Cancel [c] // 詢問是否安裝? 安裝[輸入o,回車],取消[輸入c]
o // 當然輸入o安裝

Choose the appropriate installation or upgrade option.
Please choose one of the following: // 選擇一個安裝型別:快速安裝(使用預設配置)[1]、自定義安裝(建議使用此型別)
[2]、升級安裝(升級已存在的JIRA)[3]
Express Install (use default settings) [1], Custom Install (recommended for advanced users) [2, Enter], Upgrade an existing JIRA installation [3]
2 // 選2,自定義安裝
Where should JIRA Software be installed? // JIRA安裝在哪?
[/opt/atlassian/jira] // 預設的【安裝目錄】
/data/atlassian/jira // 改為“/data/atlassian/jira”

Default location for JIRA Software data // JIRA資料目錄
[/var/atlassian/application-data/jira] // 預設的【資料目錄】
/data/atlassian/application-data/jira // 改為“/data/atlassian/application-data/jira”

Configure which ports JIRA Software will use. // 配置哪個埠給JIRA使用
JIRA requires two TCP ports that are not being used by any other // JIRA需要兩個未被使用的TCP埠:HTTP埠和Control(控制)埠
applications on this machine. The HTTP port is where you will access JIRA // HTTP埠:用於瀏覽器訪問
through your browser. The Control port is used to startup and shutdown JIRA. // Control(控制)埠:用於啟動和停止JIRA
Use default ports (HTTP: 8080, Control: 8005) - Recommended [1, Enter], Set custom value for HTTP and Control ports [2] // 預設(HTTP: 8090, Control: 8000)[1, 回車],自定義[2]
2 // 這裡我們也選擇2,但是實際不去改它,只是閱覽下
HTTP Port Number
[8080]
Control Port Number
[8005]
JIRA can be run in the background.
You may choose to run JIRA as a service, which means it will start // JIRA安裝成系統服務後,可以後臺執行,可以用服務命令形式(service 服務名 start/stop)啟停,還可以隨計算機自啟動。
automatically whenever the computer restarts.
Install JIRA as Service? // 將JIRA安裝成系統服務?
Yes [y, Enter], No [n] // 是[y,回車],否[n]
y // y,回車
Details on where JIRA Software will be installed and the settings that will be used.
Installation Directory: /data/atlassian/jira
Home Directory: /data/atlassian/application-data/jira
HTTP Port: 8080
RMI Port: 8005
Install as service: Yes
Install [i, Enter], Exit [e] // 列出前面配置的資訊
i // i,確認安裝
Extracting files ...

Please wait a few moments while JIRA Software starts up.
Launching JIRA Software ...
Installation of JIRA Software 7.1.7 is complete
Your installation of JIRA Software 7.1.7 is now ready and can be accessed
via your browser.
JIRA Software 7.1.7 can be accessed at http://localhost:8080 // 訪問地址 http://[ip]:8080,如http://127.0.0.1:8080
Finishing installation ... // 安裝完畢
[[email protected] AtlassianResource]#


----------------------------------------------------------------------------------------------------------------------------------------------------------------

安裝Confluence
[[email protected] ~]# df -h // 查詢當前系統磁碟分割槽情況
[[email protected] ~]# cd /data/AtlassianResource // 進入安裝資源目錄
[[email protected] AtlassianResource]# chmod a+x atlassian-confluence-5.9.8-x64.bin // 讓安裝包有可執行許可權
[[email protected] AtlassianResource]# ./atlassian-confluence-5.9.8-x64.bin // 執行安裝
Unpacking JRE ...
Starting Installer ...
Apr 24, 2016 3:40:34 PM java.util.prefs.FileSystemPreferences$1 run
INFO: Created user preferences directory.
Apr 24, 2016 3:40:34 PM java.util.prefs.FileSystemPreferences$2 run
INFO: Created system preferences directory in java.home.
This will install Confluence 5.9.8 on your computer.
OK [o, Enter], Cancel [c] // 詢問是否安裝? 安裝[輸入o,回車],取消[輸入c]
o // 當然輸入o安裝
Choose the appropriate installation or upgrade option.
Please choose one of the following: // 選擇一個安裝型別:
Express Install (uses default settings) [1], // 快速安裝(使用預設配置)[1]
Custom Install (recommended for advanced users) [2, Enter], // 自定義安裝(建議使用此型別)[2]
Upgrade an existing Confluence installation [3] // 升級安裝(升級已存在的Confluence)[3]
2 // 選2,自定義安裝
Where should Confluence 5.9.8 be installed? // Confluence安裝在哪?
[/opt/atlassian/confluence] // 預設的【安裝目錄】
/data/atlassian/confluence // 改為“/data/atlassian/confluence”
Default location for Confluence data // Confluence資料目錄
[/var/atlassian/application-data/confluence] // 預設的【資料目錄】
/data/atlassian/application-data/confluence // 改為“/data/atlassian/application-data/confluence”
Configure which ports Confluence will use. // 配置哪個埠給Confluence使用
Confluence requires two TCP ports that are not being used by any other // Confluence需要兩個未被使用的TCP埠:HTTP埠和Control(控制)埠
applications on this machine. The HTTP port is where you will access // HTTP埠:用於瀏覽器訪問
Confluence through your browser. The Control port is used to Startup and // Control(控制)埠:用於啟動和停止Confluence
Shutdown Confluence.
Use default ports (HTTP: 8090, Control: 8000) - Recommended [1, Enter], Set custom value for HTTP and Control ports [2] // 預設(HTTP: 8090, Control: 8000)[1, 回車],自定義[2]
2 // 這裡我們也選擇2,但是實際不去改它,只是閱覽下
HTTP Port Number
[8090]
Control Port Number
[8000]
Confluence can be run in the background.
You may choose to run Confluence as a service, which means it will start // Confluence安裝成系統服務後,可以後臺執行,可以用服務命令形式(service 服務名 start/stop)啟停,還可以隨計算機自啟動。
automatically whenever the computer restarts.
Install Confluence as Service? // 將Confluence安裝成系統服務?
Yes [y, Enter], No [n] // 是[y,回車],否[n]
y // y,回車
Extracting files ...

Please wait a few moments while Confluence starts up.
Launching Confluence ...
Installation of Confluence 5.9.8 is complete
Your installation of Confluence 5.9.8 is now ready and can be accessed via
your browser.
Confluence 5.9.8 can be accessed at http://localhost:8090 // 訪問地址 http://[ip]:8090,如http://127.0.0.1:8090
Finishing installation ... // 安裝完畢
[[email protected] AtlassianResource]#


3、放置MySQL資料庫連線驅動(可選)
此步驟僅為使用MySQL資料庫時才需要,因為Confluence安裝包中不自帶MySQL連線驅動,而其他資料庫的連線驅動均自帶有。使用非MySQL資料庫的人請跳過此步驟。

下載MySQL資料庫連線驅動
檔名:mysql-connector-java-5.1.40-bin.jar

下載連結:https://pan.baidu.com/s/1cNAKRY3audvseyIik1vl8w 密碼:v026

上傳至伺服器“/data/AtlassianResource”中
放置檔案“mysql-connector-java-5.1.40-bin.jar”
[[email protected] ~]# service confluence stop // 先停止Confluence服務
[[email protected] ~]# cp -R /data/AtlassianResource/mysql-connector-java-5.1.34-bin.jar /data/atlassian/confluence/confluence/WEB-INF/lib // 複製檔案到Confluence【安裝目錄】中的WEB-INF/lib資料夾下
[[email protected] ~]# service confluence start