缺陷管理工具Jira安装参考
1安装简介
1.1方案/流程简介
需要依赖安装数据库,可以是mysql,orace或sqlserver。以mysql为例说明。
各模块各阶段安装任务说明如下:
安装模块 |
说明 |
jira |
项目与事务跟踪工具,被广泛应用于缺陷跟踪、客户服务、需求收集、流程审批、任务跟踪、项目跟踪和敏捷管理等工作领域。 |
mysql |
开源的关系型数据库 |
mysql的JDBC驱动 |
Java 连接 MySQL 需要驱动包。解压后得到jar库文件,然后在对应的项目中导入该库文件。 |
参考指导:
http://blog.51cto.com/13505030/2059613
2安装前准备
2.1 系统环境
OS版本号: CentOS Linux release 7.3.1611 (Core)
命令: cat /etc/redhat-release
2.2 软件包&工具
安装所需的软件包如下:
软件包 |
软件包版本 |
获取方式 |
jira |
atlassian-jira-software-7.3.6.zip |
https://www.atlassian.com/software/jira/download |
mysql |
5.7 |
https://dev.mysql.com/downloads/mysql/ |
mysql的JDBC驱动 |
mysql-connector-java-5.1.34_1 |
https://dev.mysql.com/downloads/connector/j/ |
JDK |
1.8 |
- |
3 安装与配置(单机)
3.1安装JDK
1. 检查默认安装情况
java -version
系统默认带的是openJDK,需要卸载后安装。
2.检测JDK安装包
rpm -qa | grep java
avapackages-tools-3.4.1-6.el7_0.noarch
tzdata-java-2014i-1.el7.noarch
java-1.7.0-openjdk-headless-1.7.0.71-2.5.3.1.el7_0.x86_64
java-1.7.0-openjdk-1.7.0.71-2.5.3.1.el7_0.x86_64
python-javapackages-3.4.1-6.el7_0.noarch
3.卸载OpenJDK
rpm -e --nodeps tzdata-java-2014i-1.el7.noarch
rpm -e --nodeps java-1.7.0-openjdk-headless-1.7.0.71-2.5.3.1.el7_0.x86_64
rpm -e --nodeps java-1.7.0-openjdk-1.7.0.71-2.5.3.1.el7_0.x86_64
4.安装新的Jdk1.8.0_31
解压缩tar.gz
mkdir -p /usr/lib/jvm
tar -zxvf jdk1.8.0_31.tar.gz -C /usr/lib/jvm
5.设置环境变量
vi /etc/profile
在文件最后添加:
export JAVA_HOME=/usr/lib/jvm/jdk1.8.0_31
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH
如果只是临时的可以在终端配置,不用到配置文件中配置,如果只想某用户可以用,可以只配置那个用户的profile文件;
6.使profile生效
source /etc/profile
7.检查新安装的jdk
java -version
3.2安装Jira
3.2.1 下载安装包
注:如果已经获取到安装包,可以直接跳过此步骤
3.2.2上传安装包
1)root用户创建 文件夹:
mkdir -p
2)将安装包atlassian-jira-software-7.3.6.zip以root用户上传到目标目录
3.2.3解压安装包
unzip
atlassian-jira-software-7.3.6.zip
[root@host03 jira]# ls
atlassian-jira-software-7.3.6-standalone atlassian-jira-software-7.3.6.zip
[root@host03 jira]# mv atlassian-jira-software-7.3.6-standalone/ jira
[root@host03 jira]# ls
atlassian-jira-software-7.3.6.zip jira
3.3安装数据库(Mysql)
3.3.1下载安装包
https://dev.mysql/com/downloads/mysql
注:此包是汇总包,下载此包即可
3.3.2上传安装包
1)root用户创建 /usr/local/services/mysql文件夹,并上传文件
mkdir -p
/usr/local/services/mysql
2) 解压
tar
-zxvf sql-5.7.19-1.el7.x86_64.rpm-bundle.tar
3.3.3 安装Mysql
1、检查环境是否默认安装了mysql
如上图,默认已经安装了,需要先删除
卸载系统自带的mariadb-lib
否则会报如下错误,导致common安装失败。
2、 执行安装
安装顺序:
mysql-community-common-5.7.19-1.el7.x86_64.rpm
mysql-community-libs-5.7.19-1.el7.x86_64.rpm
--(依赖于common)
mysql-community-client-5.7.19-1.el7.x86_64.rpm
--(依赖于libs)
mysql-community-server-5.7.19-1.el7.x86_64.rpm
--(依赖于client、common)
3.3.4初始化数据库
mysqld
--initialize
//新版的推荐此方法,执行生会在/var/log/mysqld.log生成随机密码
安装完成后,会默认安装在/var/lib/mysql下。 如果需要改安装路径,可以mysql_install_db --datadir=/var/lib/mysql
3.3.5更改所属用户及其所属组
增加mysql用户并修改默认密码
groupadd
mysql
useradd -r -g mysql mysql
passwd
mysql
增加如下目录并赋权限:
chown
mysql:mysql /var/lib/mysql –R
3.3.6启动mysql
systemctl start mysqld.service
检查状态:
ps
-ef |grep mysql
3.3.7初始化登录密码
新安装的数据库,需要配置初始登录密码:
/etc/my.cnf里[mysqld]下添加skip-grant-tables=1,跳过权限,重启服务
update mysql.user set authentication_string
= password('我是密码,请替换'), password_expired = 'N', password_last_changed = now()
where user = 'root';
flush
privileges;
再去my.cnf里把刚才添加的skip-grant-tables注释掉,重启服务
mysql -u root -p
再次进入 输入刚才设置的密码
查看启动端口
mysql> show global variables like
'port';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| port | 3306 |
+---------------+-------+
1 row in set (0.01 sec)
mysql>
3.3.8(可选)个性化配置
修改mysql数据库,使支持表的大小写
让MYSQL不区分表名大小写的方法其实很简单:
1.用ROOT登录,修改/etc/my.cnf
2.在[mysqld]下加入一行:lower_case_table_names=1
3.重新启动数据库即可
先kill掉进程,然后执行:systemctl
start mysqld.service
3.3 Docker下安装数据库(可选)
3.3.1安装Docker
3.3.1.1 安装docker
可以连外网情况下,直接一个命令可以安装: yum install docker
[root@localhost dev]# yum install docker
下载确认后出现完毕显示,则安装完毕。
3.3.1.2 查看docker版本
查看命令:docker -v
[root@localhost dev]# docker -v
Docker version 1.13.1, build 6e3bb8e/1.13.1
3.3.1.3 启动docker
启动命令:systemctl start docker
[root@localhost dev]# systemctl status docker
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
Active: inactive (dead)
Docs: http://docs.docker.com
[root@localhost dev]# systemctl start docker
[root@localhost dev]# systemctl status docker
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
Active: active (running) since 日 2018-09-16 17:21:09 CST; 5s ago
Docs: http://docs.docker.com
Main PID: 3545 (dockerd-current)
CGroup: /system.slice/docker.service
├─3545 /usr/bin/dockerd-current --add-runtime docker-runc=/usr/libexec/docker/docker-runc-current --default-runtime=docker-runc --exec-opt native.cgroupdriver=systemd --userlan...
└─3561 /usr/bin/docker-containerd-current -l unix:///var/run/docker/libcontainerd/docker-containerd.sock --metrics-interval=0 --start-timeout 2m --state-dir /var/run/docker/lib...
3.3.1.4 配置开机启动(可选)
[root@localhost dev]# systemctl enable docker
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.
3.3.2 Docker上安装mysql
3.3.2.1拉取镜像
命令:docker pull mysql:5.6.39
说明:后面的版本号视具体情况而定(如果获取最新版本,则不需要加版本号)
[root@localhost /]# docker pull mysql:5.7
Trying to pull repository docker.io/library/mysql ...
Get https://registry-1.docker.io/v2/library/mysql/manifests/5.7: Get https://auth.docker.io/token?scope=repository%3Alibrary%2Fmysql%3Apull&service=registry.docker.io: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
[root@localhost /]# docker pull mysql:5.6.39
Trying to pull repository docker.io/library/mysql ...
5.6.39: Pulling from docker.io/library/mysql
2a72cbf407d6: Pull complete
38680a9b47a8: Pull complete
4c732aa0eb1b: Pull complete
c5317a34eddd: Pull complete
f92be680366c: Pull complete
6762c4c3eacc: Pull complete
7f9e7799488e: Pull complete
5bfede7d51ce: Pull complete
4d58e230ee6f: Pull complete
e83cf84d215b: Pull complete
9a02cf99f495: Pull complete
Digest: sha256:a85722079680fb21afc4ce5c7a2cb51fa6d9793efe1c6d3da0e94a2aa9fedac4
Status: Downloaded newer image for docker.io/mysql:5.6.39
3.3.2.2加载镜像
命令:
docker run --name mysql_docker -e MYSQL_ROOT_PASSWORD=我是密码,请替换 -p 3307:3306 -d mysql:5.6.39
命令说明:
--name mysql_docker 创建的容器名称
-e MYSQL_ROOT_PASSWORD=root 使用作为root账号的密码
-p 3307:3306 容器的3307端口映射到宿主机器
-d 后台运行容器
mysql:5.6.39 镜像名称
[root@localhost /]# docker run --name mysql_docker -e MYSQL_ROOT_PASSWORD=我是密码,请替换 -p 3307:3306 -d mysql:5.6.39
84eff7a2ee2d813bd92503349a06bb6377bad29ab6541876d04f7ee547b48f79
[root@localhost /]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
84eff7a2ee2d mysql:5.6.39 "docker-entrypoint..." 17 seconds ago Up 16 seconds 0.0.0.0:3307->3306/tcp mysql_docker
[root@localhost /]#
3.3.2.3验证安装
查看端口:
[root@localhost /]# netstat -anp |grep 3307
tcp6 0 0 :::3307 :::* LISTEN 9866/docker-proxy-c
进入mysql:docker exec -it mysql_docker bash
[root@localhost /]# docker exec -it mysql_docker bash
root@84eff7a2ee2d:/# mysql -u root -p"我是密码,请替换"
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.39 MySQL Community Server (GPL)
Copyright (c) 2000, 2018, 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>
3.3创建数据库用户
[root@host03 bin]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 6
Server version: 5.7.18-log Source distribution
Copyright (c) 2000, 2017, 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.
Docker 下进入数据库(可选):
root@2221eee4b6e7:/# mysql -u root -p"我是密码,请替换"
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.24 MySQL Community Server (GPL)
Copyright (c) 2000, 2018, 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>
3.3.1创建数据库
mysql> create database jira default character set utf8 collate utf8_bin;
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| jira |
| mysql |
| performance_schema |
| sys |
+--------------------+
5 rows in set (0.00 sec)
mysql> exit
3.3.2 赋合适权限
mysql> use jira;
Database changed
mysql> grant all on jira.* to 'jira@’%' identified by '我是密码,请替换';
Query OK, 0 rows affected, 1 warning (0.01 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)
4导入mysql的JDBC驱动
上传mysql-connector-java-**-bin.jar包到安装目录下,如
/jira/atlassian-jira/WEB-INF/lib
5启动Jira
5.1 个性化配置
1) 配置启动目录
vi /jira/atlassian-jira/WEB-INF/classes/jira-application.properties
jira.home = /data
[root@host03 jira]# pwd
[root@host03 jira]# mkdir data
2) 配置连接数据库信息(可选):
vi /jira/atlassian-jira/WEB-INF/classes/database-defaults/mysql.properties
databaseUrl=jdbc:mysql://localhost:3307/jira?autoReconnect=true&characterEncoding=utf8&useUnicode=true&sessionVariables=default_storage_engine=InnoDB
userName=jira
password=我是密码,请替换
poolSize= 20
3) 配置个性化端口(可选):
vi /jira/conf/server.xml
<Service name="Catalina">
<Connector port="8080"
5.2 启动Jira
[root@host03 jira]# cd /jira/bin
[root@host03 bin]# ./start-jira.sh
To run JIRA in the foreground, start the server with start-jira.sh -fg
executing as current user
.....
.... .NMMMD. ...
.8MMM. $MMN,..~MMMO.
.?MMM. .MMM?.
OMMMMZ. .,NMMMN~
.IMMMMMM. .NMMMN. .MMMMMN,
,MMMMMM$..3MD..ZMMMMMM.
=NMMMMMM,. .,MMMMMMD.
.MMMMMMMM8MMMMMMM,
.ONMMMMMMMMMMZ.
,NMMMMMMM8.
.:,.$MMMMMMM
.IMMMM..NMMMMMD.
.8MMMMM: :NMMMMN.
.MMMMMM. .MMMMM~.
.MMMMMN .MMMMM?.
Atlassian JIRA
Version : 7.3.6
If you encounter issues starting or stopping JIRA, please see the Troubleshooting guide at http://confluence.atlassian.com/display/JIRA/Installation+Troubleshooting+Guide
Server startup logs are located in /jira/logs/catalina.out
Using CATALINA_BASE: /jira
Using CATALINA_HOME: /jira
Using CATALINA_TMPDIR: /jira/temp
Using JRE_HOME: /usr/local/java/jre
Using CLASSPATH: /jira/bin/bootstrap.jar:/jira/bin/tomcat-juli.jar
Using CATALINA_PID: /jira/work/catalina.pid
Existing PID file found during start.
Removing/clearing stale PID file.
Tomcat started.
查看启动日志
[root@host03 logs]# tailf catalina.out
18-Jul-2018 05:31:39.463 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler [http-nio-8081]
18-Jul-2018 05:31:39.543 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
18-Jul-2018 05:31:39.564 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 67213 ms
至此,jira启动完成。!
6初始配置Jira
防火墙临时开放端口
iptables -I INPUT -p tcp --dport 端口 -j ACCEPT
访问http://ip:端口
一步一步往下操作即可。
选2,我将设置它自己:
注: 次步骤后,会在数据库中创建相应的表。
到 https://my.atlassian.com/license/evaluation 申请license
进入后,第一次登陆,修改管理员的账号与密码。并选择中文语言。
Jira 破解
当前可以看到授权日期是一个月
获取破解包里面的atlassian-extras-3.2.jar上传到以下目录覆盖刷新,并重启jira.
/jira/atlassian-jira/WEB-INF/lib
通过上图,我们可以很明显的看到jira我们可以使用到2033年。到此有关jira的安装、破解就已经全部结束。
5 FAQ
5.1 启动Jira过程报Address already in use
日志如下:
[root@host03 logs]# tailf catalina.out
2018-07-18 05:20:36,002 localhost-startStop-1 ERROR [c.a.j.web.dispatcher.JiraWebworkActionDispatcher]
******************************************
JIRA startup failed, JIRA has been locked.
******************************************
18-Jul-2018 05:20:36.121 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler [http-nio-8080]
18-Jul-2018 05:20:36.133 SEVERE [main] org.apache.coyote.AbstractProtocol.start Failed to start end point associated with ProtocolHandler [http-nio-8080]
java.net.BindException: Address already in use
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:433)
at sun.nio.ch.Net.bind(Net.java:425)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:228)
at org.apache.tomcat.util.net.AbstractEndpoint.start(AbstractEndpoint.java:874)
at org.apache.coyote.AbstractProtocol.start(AbstractProtocol.java:590)
at org.apache.catalina.connector.Connector.startInternal(Connector.java:969)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:440)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:791)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.startup.Catalina.start(Catalina.java:655)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:355)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:495)
18-Jul-2018 05:20:36.135 SEVERE [main] org.apache.catalina.core.StandardService.startInternal Failed to start connector [Connector[HTTP/1.1-8080]]
org.apache.catalina.LifecycleException: Failed to start component [Connector[HTTP/1.1-8080]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:440)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:791)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.startup.Catalina.start(Catalina.java:655)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:355)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:495)
Caused by: org.apache.catalina.LifecycleException: service.getName(): "Catalina"; Protocol handler start failed
at org.apache.catalina.connector.Connector.startInternal(Connector.java:976)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 11 more
Caused by: java.net.BindException: Address already in use
解决办法:
修改个性端口
vi /jira/conf/server.xml
<Service name="Catalina">
<Connector port="8081"
5.2 root 用户登录,报账号或密码错误Sorry, we had some technical problems during your last operation.
需要重置root密码。 密码是存放在这个表中:
select * from cwd_user ;
重置root密码步骤:
- 先用一个普通用户(没有的话,在前台注册一个就可以登录);
- 然后把该用户设置为管理员角色
设置办法: 登录数据库,找到这个表添加一条记录
SELECT child_name, directory_id FROM cwd_membership WHERE parent_name='jira-administrators';
- 使用新的管理员账号进入重置密码
5.3.Jira导出的csv格式问题列表显示乱码问题
问题现象: 在JIRA-问题-所有问题 右上角的 导出 按钮,导出的问题,显示乱码。如下图所示:
解决办法:导出的csv格式文件,先用文本编辑器打开,然后另存为一份csv格式,编码选ANSI。 再用Excel打开,即可显示正常.