公司准备实行敏捷开发,经过一番工具选择,最终选定了jira和confluence,jira用作项目管理,confluence用于文档管理,下面说说这两个系统的搭建过程和集成设置。
官网下载地址 https://downloads.atlassian.com/software/jira/downloads/atlassian-jira-software-7.2.6.tar.gz
备用下载地址 http://peloo.net/download/jira/atlassian-jira-software-7.2.6.tar.gz
下载页面 http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
备用下载地址 http://peloo.net/download/jdk/jdk-8u112-linux-x64.tar.gz
官网下载地址 https://downloads.atlassian.com/software/confluence/downloads/atlassian-confluence-5.10.8.tar.gz
备用下载地址 http://peloo.net/download/jira/atlassian-confluence-5.10.8.tar.gz
下载地址 http://cdn.mysql.com//Downloads/MySQL-5.6/mysql-5.6.34.tar.gz
MySQL官网下载地址 http://120.52.72.23/cdn.mysql.com/c3pr90ntc0td//Downloads/Connector-J/mysql-connector-java-5.1.40.tar.gz
备用下载地址 http://peloo.net/download/db/mysql-connector-java-5.1.40.tar.gz
强烈建议独立物理机,本人的服务器ip地址分别为172.25.0.105和172.25.0.107,分别部署jira和confluence
两台服务器均配置相同的Java环境,并且jira和confluence要求的jdk版本都是1.8.x,这里以一台服务器的配置为例。
- 到上文提到的oracle官网链接下载jdk1.8.0_112版本到/tmp目录下,也可以用如下命令下载,速度稍慢
wget -c -P /tmp http://peloo.net/download/jdk/jdk-8u112-linux-x64.tar.gz
cd /tmp
tar zxvf jdk-8u112-linux-x64.tar.gz
\cp -av jdk-8u112-linux-x64/ /opt/
chown -R root.root /opt/jdk1.8.0_112
chmod -R 755 /opt/jdk1.8.0_112
JAVA_HOME=/opt/jdk1.8.0_112
JRE_HOME=$JAVA_HOME/jre
CLASSPATH=$JAVA_HOME/lib:$JRE_HOME/lib
PATH=$JAVA_HOME/bin:$JRE_HOME/bin:/usr/local/php56/bin:/usr/local/mysql/bin:$PATH
export JAVA_HOME JRE_HOME CLASSPATH PATH
source /etc/profile
注:两台服务器均安装MySQL服务器,公司DBA配置的MySQL可能参数过多,有些参数与jira、confluence的程序冲突,本人深受其苦,confluence用的是DBA配置的数据库,但是安装完confluence后,总是再创建文件的时候无限转圈,最后在172.25.0.107上单独部署MySQL才解决问题。
- 若系统已通过yum方式安装其他版本的MySQL,则用以下命令卸载
yum remove -y `rpm -qa | grep -i mysql`
yum install -y cmake gcc gcc-c++ gcc-g77 autoconf automake zlib* fiex* libxml* ncurses-devel libmcrypt* libtool-ltdl-devel* glibc
groupadd mysql
useradd -r -g mysql -s /bin/false mysql
mkdir -p /usr/local/mysql/data
wget -c -P /tmp http://cdn.mysql.com//Downloads/MySQL-5.6/mysql-5.6.34.tar.gz
cd /tmp
tar zxvf mysql-5.6.34.tar.gz
cd /tmp/mysql-5.6.34
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DMYSQL_UNIX_ADDR=/usr/local/mysql/data/mysql.sock \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DWITH_EXTRA_CHARSETS:STRING=utf8,gbk \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_MEMORY_STORAGE_ENGINE=1 \
-DWITH_READLINE=1 \
-DENABLED_LOCAL_INFILE=1 \
-DMYSQL_DATADIR=/usr/local/mysql/data \
-DMYSQL_USER=mysql \
-DMYSQL_TCP_PORT=3306
make
make install
chown -R root /usr/local/mysql
chown -R mysql /usr/local/mysql/data
sh scripts/mysql_install_db.sh –user=mysql –basedir=/usr/local/mysql
echo 'export PATH=/usr/local/mysql/bin:$PATH' >> /etc/profile
source /etc/profile
\cp /tmp/mysql-5.6.34/support-files/my-default.cnf /etc/my.cnf
# Example MySQL config file for medium systems.
#
# This is for a system with little memory (32M – 64M) where MySQL plays
# an important part, or systems up to 128M where MySQL is used together with
# other programs (such as a web server)
#
# MySQL programs look for option files in a set of
# locations which depend on the deployment platform.
# You can copy this option file to one of those
# locations. For information about these locations, see:
# http://dev.mysql.com/doc/mysql/en/option-files.html
#
# In this file, you can use all long options that a program supports.
# If you want to know which options a program supports, run the program
# with the "–help" option.
# The following options will be passed to all MySQL clients
[client]
#password = your_password
port = 3306
socket = /usr/local/mysql/data/mysql.sock
default-character-set=utf8
# Here follows entries for some specific programs
# The MySQL server
[mysqld]
datadir=/usr/local/mysql/data
basedir=/usr/local/mysql
port = 3306
socket = /usr/local/mysql/data/mysql.sock
skip-external-locking
key_buffer_size = 16M
max_allowed_packet = 256M
table_open_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
default_storage_engine=InnoDB
# Don't listen on a TCP/IP port at all. This can be a security enhancement,
# if all processes that need to connect to mysqld run on the same host.
# All interaction with mysqld must be made via Unix sockets or named pipes.
# Note that using this option without enabling named pipes on Windows
# (via the "enable-named-pipe" option) will render mysqld useless!
#
#skip-networking
# Replication Master Server (default)
# binary logging is required for replication
log-bin=mysql-bin
# binary logging format – mixed recommended
binlog_format=mixed
# required unique id between 1 and 2^32 – 1
# defaults to 1 if master-host is not set
# but will not function as a master if omitted
server-id = 1
# Replication Slave (comment out master section to use this)
#
# To configure this host as a replication slave, you can choose between
# two methods :
#
# 1) Use the CHANGE MASTER TO command (fully described in our manual) –
# the syntax is:
#
# CHANGE MASTER TO MASTER_HOST=, MASTER_PORT=,
# MASTER_USER=, MASTER_PASSWORD= ;
#
# where you replace , , by quoted strings and
# by the master's port number (3306 by default).
#
# Example:
#
# CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306,
# MASTER_USER='joe', MASTER_PASSWORD='secret';
#
# OR
#
# 2) Set the variables below. However, in case you choose this method, then
# start replication for the first time (even unsuccessfully, for example
# if you mistyped the password in master-password and the slave fails to
# connect), the slave will create a master.info file, and any later
# change in this file to the variables' values below will be ignored and
# overridden by the content of the master.info file, unless you shutdown
# the slave server, delete master.info and restart the slaver server.
# For that reason, you may want to leave the lines below untouched
# (commented) and instead use CHANGE MASTER TO (see above)
#
# required unique id between 2 and 2^32 – 1
# (and different from the master)
# defaults to 2 if master-host is set
# but will not function as a slave if omitted
#server-id = 2
#
# The replication master for this slave – required
#master-host =
#
# The username the slave will use for authentication when connecting
# to the master – required
#master-user =
#
# The password the slave will authenticate with when connecting to
# the master – required
#master-password =
#
# The port the master is listening on.
# optional – defaults to 3306
#master-port =
#
# binary logging – not required for slaves, but recommended
log-bin=mysql-bin
# Uncomment the following if you are using InnoDB tables
#innodb_data_home_dir = /usr/local/mysql/data
#innodb_data_file_path = ibdata1:10M:autoextend
#innodb_log_group_home_dir = /usr/local/mysql/data
# You can set .._buffer_pool_size up to 50 – 80 %
# of RAM but beware of setting memory usage too high
#innodb_buffer_pool_size = 1224M
#innodb_additional_mem_pool_size = 2M
# Set .._log_file_size to 25 % of buffer pool size
#innodb_log_file_size = 56M
#innodb_log_buffer_size = 8M
#innodb_flush_log_at_trx_commit = 1
#innodb_lock_wait_timeout = 50
innodb_file_per_table = ON
[mysqldump]
quick
max_allowed_packet = 16M
[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates
[myisamchk]
key_buffer_size = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
interactive-timeout
\cp /tmp/mysql-5.6.34/support-files/mysql.server /etc/init.d/mysqld
chmod +x /etc/init.d/mysqld
service mysqld start
mysql>create database jira;
mysql>alter database jira default character set utf8 collate utf8_bin;
mysql>create database confluence;
mysql>alter database confluence default character set utf8 collate utf8_bin;
mysql> SET GLOBAL max_allowed_packet=536870912;
mysql> SET GLOBAL innodb_log_file_size=2147483648;
[mysqld]
……
……
# of RAM but beware of setting memory usage too high
#innodb_buffer_pool_size = 1224M
#innodb_additional_mem_pool_size = 2M
# Set .._log_file_size to 25 % of buffer pool size
innodb_log_file_size = 2G
#innodb_log_buffer_size = 8M
#innodb_flush_log_at_trx_commit = 1
#innodb_lock_wait_timeout = 50
innodb_file_per_table = ON
[mysqldump]
quick
max_allowed_packet = 512M
mysql>CREATE USER 'jira'@'localhost' IDENTIFIED BY ‘123456’;
mysql>UPDATE mysql.user SET PASSWORD=PASSWORD('123456') WHERE User='jira';
mysql>GRANT ALL PRIVILEGES ON jira.* TO jira@'localhost';
mysql>CREATE USER 'confluence'@'localhost' IDENTIFIED BY ‘123456’;
mysql>UPDATE mysql SET PASSWORD=PASSWORD('123456') WHERE User='confluence';
mysql>GRANT ALL PRIVILEGES ON confluence.* TO confluence@'localhost';
mysql>FLUSH PRIVILEGES;
MySQL启动报错failed to update pid file,本人遇到此种情况,最有效的解决方法:
删除mysql主目录下的data目录所有文件和文件夹,重新运行初始化脚本mysql_install_db.sh
其他问题可能的原因有多种,具体什么原因最好的办法是先查看下错误日志,常见FAQ如下,
service iptables stop
wget -c -P /tmp https://downloads.atlassian.com/software/jira/downloads/atlassian-jira-software-7.2.6.tar.gz
cd /tmp
tar zxvf atlassian-jira-software-7.2.6.tar.gz
cp -rv atlassian-jira-software-7.2.6-standalone/ /opt/
ln -sv /opt/atlassian-jira-software-7.2.6-standalone /opt/jira
/usr/sbin/useradd –create-home –comment "Account for running JIRA Software" –shell /bin/bash jira
echo "123456" | passwd –stdin jira
chown -R jira.jira /opt/jira/
chmod -R 700 /opt/jira/
mkdir /home/jira/jirasoftware-home
chown -R jira.jira /home/jira/jirasoftware-home
chmod -R 700 /home/jira/jirasoftware-home
jira.home=/home/jira/jirasoftware-home
echo 'JIRA_HOME=/home/jira/jirasoftware-home' >> /etc/profile
echo 'export JIRA_HOME' >> /etc/profile
source /etc/profile
<Server port="5005" shutdown="SHUTDOWN">
…
<Service name="Catalina">
<Connector port="5050"
maxThreads="150"
minSpareThreads="25"
connectionTimeout="20000"
enableLookups="false"
maxHttpHeaderSize="8192"
protocol="HTTP/1.1"
useBodyEncodingForURI="true"
redirectPort="8443"
acceptCount="100"
disableUploadTimeout="true"/>
wget -c -P /tmp http://120.52.72.23/cdn.mysql.com/c3pr90ntc0td//Downloads/Connector-J/mysql-connector-java-5.1.40.tar.gz
cd /tmp
tar zxvf mysql-connector-java-5.1.40.tar.gz
cd mysql-connector-java-5.1.40
\cp mysql-connector-java-5.1.40-bin.jar /opt/jira/lib/
su jira
cd /opt/jira/bin/
./start-jira.sh
service iptables stop
wget -c -P /tmp https://downloads.atlassian.com/software/confluence/downloads/atlassian-confluence-5.10.8.tar.gz
cd /tmp
tar zxvf atlassian-confluence-5.10.8.tar.gz
cp -rv atlassian-confluence-5.10.8/ /opt/
ln -sv /opt/atlassian-confluence-5.10.8 /opt/confluence
- 创建confluence用户并设置密码为”123456“
/usr/sbin/useradd –create-home –comment "Account for running confluence" –shell /bin/bash confluence
echo "123456" | passwd –stdin confluence
chown -R confluence.confluence /opt/confluence/
chmod -R 700 /opt/confluence/
mkdir /home/jconfluence/confluence-home
chown -R confluence.confluence /home/confluence/confluence-home
chmod -R 700 /home/confluence/confluence-home
jira.home=/home/confluence//confluence-home
Server port="5000" shutdown="SHUTDOWN" debug="0">
"Tomcat-Standalone">
"5050" connectionTimeout="20000" redirectPort="8443"
maxThreads="48" minSpareThreads="10"
enableLookups="false" acceptCount="10" debug="0" URIEncoding="UTF-8"
protocol="org.apache.coyote.http11.Http11NioProtocol" />
wget -c -P /tmp http://120.52.72.23/cdn.mysql.com/c3pr90ntc0td//Downloads/Connector-J/mysql-connector-java-5.1.40.tar.gz
cd /tmp
tar zxvf mysql-connector-java-5.1.40.tar.gz
cd mysql-connector-java-5.1.40
\cp mysql-connector-java-5.1.40-bin.jar /opt/confluence/confluence/WEB-INF/lib/
- 切换到confluence用户并启动jira工程
su confluence
cd /opt/confluence/bin/
./start-confluence.sh
“`