一、背景
JIRA是Atlassian公司出品的项目与事务跟踪工具,被广泛应用于缺陷跟踪、客户服务、需求收集、流程审批、任务跟踪、项目跟踪和敏捷管理等工作领域。常用于项目跟踪管理工作中,帮助项目团队创建跟踪问题、构建并发布优秀的产品,迭代发布。使用JIRA可以捕获、组织管理缺陷、分配任务,跟踪团队的活动。
官网:也可参考http://www.unlimax.com/jira-software/
我们也可以在线注册JIRA:
官方KB:https://confluence.atlassian.com/jirakb
二、软件安装
2.1、安装前环境准备
JDK8.0下载:https://www.oracle.com/cn/java/technologies/javase/javase-jdk8-downloads.html //jira的运行是依赖java环境
安装jdk:#rpm -ivh jdk-8u301-linux-x64.rpm,或者
#yum provides java
#yum -y install 1:java-1.8.0-openjdk-1.8.0.242.b08-0.el7_7.x86_64
#java -version #查看是否安装成功
配置jdk,vi /etc/profile,增加以下内容:
export JAVA_HOME=/usr/java/jdk1.8.0_301
export JAVA_BIN=/usr/java/jdk1.8.0_301/bin
export PATH=$PATH:$JAVA_HOME/bin
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export JAVA_HOME JAVA_BIN PATH CLASSPATH
完成后,source /etc/profile
2.2、安装mariadb数据库
# groupadd -g 306 mysql
# useradd -g mysql -u 306 -r mysql
# mkdir -pv /mydata/data
# chown -R mysql.mysql /mydata/data
#yum -y install mariadb-server mariadb
# systemctl start mariadb #开启数据库
# systemctl enable mariadb #设置开机自启
# mysql_secure_installation #初始化数据库
2.3、或者安装mysql80
- Yum安装
采用yum源安装,源下载;
wget https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
(MD5: 893b55d5d885df5c4d4cf7c4f2f6c153)
下载完成后,安装源:# mysql80-community-release-el7-3.noarch.rpm
#yum repolist all | grep mysql //查看mysql开启和启用版本
#yum install mysql-community-server
#service mysqld start
#service mysqld status
#mysql_secure_installation //配置数据库并设置密码
2)压缩包:
软件包下载:https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.26-el7-x86_64.tar.gz(MD5: ad605821afb685ab4bb3b3c4c66b3d86)
RPM报:https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-8.0.26-1.el7.x86_64.rpm-bundle.tar(MD5: 74aa082018675f04d2d0552bcf5c18c9)
tar -zxf mysql-8.0.26-el7-x86_64.tar.gz -C /usr/local/
ln -sv mysql-8.0.26-el7-x86_64/ mysql
chown -R root:mysql ./mysql
./scripts/mysql_install_db –user=mysql –datadir=/mydata/data //初始化mysql
cp support-files/mysql.server /etc/rc.d/init.d/mysqld //创建启动脚本
chmod +x /etc/rc.d/init.d/mysqld
cp support-files/my-large.cnf /etc/my.cnf //创建mysql配置文件
vim /etc/my.cnf //修改mysql数据文件目录为:datadir = /mydata/data
vim /etc/profile.d/mysql.sh //添加export PATH=/usr/local/mysql/bin:$PATH
service mysqld start
2.4、配置jira数据库
mysql> CREATE DATABASE jira DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; /*字符集为UTF-8*/
mysql> create user jirauser identified by '123456';
mysql> grant all on jiradb.* to jira@"%" identified by "123456";
mysql> grant all on jiradb.* to jira@"localhost" identified by "123456";
mysql> grant all privileges on jira.* to jira@'192.168.20' identified by '123456;
mysql> flush privileges;
配置Confluence:
mysql> create database confluencedb character set utf8 collate utf8_bin;
mysql> grant all on confluencedb.* to confluence@"%" identified by "123456
mysql> grant all on confluencedb.* to confluence@"localhost" identified by "123456";
mysql> flush privileges;
注:JIRA默认使用的数据库是HSql,如果要迁移到MySQL,需要对xml配置文件修改:
修改server.xml (路径:/jira/conf/server.xml)
username=”jira”
password=”123456“
driverClassName=”com.mysql.jdbc.Driver”
url=”jdbc:mysql://localhost:3306/jiradb?autoReconnect=true&useUnicode=true&characterEncoding=UTF8″
(删除minEvictableIdleTimeMillis and timeBetweenEvictionRunsMillis项 )
maxActive=”20″
validationQuery=”select 1″/>
修改entityengine.xml (路径:/jira/atlassian-jira/WEB-INF/classes/entityengine.xml):
<datasource name=”defaultDS” field-type-name=”mysql”
删除schema-name=”PUBLIC”
连接数据库的配置是/var/atlassian/application-data/jira/dbconfig.xml,如下:
2.5、配置JIRA服务器
软件下载:wget https://product-downloads.atlassian.com/software/jira/downloads/atlassian-jira-software-8.18.2-x64.bin
安装文档:https://confluence.atlassian.com/adminjiraserver071/installing-jira-applications-802592161.html
./atlassian-jira-software-7.1.4-jira-7.1.4-x64.bin //JIRA安装,安装完成后会自动启动,并提示可以从浏览器访问:http://localhost:8080,默认就是8080端口,JIRA是集成在Tomcat上面的,所以修改端口的方法和Tomcat修改端口的方法是一样的。
jira的主要配置文件,存放在./atlassian/jira/conf/server.xml文件中,比如修改端口:
如果数据库采用mysql,需门安装mysql模块,因JIRA原生不支持mysql:
将/jira/mysql-connector-java-5.1.38-bin.jar添加到./atlassian/jira/lib下。 //mysql-connector-java-8.0.26-1.el7.noarch.rpm
mysql-connector-java-8.0.25-bin.jar
解压后再zip包里就能找到mysql连接java的连接器jar包了。
/atlassian/jira/bin/stop-jira.sh
/atlassian/jira/bin/start-jira.sh
浏览器访问:ip:8080,会在页面看到提示,安装完成,接着需要手动配置JIRA实例:
完成后,刷新页面或者清缓存刷新页面:
至此JIRA的安装部署就完成了。
注:破解:atlassian-extras-3.1.2.jar添加到/opt/atlassian/jira/atlassian-jira/WEB-INF/lib
汉化:jira-language-pack-zh_CN-2969625925248334350.jar添加到/opt/atlassian/jira/atlassian-jira/WEB-INF/lib,重启jiar使之生效。
语言包下载:https://packages.atlassian.com/ui/native/maven-internal/com/atlassian/translations/
wget https://packages.atlassian.com/native/maven-internal/com/atlassian/translations/jira-software-language-pack-zh_CN/8.15.0.v202103310031350/jira-software-language-pack-zh_CN-8.15.0.v202103310031350.jar
附录:其他配置
1)修改内存:
./atlassian/jira/bin/setenv.sh
2)日志:tail -f ./atlassian/jira/logs/catalina.out