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。
[root@langer ~]# rpm -qa | grep mariadb // 列出mariadb相关已安装包mariadb-libs-5.5.40-1.el7_0.x86_64本例中找到的相关RPM包
[root@langer ~]# rpm -e --nodeps mariadb-libs-5.5.40-1.el7_0.x86_64 // 卸载上面找到的所有相关RPM包,格式:rpm -e --nodeps [前面找到的RPM包名]
[root@langer ~]# rpm -qa | grep mariadb // 在卸载完以后再次用此命令来查看
[root@langer ~]# // 未查找到,表明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:
[root@langer ~]# yum install -y perl-Module-Install.noarch
[root@langer ~]# yum -y install perl
[root@langer ~]# yum -y install libaio // CentOS7最小版本安装MySQL找不到Perl的依赖包的解决办法,或MySQL通过rpm包方式安装时,不会执行mysql_install_db从而生成/root/.mysql_secret等,是缺少上面这3个依赖,所以我们先装下(如果已有会提示你无需安装),以免安装过程出错要卸载重装更麻烦。
[root@langer ~]# cd /data/AtlassianResource // 进入AtlassianResource目录下
[root@langer 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
[root@langer AtlassianResource]# rpm -ivh MySQL-client-5.6.26-1.el7.x86_64.rpm // 执行安装MySQL-client
Preparing... ########################################### [100%]
1:MySQL-client ########################################### [100%]
[root@langer AtlassianResource]# // 安装成功

MySQL启动与关闭命令:
[root@langer ~]# service mysql start // 启动命令
[root@langer ~]# service mysql stop // 停止命令

4、配置MySQL
MySQL安装完毕后,我们还需要进行一些配置。这些配置是根据官方文档以及个人经验整理出来的,如不做这些配置,可能造成中文字符乱码、大文件附件无法上传、大插件无法安装等问题。

修改MySQL root用户的默认密码(不改的话,不能用root用户创建新库、查询数据等)
[root@langer ~]# service mysql start // 启动MySQL
[root@langer ~]# 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
[root@langer ~]# 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. // 看到此句表明密码已经修改成功
[root@langer ~]# 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
[root@langer ~]#
[root@langer ~]# rm -rf /root/.mysql_secret // 这个文件可以删除了,我们已经改密了,它已经没有存在的价值了。(新密码记得记录保存好噢噢噢!)

修改MySQL my.cnf配置文件
[root@langer ~]# service mysql stop // 先停止MySQL服务
[root@langer ~]# 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 // [###]
[root@langer mysql]# cd /var/lib/mysql/ // 进入这个目录,ls下我们可看到两个文件ib_logfile0和ib_logfile1
[root@langer mysql]# rm -rf ib_logfile* // 删除这两个文件
[root@langer mysql]# service mysql start // 重新启动MySQL服务,后面看配置是否生效
[root@langer 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
[root@langer ~]# df -h // 查询当前系统磁盘分区情况
[root@langer ~]# cd /data/AtlassianResource // 进入安装资源目录
[root@langer AtlassianResource]# chmod a+x atlassian-jira-software-7.1.7-jira-7.1.7-x64.bin // 让安装包有可执行权限
[root@langer 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 ... // 安装完毕
[root@langer AtlassianResource]#


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

安装Confluence
[root@langer ~]# df -h // 查询当前系统磁盘分区情况
[root@langer ~]# cd /data/AtlassianResource // 进入安装资源目录
[root@langer AtlassianResource]# chmod a+x atlassian-confluence-5.9.8-x64.bin // 让安装包有可执行权限
[root@langer 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 ... // 安装完毕
[root@langer 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”
[root@langer ~]# service confluence stop // 先停止Confluence服务
[root@langer ~]# cp -R /data/AtlassianResource/mysql-connector-java-5.1.34-bin.jar /data/atlassian/confluence/confluence/WEB-INF/lib // 复制文件到Confluence【安装目录】中的WEB-INF/lib文件夹下
[root@langer ~]# service confluence start

你可能感兴趣的:(运维,jira,confluence)