Jira Data Center(非集群)升级操作

一、升级准备

  1. Jira 管理界面执行升级检查
  2. 下载升级包,使用原操作方式相同的方式安装。我这里原来的版本是通过./atlassian-jira-software-9.11.2-x64.bin安装的,接下来下载atlassian-jira-software-9.11.3-x64.bin的安装文件,下载地址 https://downloads.atlassian.com/software/jira/downloads/atlassian-jira-software-9.11.3-x64.bin
  3. 停止 Jira,bin/stop-jira.sh
  4. 使用mysqldump -u root -p --all-databases | gzip > mysqldump.20231110.sql.gz备份完整的数据库
  5. 使用命令ll /opt/atlassian/jira/atlassian-jira/WEB-INF/lib | grep mysql检查之前的数据库驱动文件版本,并复制一份做好备份
  6. 检查之前修改过的文件,并保留文件内容,在新版本安装后,将变动的内容复制进去,不要整个文件覆盖。我这边改过setenv.sh,startup.sh,server.xml

二、执行升级操作

执行以下命令开始执行升级操作。注意中间几个命令的选择,升级的话,可以按照以下记录核对一步步做即可。

root@localhost:/home/ubuntu# ./atlassian-jira-software-9.11.3-x64.bin 
Unpacking JRE ...
Starting Installer ...

# 询问是否安装指定版本,输入o,按回车
This will install Jira Software 9.11.3 on your computer.
OK [o, Enter], Cancel [c]
o
Click Next to continue, or Cancel to exit Setup.

Choose the appropriate installation or upgrade option.
Please choose one of the following:
# 这里询问安装方式,我们是升级,所以输入3,按回车
Express Install (use default settings) [1], Custom Install (recommended for advanced users) [2], Upgrade an existing Jira installation [3, Enter]
3

# 这里提示默认目录位置,记得按回车确认,我以为后台已经在执行,瞎等了半天
Existing installation directory:
[/opt/atlassian/jira]

Back up Jira home directory
The upgrade process will automatically back up your Jira installation
directory. You can also choose to back up your existing Jira home directory.
Both directories are backed up as zip archive files in their respective
parent directory locations.

We strongly recommend choosing this option in the unlikely event that you
experience problems with the upgrade and may require these backups to
restore your existing Jira installation.

If you have many attachments in your Jira home directory, the zip archive of
this directory may consume a significant amount of disk space.
# 我选择了备份默认目录,这样子如果失败了,还有地方可以还原,根据文件多少,这里需要等等。输入 y,按回车
Back up Jira home directory?
Yes [y, Enter], No [n]
y

Checking for local modifications.

List of modifications made within Jira directories.

# 记住下面改动过的文件内容,安装完了之后去确认文件内容,除了setenv.sh、startup.sh和需要修改,本次升级,server.xml文件中变更点还在,数据库驱动包也还在
The following provides a list of file modifications within the
atlassian-jira directory.

Modified files:
        bin/setenv.sh
        conf/server.xml
        bin/startup.sh
Removed files:
        (none)
Added files:
        atlassian-jira/WEB-INF/lib/mysql-connector-java-8.0.30.jar

[Enter]


Checking if your instance of Jira Software is running

Upgrade checklist
Complete these steps to have a smooth upgrade experience. If you need more
details, see
https://docs.atlassian.com/jira/jadm-docs-0911/Preparing+for+the+upgrade.

# 在 Jira 管理界面中运行健康检查,确保所有服务都正常
1. Run a Jira health check
Run a Jira health check to verify that you're ready to upgrade. Make sure
that checks related to the license and database have passed, but you can
also fix other detected problems.

# 在提示升级的管理界面中确认兼容性
2. Check app compatibility
Make sure your apps are compatible with the Jira version you're upgrading
to. Disable all incompatible apps, so they don't affect your upgrade.

# 使用工具备份数据库,前面已经做过了
3. Back up the database
Back up the Jira database using your database's native backup tools.

# 确认上面的都做了,就输入 y,按回车
Have you completed all these steps?
Yes [y], No [n, Enter]
y
# 确认是否升级,输入 u,按回车
Your existing Jira installation is about to be upgraded! Do you want to proceed?
Upgrade [u, Enter], Exit [e]
u

Your instance of Jira is currently being upgraded.
Checking if Jira has been shutdown...
Backing up the Jira installation directory
                                                                           
Backing up the Jira home directory
                                                                           
Deleting the previous Jira installation directory...

Extracting files ...
                                                                           
/opt/atlassian/jira/bin/tcnative-1.dll

The file already exists.

# 确认覆盖,输入 y,按回车
Would you like Setup to overwrite it?
Yes [y], Yes to All [ya], No [n], No to All [na]
y

Please wait a few moments while Jira Software is configured.

# 询问是否启动新版本的 Jira,这里选择否,因为后面还需要检查自定义的配置文件,所以输入 n,按回车
Installation of Jira Software 9.11.3 is complete
Start Jira Software 9.11.3 now?
Yes [y], No [n, Enter]
n

Installation of Jira Software 9.11.3 is complete
Your installation of Jira Software 9.11.3 is now ready.
Custom modifications
Your previous Jira installation contains customisations (eg server.xml) that
must be manually transferred. Refer to our documentation more information:
http://docs.atlassian.com/jira/jadm-docs-0911/Upgrading+JIRA+applications+manually#UpgradingJIRAapplicationsmanually-configuringnewjiraasold3.4MigrateyourexistingJIRAconfigurationsovertoyournewJIRAinstallation
Finishing installation ...

至此,升级安装过程已经完成

三、升级后文件检查

  1. /opt/atlassian/jira/bin/setenv.sh
JAVA_OPTS="-Xms${JVM_MINIMUM_MEMORY} -Xmx${JVM_MAXIMUM_MEMORY} ${JVM_CODE_CACHE_ARGS} ${JAVA_OPTS} ${JVM_REQUIRED_ARGS} ${DISABLE_NOTIFICATIONS} ${JVM_SUPPORT_RECOMMEND
ED_ARGS} ${JVM_EXTRA_ARGS} ${JIRA_HOME_MINUSD} ${START_JIRA_JAVA_OPTS}"

修改自己想要的参数

JAVA_OPTS="-javaagent:/opt/atlassian*****agent.jar  -Xms${JVM_MINIMUM_MEMORY} -Xmx${JVM_MAXIMUM_MEMORY} ${JVM_CODE_CACHE_ARGS} ${JAVA_OPTS} ${JVM_REQUIRED_ARGS} ${DISABLE_NOTIFICATIONS} ${JVM_SUPPORT_RECOMMEND
ED_ARGS} ${JVM_EXTRA_ARGS} ${JIRA_HOME_MINUSD} ${START_JIRA_JAVA_OPTS}"
  1. /opt/atlassian/jira/bin/startup.sh,使用80端口启动Tomcat。最后一行
exec "$PRGDIR"/"$EXECUTABLE" start "$@"

改成

exec authbind --deep "$PRGDIR"/"$EXECUTABLE" start "$@"

原来authbind的安装配置的文章请参考我的在 Linux 以非 root 用户将 Tomcat 运行在 80 端口上

  1. /opt/atlassian/jira/conf/server.xml 文件,确认监听80端口,注意Connector port=参数值即可
<Connector port="80" relaxedPathChars="[]|" relaxedQueryChars="[]|{}^&#x5c;&#x60;&quot;&lt;&gt;"
                   maxThreads="150" minSpareThreads="25" connectionTimeout="20000" enableLookups="false"
                   maxHttpHeaderSize="8192" protocol="HTTP/1.1" useBodyEncodingForURI="true" redirectPort="8443"
                   acceptCount="100" disableUploadTimeout="true" bindOnInit="false"/>
  1. 数据库连接驱动文件检查
# ll /opt/atlassian/jira/atlassian-jira/WEB-INF/lib | grep mysql
-rw-r--r-- 1 root root  2513563 Nov 10 09:23 mysql-connector-java-8.0.30.jar

四、启动服务后检查

所有自定义配置的文件内容确认完了之后,进入 /opt/atlassian/jira 目录,执行 bin/start-jira.sh 启动服务,然后有一个升级后启动的过程,耐心等待。

我在启动过程中,有提示 server.xml 文件内容不对,我核实了端口号是对的,直接忽略警告继续启动了。

启动成功后,登录管理界面,会提示需要重建索引,按照提示操作即可。

至此,升级完成。如果一切正常后,可以删除过程中自动备份的目录文件,我这边两个文件共占用 1GB 的空间。

rm -f /opt/atlassian/jira-9.11.2-back.zip
rm -f /var/atlassian/application-data/jira-9.11.2-back.zip

五、官方参考资料

Upgrading Jira (manual)

猜你喜欢

转载自blog.csdn.net/xieshaohu/article/details/134326053
今日推荐