实战Jira 8.6安装

最近,安装了一下Jira8.6(最新的Jira8.18版本测试了一下, 用atlassian-agent生成许可证后,会显示许可证不合法,但可以正常使用)。安装后,还是出现了一些问题,在这里记录一下。

安装环境

1
2
3
4
OS: Centos7.9
DB: mysql-5.7.34
Jira: jira8.6
硬件: 8core/16G/100G VMware VM

OS 相关操作

1
2
3
4
5
6
## 关掉Centos7.9上的SElinux
vi /etc/selinux/config
SELINUX=disabled
## 系统FW上打开TCP8080端口
firewall-cmd --permanent --zone=public --add-port=8080/tcp
firewall-cmd --reload

Mysql 相关操作

1
2
3
4
5
6
7
8
9
# 安装mysql
wget https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
yum localinstall mysql5.7-community-release-el7-3.noarch.rpm
yum install -y mysql-community-server
systemctl status mysqld
grep 'temporary password' /var/log/mysqld.log
# 用上面的密码登录mysql 改成自己的密码
mysql -uroot -p
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass4!';

CentOS7下MySQL安装相关链接

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
## 配置 mysql
shell> vi /etc/my.cnf
#configration for Jira
default-storage-engine=INNODB
character_set_server=utf8mb4
innodb_default_row_format=DYNAMIC
innodb_large_prefix=ON
innodb_file_format=Barracuda
innodb_log_file_size=2G
#sql_mode = NO_AUTO_VALUE_ON_ZERO
max_connections = 1024
max_allowed_packet=256M
transaction-isolation=READ-COMMITTED
#for my 8core/16G VM config
innodb_buffer_pool_size = 4G
innodb_thread_concurrency = 8
innodb_log_buffer_size = 128M
innodb_log_file_size = 256M
innodb_open_files = 102400

点击查看官方相关Jira 对MySQL的配置要求

1
2
3
4
5
## 创建Jira数据库设置权限
shell> mysql -uroot -p
mysql>CREATE DATABASE jiradb CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
mysql>GRANT ALL PRIVILEGES ON jiradb.* TO 'jira'@'localhost' IDENTIFIED BY 'MyJiraPas4!';
mysql>flush privileges;

安装Jira

1
2
3
4
5
6
7
8
9
10
11
## download Jira
wget https://product-downloads.atlassian.com/software/jira/downloads/atlassian-jira-software-8.6.0-x64.bin
## install Jira
chmod 755 atlassian-jira-software-8.6.0-x64.bin
./atlassian-jira-software-8.6.0-x64.bin
#相关选项如下,最后一项 Install as service 我选择了no, 手动拉启来
Install type – choose option 2 (custom) for the most control.
Destination directory – this is where Jira will be installed.
Home directory – this is where Jira data like logs, search indexes and files will be stored.
TCP ports – these are the HTTP connector port and control port Jira will run on. Stick with the default unless you are running another application on the same port.
Install as service – this option is only available if you ran the installer as sudo.

点击查看Jira官方安装文档

安装 java-mysql驱动

这里很关键,我的问题就出在这里,一定要下载 MySQL Connector/J 5.1 driver ,一定要下载 MySQL Connector/J 5.1 driver,一定要下载 MySQL Connector/J 5.1 driver,重要的事情说三便,如果你使用的数据库是mysql5.7,请一定要用mysql5.1 Driver,我当时选了mysql8.0 JAVA Driver,出现了如没办法用Jira提供的备份工具备份,新建 ISSUE偶尔出错等各种怪问题

1
2
3
4
5
## 下载mysql Connector/J 5.1 Drive
wget https://downloads.mysql.com/archives/get/p/3/file/mysql-connector-java-5.1.49.zip
## 解压 CP到 Jira lib目录下面,默认是 /opt/atlassian/jira/lib/
unzip mysql-connector-java-5.1.49.zip
cp mysql-connector-java-5.1.49/mysql-connector-java-5.1.49.jar <you-jira-installation-directory>/lib/

安装 atlassian-agent 生成许可证

先感谢一下atlassian-agent 的作者,做了这个项目

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
## 下载 atlassian-agent
wget https://gitee.com/pengzhile/atlassian-agent/attach_files/283102/download/atlassian-agent-v1.2.3.zip
unzip atlassian-agent-v1.2.3.zip
cp atlassian-agent-v1.2.3/atlassian-agent.jar <you-jira-installation-directory>/lib/
## 更改 setenv.sh文件, 在JAVA_OPTS行下面增加二行内容
vi <you-jira-installation-directory>/bin/setenv.sh
JAVA_OPTS="-javaagent:/data/atlassian/jira/lib/atlassian-agent.jar ${JAVA_OPTS}"
export JAVA_OPTS
## 启动Jira
cd <you-jira-installation-directory>/bin
./start-jira.sh
## 用浏览器连到 http://192.168.108.40:8080,在设置完数据库连接后,会提示你输入 Jira software 的License, 记录下服务器 ID 如BJN2-IEC8-RKXX-XXXX输入下面的命令,生成License
cd <you-jira-installation-directory>/lib
java -jar atlassian-agent.jar -p jira -m wuying@xxx.com -n wuying -o http://192.168.108.40:8080/ -s BJN2-IEC8-RKXX-XXXX

参数说明:
-m:指定邮箱
-n:授权给的用户
-p:需要获取key的程序, jira为Jira Software;jc为jira Core的缩写
-o:jira的url地址
-s:服务器ID
# 服务器ID一定要输入正确,其它随意。
# 在浏览器中黏贴上面输入的License
# 插件破解和以上破解类似,把破解的许可证码更新进去即可。

问题小结

  1. 如果数据库用的是Mysql5.7,那JAVA mysql Drive 一定要用MySQL Connector/J 5.1 driver ,不然,会出没办法用Jira提供的备份工具备份,新建 ISSUE偶尔出错等各种怪问题。
  2. 没办法删除ISSUE的问题解决,可能还是数据库设置没设好,后来改好了,但还是出问题了。点击这个链接 查看具体操作方法。
坚持原创技术分享,您的支持将鼓励我继续创作!