在 CentOS 8 上安装 Fontconfig

Jira Software 需要 Java,而 Java 需要 fontconfig 实用程序。

虽然,在安装 Jira 之前没有必要显式安装 fontconfig。
因为如果尚未安装,Jira 安装程序会自动安装 fontconfig 包。

但是为了隔离,我们在继续安装 Jira Software 之前先安装它。

[root@jira-01 ~]# dnf install -y fontconfig
在 CentOS 8 上安装 Jira 软件服务器

在本文中,我们将在 CentOS 8 上安装和配置 Jira 软件服务器。

为 Jira Software 生成试用许可证

使用客户端浏览器浏览 Atlassian 网站

登录到 Atlassian 网站。
我们还可以使用 Google 或者 Microsoft 用户帐户登录,或者我们也可以创建一个 Atlassian 用户帐户。

成功登录后,系统会要求我们为各自的 Jira 产品生成许可证。

填写所需信息并单击“生成许可证”按钮。

Atlassian 将为 Jira 软件生成一个 30 天的试用许可证。
我们应该将许可证密钥复制并保存在一个文本文件中,因为我们稍后会在 Jira 软件的设置过程中需要它。

www. On IT Road .com

在 CentOS 8 上安装 Jira 软件服务器

使用 ssh 工具以 root 用户身份连接 jira-01.onitroad.com。

我们已经将 Jira Software 安装文件转移到 root 用户的主目录下。

[root@jira-01 ~]# ls -lh
total 384M
-rw-------. 1 root root 1.4K Sep 29  2019 anaconda-ks.cfg
-rw-r--r--. 1 root root 384M Apr 19 10:41 atlassian-jira-software-8.8.0-x64.bin

Jira Software 安装文件没有必要的执行权限,因此我们需要授予此文件的执行权限。

[root@jira-01 ~]# chmod u+x atlassian-jira-software-8.8.0-x64.bin

通过运行下载的软件包启动 Jira Software Installer。

[root@jira-01 ~]# ./atlassian-jira-software-8.8.0-x64.bin
Unpacking JRE ...
Starting Installer ...
This will install Jira Software 8.8.0 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:
Express Install (use default settings) [1], Custom Install (recommended for advanced users) [2, Enter], Upgrade an existing Jira installation [3]
1
Details on where Jira Software will be installed and the settings that will be used.
Installation Directory: /opt/atlassian/jira
Home Directory: /var/atlassian/application-data/jira
HTTP Port: 8080
RMI Port: 8005
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 8.8.0 is complete
Start Jira Software 8.8.0 now?
Yes [y, Enter], No [n]
y
Please wait a few moments while Jira Software starts up.
Launching Jira Software ...
Installation of Jira Software 8.8.0 is complete
Your installation of Jira Software 8.8.0 is now ready and can be accessed
via your browser.
Jira Software 8.8.0 can be accessed at http://localhost:8080
Finishing installation ...

在 Linux 防火墙中允许 Jira Software 的默认服务端口。

[root@jira-01 ~]# firewall-cmd --permanent --add-port=8080/tcp
success
[root@jira-01 ~]# firewall-cmd --reload
success

在 CentOS 8 上配置 Jira 软件服务器

在客户端浏览器中浏览 URL http://jira-01.onitroad.com:8080。

选择选项“我会自己设置”,然后单击“下一步”按钮。

在此处提供数据库连接信息,然后单击“测试连接”以测试与 MySQL 数据库服务器的连接。

单击下一步。

在此处设置应用程序属性,然后单击下一步。

指定 Jira 许可证密钥,然后单击下一步。

为 Jira Software 创建一个管理员用户。
单击下一步。

如果要设置电子邮件通知,则可以在此处进行配置。
否则,可以稍后配置此设置。

选择首选语言,然后单击继续。

为用户帐户选择一个头像,然后单击下一步。

我们已经在 CentOS 8 上成功安装和配置了 Jira Software 服务器。

下载适用于 CentOS 8 的 Jira 软件

Jira 软件可在 Jira 官网下载。

目前,Jira Software 8.8.0 最新稳定版可供下载。

选择我们需要的操作系统,然后单击提交。

阅读并接受用户协议,然后单击提交。

下载将很快开始。

使用 WinSCP 或者类似工具将下载的文件传输到 jira-01.onitroad.com 机器。

什么是Jira?

Jira 是一系列产品,旨在帮助所有类型的团队管理他们的工作。

Jira Software 是一个问题跟踪产品,允许错误跟踪和敏捷项目管理。
Jira Software 由 Atlassian 开发。是专有的,不是免费的,但我们可以在 30 天的试用许可下下载和使用 Jira 软件。

在 CentOS 8 上安装 MySQL JDBC 驱动程序

要将 Jira 与 MySQL 数据库连接,我们需要安装 MySQL JDBC 驱动程序,如下所示。

[root@jira-01 ~]# wget https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-8.0.18.zip
--2020-04-19 16:28:49--  https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-8.0.18.zip
Resolving dev.mysql.com (dev.mysql.com)... 137.254.60.11
Connecting to dev.mysql.com (dev.mysql.com)|137.254.60.11|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://cdn.mysql.com//Downloads/Connector-J/mysql-connector-java-8.0.18.zip [following]
--2020-04-19 16:28:51--  https://cdn.mysql.com//Downloads/Connector-J/mysql-connector-java-8.0.18.zip
Resolving cdn.mysql.com (cdn.mysql.com)... 23.43.33.86
Connecting to cdn.mysql.com (cdn.mysql.com)|23.43.33.86|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 4573467 (4.4M) [application/zip]
Saving to: ->mysql-connector-java-8.0.18.zip->
mysql-connector-jav 100%[===================>]   4.36M  1.18MB/s    in 3.9s
2020-04-19 16:28:56 (1.11 MB/s) - ->mysql-connector-java-8.0.18.zip-> saved [4573467/4573467]

解压缩下载的 zip 文件,如下所示。

[root@jira-01 ~]# unzip mysql-connector-java-8.0.18.zip
...
  inflating: mysql-connector-java-8.0.18/src/test/java/testsuite/x/internal/MysqlxSessionTest.java
  inflating: mysql-connector-java-8.0.18/src/test/java/testsuite/x/internal/XProtocolAsyncTest.java
  inflating: mysql-connector-java-8.0.18/src/test/java/testsuite/x/internal/XProtocolAuthTest.java
  inflating: mysql-connector-java-8.0.18/src/test/java/testsuite/x/internal/XProtocolTest.java
  inflating: mysql-connector-java-8.0.18/src/test/java/testsuite/x/internal/package-info.java

将 mysql-connector-java-8.0.18.jar 文件复制到 /opt/atlassian/jira/lib 目录中。

[root@jira-01 ~]# cp mysql-connector-java-8.0.18/mysql-connector-java-8.0.18.jar /opt/atlassian/jira/lib

重新启动 Jira 服务使更改生效。

[root@jira-01 ~]# service jira stop
...
[root@jira-01 ~]# service jira start
To run Jira in the foreground, start the server with start-jira.sh -fg
executing using dedicated user: jira
                  `sMMMMMMMMMMMMMM+
                     MMMMMMMMMMMMMM
                     :sdMMMMMMMMMMM
                             MMMMMM
          `sMMMMMMMMMMMMMM+  MMMMMM
             MMMMMMMMMMMMMM  +MMMMM
              :sMMMMMMMMMMM   MMMMM
                     MMMMMM    `UOJ
   `sMMMMMMMMMMMMM+  MMMMMM
     MMMMMMMMMMMMMM  +MMMMM
      :sdMMMMMMMMMM   MMMMM
             MMMMMM    `UOJ
             MMMMMM
             +MMMMM
              MMMMM
               `UOJ
      Atlassian Jira
      Version : 8.8.0

If you encounter issues starting or stopping Jira, please see the Troubleshooting guide at https://docs.atlassian.com/jira/jadm-docs-088/Troubleshooting+installation

Server startup logs are located in /opt/atlassian/jira/logs/catalina.out
Using CATALINA_BASE:   /opt/atlassian/jira
Using CATALINA_HOME:   /opt/atlassian/jira
Using CATALINA_TMPDIR: /opt/atlassian/jira/temp
Using JRE_HOME:        /opt/atlassian/jira/jre/
Using CLASSPATH:       /opt/atlassian/jira/bin/bootstrap.jar:/opt/atlassian/jira/bin/tomcat-juli.jar
Using CATALINA_PID:    /opt/atlassian/jira/work/catalina.pid
Tomcat started.

在 CentOS 8 上安装 MySQL 5.7

Jira 应用程序预配置了 H2 数据库,适用于评估或者演示目的。

但我们也可以将 Oracle、MySQL、PostreSQL 等流行数据库配置为 Jira 后端。

在这里,我们将 MySQL 数据库配置为 Jira 应用程序后端。

Jira 与 MySQL 5.7 兼容,这在 CentOS 8 服务器的默认 yum 存储库中不可用。
因此,我们需要添加 Oracle MySQL yum 存储库,然后从中安装 MySQL 5.7.

在 /etc/yum.repos.d 目录中创建一个 repo 文件。

[root@jira-01 ~]# vi /etc/yum.repos.d/mysql57.repo

并其中添加以下几行。

[mysql57-community]
name=MySQL 5.7 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/7/$basearch/
enabled=1
gpgcheck=0
[mysql-connectors-community]
name=MySQL Connectors Community
baseurl=http://repo.mysql.com/yum/mysql-connectors-community/el/7/$basearch/
enabled=1
gpgcheck=0
[mysql-tools-community]
name=MySQL Tools Community
baseurl=http://repo.mysql.com/yum/mysql-tools-community/el/7/$basearch/
enabled=1
gpgcheck=0

为新添加的 yum 存储库构建缓存。

[root@jira-01 ~]# yum makecache
CentOS-8 - AppStream                            3.1 kB/s | 4.3 kB     00:01
CentOS-8 - Base                                 2.0 kB/s | 3.8 kB     00:01
CentOS-8 - Extras                               1.3 kB/s | 1.5 kB     00:01
MySQL 5.7 Community Server                      316 kB/s | 1.7 MB     00:05
MySQL Connectors Community                       38 kB/s |  64 kB     00:01
MySQL Tools Community                           180 kB/s | 392 kB     00:02
Metadata cache created.

在默认 yum 存储库中禁用 MySQL 模块。

[root@jira-01 ~]# dnf module disable mysql
Last metadata expiration check: 0:00:42 ago on Sun 19 Apr 2020 03:16:09 PM PKT.
Dependencies resolved.
================================================================================
 Package           Architecture     Version             Repository         Size
================================================================================
Disabling modules:
 mysql
Transaction Summary
================================================================================
Is this ok [y/N]: y
Complete!

现在,我们可以使用 dnf 命令安装 MySQL 5.7.

[root@jira-01 ~]# dnf --enablerepo=mysql57-community install -y mysql-community-server

启用并启动 MySQL 数据库服务。

[root@jira-01 ~]# systemctl enable --now mysqld.service

检索 root 用户的临时密码如下。

[root@jira-01 ~]# grep 'A temporary password' /var/log/mysqld.log
2020-04-19T10:40:23.859366Z 1 [Note] A temporary password is generated for root@localhost: y?yc,ew7>4mO

配置 MySQL 数据库服务器。

[root@jira-01 ~]# mysql_secure_installation
Securing the MySQL server deployment.
Enter password for user root:
The 'validate_password' plugin is installed on the server.
The subsequent steps will run with the existing configuration
of the plugin.
Using existing password for root.
Estimated strength of the password: 100
Change the password for root ? ((Press y|Y for Yes, any other key for No) : Y
New password:
Re-enter new password:
Estimated strength of the password: 100
Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : Y
By default, a MySQL installation has an anonymous user,
allowing anyone to log into MySQL without having to have
a user account created for them. This is intended only for
testing, and to make the installation go a bit smoother.
You should remove them before moving into a production
environment.
Remove anonymous users? (Press y|Y for Yes, any other key for No) : Y
Success.

Normally, root should only be allowed to connect from
'localhost'. This ensures that someone cannot guess at
the root password from the network.
Disallow root login remotely? (Press y|Y for Yes, any other key for No) : Y
Success.
By default, MySQL comes with a database named 'test' that
anyone can access. This is also intended only for testing,
and should be removed before moving into a production
environment.

Remove test database and access to it? (Press y|Y for Yes, any other key for No) : Y
 - Dropping test database...
Success.
 - Removing privileges on test database...
Success.
Reloading the privilege tables will ensure that all changes
made so far will take effect immediately.
Reload privilege tables now? (Press y|Y for Yes, any other key for No) : Y
Success.
All done!

以 root 用户身份连接 MySQL shell。

[root@jira-01 ~]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 18
Server version: 5.7.29 MySQL Community Server (GPL)
Copyright (c) 2000, 2020, 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>

为 Jira 软件创建数据库和用户。

mysql> CREATE DATABASE jiradb CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
Query OK, 1 row affected (0.00 sec)
mysql> GRANT ALL on jiradb.* TO 'juser'@'localhost' IDENTIFIED BY 'JackLi@1234';
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.23 sec)
mysql> QUIT;
Bye

根据 Jira Software 要求编辑 MySQL 配置文件。

[root@jira-01 ~]# vi /etc/my.cnf

在此文件的 [mysqld] 部分下添加以下指令。

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

重启 MySQL 服务以加载新配置。

[root@jira-01 ~]# systemctl restart mysqld.service
日期:2020-09-17 00:16:38 来源:oir作者:oir