07-jira服务部署¶
https://www.jianshu.com/p/b95ceabd3e9d
https://gitee.com/leoss/jira-confluence-mysql?_from=gitee_search
容器部署¶
JIRA 是一个缺陷跟踪管理系统,为针对缺陷管理、任务追踪和项目管理的商业性应用软件,开发者是澳大利亚的Atlassian。JIRA这个名字并不是一个缩写,而是截取自“Gojira”,日文的哥斯拉发音。
首先部署数据库:
mkdir -p /data/devops-compose/atlassian/confluence/mariadb
chmod 777 /data/devops-compose/atlassian/confluence/mariadb
docker run --name confluence-jira-mysql -p 3306:3306 \
-v /data/devops-compose/atlassian/confluence/mariadb:/srv/data \
-e MYSQL_DATABASE=mybase \
-e MYSQL_USER=dev \
-e MYSQL_PASSWORD=mysql \
-e MYSQL_ROOT_PASSWORD=Passw0rd \
-it -d endial/mysql-alpine
mysql -h 192.168.1.21 -pPassw0rd
-- 设置confdb事务级别
show variables like 'tx%';
set session transaction isolation level read committed;
SET GLOBAL tx_isolation='READ-COMMITTED';
show variables like 'tx%';
--创建jira数据库及用户
CREATE DATABASE `jira` DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
create user jira identified by 'jira';
grant all privileges on *.* to 'jira'@'%' identified by 'jira' with grant option;
grant all privileges on *.* to 'jira'@'localhost' identified by 'jira' with grant option;
flush privileges;
--创建confluence数据库及用户
CREATE DATABASE `confluence` DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
create user confluence identified by 'confluence';
grant all privileges on *.* to 'confluence'@'%' identified by 'confluence' with grant option;
grant all privileges on *.* to 'confluence'@'localhost' identified by 'confluence' with grant option;
flush privileges;
拉取相关代码
git clone https://gitee.com/chriscentos/devops-d.git
编写Dockerfile文件:
FROM cptactionhank/atlassian-jira-software:7.12.0
USER root
# 将代理破解包加入容器
COPY "atlassian-agent.jar" /opt/atlassian/jira/
# 设置启动加载代理包
RUN echo 'export CATALINA_OPTS="-javaagent:/opt/atlassian/jira/atlassian-agent.jar ${CATALINA_OPTS}"' >> /opt/atlassian/jira/bin/setenv.sh
下载atlassian-agent.jar文件,放置在Dockerfile同目录下,例如:
- JIRA
--Dockerfile
--atlassian-agent.jar
构建镜像,执行命令:
docker build -t jira/jira:v7.12.0 .
结果如下:
Sending build context to Docker daemon 985.1kB
Step 1/4 : FROM cptactionhank/atlassian-jira-software:7.12.0
---> 1b29859343c2
Step 2/4 : USER root
---> Using cache
---> 31ea501d34b6
Step 3/4 : COPY "atlassian-agent.jar" /opt/atlassian/jira/
---> ce3a1f7cd53d
Step 4/4 : RUN echo 'export CATALINA_OPTS="-javaagent:/opt/atlassian/jira/atlassian-agent.jar ${CATALINA_OPTS}"' >> /opt/atlassian/jira/bin/setenv.sh
---> Running in 88440445ba9e
---> f247b9463dbb
Removing intermediate container 88440445ba9e
Successfully built f247b9463dbb
Successfully tagged jira/jira:v7.12.0
启动容器,执行命令:
docker run --name jira --detach --publish 8080:8080 jira/jira:v7.12.0
检查容器是否运行
[root@linux-bkce-node21 ~]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9fcb4740aa66 jira/jira:v7.12.0 "/docker-entrypoin..." 4 seconds ago Up 2 seconds 0.0.0.0:8080->8080/tcp jira
访问http://192.168.1.21:8080,可见如下页面: (容器运行加载服务需要一段时间)
选择其他数据库
选择私有
复制服务器ID: BF10-NI23-FRQE-6IPE 在本地存放"atlassian-agent.jar"的目录下执行命令,生成许可证:
# 需替换邮箱(test@test.com)、名称(BAT)、
# 访问地址(http://192.168.0.89)、服务器ID(BY9B-GWD1-1C78-K2DE)
# 为你的信息
java -jar atlassian-agent.jar -d -m test@test.com -n BAT -p jira -o http://192.168.1.21 -s BF10-NI23-FRQE-6IPE
将生成的许可证复制到页面,完成破解。
[root@linux-bkce-node21 ~]# cd devops-d/jira/
atlassian-agent.jar Dockerfile
[root@linux-bkce-node21 ~]# cd /root/devops-d/jira/
[root@linux-bkce-node21 jira]# java -jar atlassian-agent.jar -d -m test@test.com -n BAT -p jira -o http://192.168.1.21 -s BF10-NI23-FRQE-6IPE
====================================================
======= Atlassian Crack Agent =======
======= https://zhile.io =======
======= QQ Group: 30347511 =======
====================================================
Your license code(Don't copy this line!!!):
AAABnQ0ODAoPeJyNkt1uozAQhe95CqRem4Kb0CYS0qbgSkiEtIXuvUMmxRUx1tikm336mkC7/Ymil
SwkoznHZ76Zi7Lu3IVClwZuMJvT6zkN3bgoXepT6jwjgKxbpQC9TFQgNZQHBTnfQRSvlkv2GKeLz
IkRuBGtTLiBqBcSf0Jo4JyRJKArFKpXRU+yETthYOM2g8BdH9zaGKXnl5d/a9GAJ1pnyYU0ILmsg
P1RAg/jazcz4l/b47wI5O8p2UYM1nmWLtOSJU7e7daAq+2TBtQR+Qh3xkthu+kq4/UXotuteeUI3
g+jM7W8MmIPkcEOvrD8/P+M3KbiMdiucSgd8fy2D/fNUafo1v8wHkvYnjfdcRjRljd6tP9utMJnL
oUe6nrSFnQwo14Q3niBZycXt9LYkMxCbyID2vzqP17V7gbD0xD+s63CcOyjDAHHOaRJlKVJwXKSB
eHUn078ySQMp1dfxnpqkwrAPaCV394FPslTekXuHh8YCdN7dmqBf67GfYdVzTV8X9/P4iM8hUKP7
dmg0YmwI7djxttF+QZdZyX9MC0CFQCH6cHAn0zO5fIy03wuiNmXw/fWfwIUO4bp7PQ3eery0w8Tv
H5VMxYIEeQ=X02k0
输入您的许可证关键字
设置管理员帐户密码 admin/admin
设置电子邮件通知-选择以后再说
输入账户密码登录 admin/admin
选择中文
最终界面
软件获取¶
链接: https://pan.baidu.com/s/1HiOulNAzGeYF4eykYrJWjQ 提取码: kaw3
安装部署¶
友情提示:安装为官网目前最新版本,现已支持中文!无需中文破解
安装Jira
wget https://product-downloads.atlassian.com/software/jira/downloads/atlassian-jira-software-7.13.0-x64.bin
[root@YZSJHL82-204 ~]# chmod +x atlassian-jira-software-7.13.0-x64.bin
[root@YZSJHL82-204 ~]# ./atlassian-jira-software-7.13.0-x64.bin
Unpacking JRE ...
Starting Installer ...
十月 23, 2018 4:38:25 下午 java.util.prefs.FileSystemPreferences$1 run
信息: Created user preferences directory.
十月 23, 2018 4:38:25 下午 java.util.prefs.FileSystemPreferences$2 run
信息: Created system preferences directory in java.home.
This will install JIRA Software 7.4.1 on your computer.
OK [o, Enter], Cancel [c]
o #按o安装
Choose the appropriate installation or upgrade option.
Please choose one of the following:
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?
[/opt/atlassian/jira]
/usr/local/atlassina/jira #自定义安装目录
Default location for JIRA Software data
[/var/atlassian/application-data/jira]
/usr/local/atlassina/jira_data #自定义数据目录
Configure which ports JIRA Software will use.
JIRA requires two TCP ports that are not being used by any other
applications on this machine. The HTTP port is where you will access JIRA
through your browser. The Control port is used to startup and shutdown JIRA.
Use default ports (HTTP: 8080, Control: 8005) - Recommended [1, Enter], Set custom value for HTTP and Control ports [2]
2 #2为自定义端口
HTTP Port Number
[8080] #8080为默认端口
8050 #http连接端口
Control Port Number
[8005]
8040 #控制端口
JIRA can be run in the background.
You may choose to run JIRA as a service, which means it will start
automatically whenever the computer restarts.
Install JIRA as Service?
Yes [y, Enter], No [n]
y #是否开机自启
Details on where JIRA Software will be installed and the settings that will be used.
Installation Directory: /usr/local/atlassina/jira
Home Directory: /usr/local/atlassina/jira_data
HTTP Port: 8050
RMI Port: 8040
Install as service: Yes
Install [i, Enter], Exit [e]
i #确认已选配置
Extracting files ...
Please wait a few moments while JIRA Software is configured.
Installation of JIRA Software 7.4.1 is complete
Start JIRA Software 7.4.1 now?
Yes [y, Enter], No [n]
y #启动
Please wait a few moments while JIRA Software starts up.
Launching JIRA Software ...
Installation of JIRA Software 7.4.1 is complete
Your installation of JIRA Software 7.4.1 is now ready and can be accessed
via your browser.
JIRA Software 7.4.1 can be accessed at http://localhost:8050
Finishing installation ...
image_1ctuoh5608ofkut104r1etc1jq9u.png-363.3kB
浏览器访问jira,地址为:http://IP:8050 请自行修改IP和端口。如果可以访问,说明安装成功。
界面安装¶
配置数据库及密码
在mySQL上创建用户及库做授权
create database jira_new;
grant all privileges on *.* to jira@'10.4.82.204' identified by 'jira';
flush privileges;
在授权完用户我们不可以马上填写信息,需要添加MySQL的一个jra包,否则下一步会提示找不到mysql的驱动
Mysql数据库驱动:mysql-connector-java-5.1.46-bin.jar
https://blog.csdn.net/weixin_41831619/article/details/79914307
停止jira
[root@YZSJHL82-204 ~]# /etc/init.d/jira stop
上传软件包
[root@YZSJHL82-204 ~]# cp mysql-connector-java-5.1.46-bin.jar /opt/atlassian/jira/atlassian-jira/WEB-INF/lib/
启动jira
[root@YZSJHL82-204 ~]# /etc/init.d/jira start
注意防火墙
安装完数据库插件即可下一步
设置jira主题
因为第一次安装,我们需要去jira官网注册用户,获取授权码 (免费30天,安装后更换破解即可)
保存好服务器ID,进入atlassian官网获取试用许可证,下边附上注册地址:
或使用以下地址:
https://id.atlassian.com/signup?application=mac&continue=https://my.atlassian.com
登陆账号后,选择New Evaluation License
官网会给你一个key,如下
AAABew0ODAoPeNp9kUtvgkAUhff8CpJu2gWEGYpaE5K2MEltFI3Yx6KbcbjqtAr0zmDrvy8CTbU+l
nfgnPudcy9eIDGjbG1SYjpul3hdxzGDeGJSh3SMOQKkiyzPAe2+FJAqYInUMkt9Fk3YeDTuxcyIi
tUUcDh7UoDKt4gRZKnmQkd8BT4hHXrjdajbvv38tEW2Mt4lcvtAMypQLLiCkGvwt8stQixKjGbtZ
JND5RcMBwM2Dnp3/d9P7DuXuNnR0a2uYWADLpdHIGLANWAv9O/ZNbVevdC1qNNyraEbP9SEOWZJI
bS9HSyVzfQXR7BLS7kGX2MB9W+nazlS3rEUJWCqIeWpOJHkDM1Bi82eMle/F8YssvqEtjpeu90yy
snffzljHGuOGtCf8aUCY4hznkrFq4R8KpJMfAAaAUL19P9kyxriuWTaCuheE1CGxRylakoMQQmUe
WX9WDKYccNgXtY3unrrmmzNl0W1q4Y+dYVj/e4u39X9edbzDy+jBgUwLAIUGEsZx/lkSHU0VMPQB
LZr4HksJccCFF2Jtcmkz/J+FzZphaogdzq/ozkYX02ie
我们将上面的key复制到页面上
设置管理员**用户**
配置使用¶
官网注册的账号只可以免费试用30天,所以当我们安装完需要尽快进行
破解jira
停止jira
[root@YZSJHL82-204 ~]# /etc/init.d/jira stop
进入安装目录下的atlassian-jira/WEB-INF/lib/目录下,用破解包atlassian-extras-3.2.jar替换原来的包。并将mysql连接驱动复制到此目录下。
[root@YZSJHL82-204 ~]# cp atlassian-extras-3.2.jar /opt/atlassian/jira/atlassian-jira/WEB-INF/lib/
启动jira
[root@YZSJHL82-204 ~]# /etc/init.d/jira start
注意防火墙
配置数据库连接地址¶
/var/atlassian/application-data/jira/dbconfig.xml
#此路径为默认路径
mkdir -p /data/devops-compose/atlassian/jira/
chmod 777 /data/devops-compose/atlassian/jira/
docker pull cptactionhank/atlassian-jira-software:7.12.0
-v /data/devops-compose/atlassian/jira:/opt/atlassian/jira
docker run --name jira --detach --publish 8080:8080 jira/jira:v7.12.0
BED6-MQAX-JFIG-ZZXY
java -jar atlassian-agent.jar -d -m test@test.com -n BAT -p jira -o http://192.168.1.21 -s BED6-MQAX-JFIG-ZZXY
BWZ4-QHP2-R71Z-YF38
java -jar atlassian-agent.jar -d -m test@test.com -n BAT -p conf -o http://192.168.1.21 -s BWZ4-QHP2-R71Z-YF38