一つ前の記事でAmazonLinux2022(以降AL2022)のx86アーキテクチャのAMIを使用した場合の環境構築手順を書きました。こちらはArmアーキテクチャを使用した場合の手順になります。
→ AmazonLinux2022(x86)プレビュー版でJava11+Tomcat9+MySQLの動作環境を構築する
ArmアーキテクチャなAMIを選択することで時間当たりの単価がt3系より少し安いt4g系のインスタンスタイプを選択することができます。
インスタンスを起動
以下のような設定でインスタンスを起動
名前 | AL2022_arm |
---|---|
AMI | ami-04d4b8058db9e5fb3 |
AMI(名称) | al2022-ami-ecs-hvm-2022.0.20221102-kernel-5.15-arm64 |
インスタンスタイプ | t4g.medium |
セキュリティグループ | 22(SSH)と80(HTTP)について自分のIPからの接続を許可するようなルールを設定 |
ストレージ | 30GB、gp3(初期値のまま) |
↑マーケットプレースAMIで「Amazon Linux 2022」と検索しarm64の記載のあるAMIを選択
インスタンスの初期状態確認
Updates Information Summary: available 1 Security notice(s) 1 Medium Security notice(s) __| __| __| _| ( \__ \ Amazon Linux 2022 (ECS Optimized) ____|\___|____/ Preview For documentation, visit http://aws.amazon.com/documentation/ecs
↑SSH接続するとこんな感じの表示が出る
$ cat /etc/os-release NAME="Amazon Linux" VERSION="2022" ID="amzn" ID_LIKE="fedora" VERSION_ID="2022" PLATFORM_ID="platform:al2022" PRETTY_NAME="Amazon Linux 2022" ANSI_COLOR="0;33" CPE_NAME="cpe:2.3:o:amazon:amazon_linux:2022" HOME_URL="https://aws.amazon.com/linux/" BUG_REPORT_URL="https://github.com/amazonlinux/amazon-linux-2022" SUPPORT_END="2027-11-01" $ cat /etc/system-release Amazon Linux release 2022 (Amazon Linux) $ uname -a Linux ip-172-31-25-201.ap-northeast-1.compute.internal 5.15.73-45.135.amzn2022.aarch64 #1 SMP Fri Oct 14 17:39:54 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux $ id uid=1000(ec2-user) gid=1000(ec2-user) groups=1000(ec2-user),4(adm),10(wheel),190(systemd-journal),993(docker) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 $ date Sun Mar 12 05:54:44 AM UTC 2023 $ echo $LANG en_US.UTF-8 $ echo $PATH /home/ec2-user/.local/bin:/home/ec2-user/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin $ getenforce Permissive $ ll /etc/yum.repos.d/ total 4 -rw-r--r--. 1 root root 968 Oct 27 20:08 amazonlinux.repo
↑SELinuxはPermissiveとなっていることを確認
インスタンスの初期設定(SELinux無効化)
# vi /etc/selinux/config # grubby --update-kernel ALL --args selinux=0 # reboot
# This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - No SELinux policy is loaded. # See also: # https://docs.fedoraproject.org/en-US/quick-docs/getting-started-with-selinux/#getting-started-with-selinux-selinux-states-and-modes # # NOTE: In earlier Fedora kernel builds, SELINUX=disabled would also # fully disable SELinux during boot. If you need a system with SELinux # fully disabled instead of SELinux running with no policy loaded, you # need to pass selinux=0 to the kernel command line. You can use grubby # to persistently set the bootloader to boot with selinux=0: # # grubby --update-kernel ALL --args selinux=0 # # To revert back to SELinux enabled: # # grubby --update-kernel ALL --remove-args selinux # -SELINUX=permissive +SELINUX=disabled # SELINUXTYPE= can take one of these three values: # targeted - Targeted processes are protected, # minimum - Modification of targeted policy. Only selected processes are protected. # mls - Multi Level Security protection. SELINUXTYPE=targeted
# getenforce Disabled
↑再起動後SELinuxが無効化されてることを確認
インスタンスの初期設定(UTC→JST)
# date Sun Mar 12 05:59:58 AM UTC 2023 # ln -sf /usr/share/zoneinfo/Asia/Tokyo /etc/localtime # date Sun Mar 12 03:00:17 PM JST 2023
インスタンスの初期設定(パッケージ更新)
# dnf update Last metadata expiration check: 0:09:41 ago on Sun 12 Mar 2023 02:50:48 PM JST. ================================================================================================================================================================================== WARNING: A newer release of "Amazon Linux" is available. Available Versions: Version 2022.0.20230118: Run the following command to upgrade to 2022.0.20230118: dnf upgrade --releasever=2022.0.20230118 Release notes: https://docs.aws.amazon.com/linux/al2022/release-notes/relnotes.html ================================================================================================================================================================================== Dependencies resolved. ================================================================================================================================================================================== Package Architecture Version Repository Size ================================================================================================================================================================================== Upgrading: containerd aarch64 1.6.8-1.amzn2022.0.1 amazonlinux 21 M Transaction Summary ================================================================================================================================================================================== Upgrade 1 Package Total download size: 21 M Is this ok [y/N]: y Downloading Packages: containerd-1.6.8-1.amzn2022.0.1.aarch64.rpm 50 MB/s | 21 MB 00:00 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Total 40 MB/s | 21 MB 00:00 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Upgrading : containerd-1.6.8-1.amzn2022.0.1.aarch64 1/2 Running scriptlet: containerd-1.6.8-1.amzn2022.0.1.aarch64 1/2 Running scriptlet: containerd-1.6.6-1.amzn2022.0.3.aarch64 2/2 Cleanup : containerd-1.6.6-1.amzn2022.0.3.aarch64 2/2 Running scriptlet: containerd-1.6.6-1.amzn2022.0.3.aarch64 2/2 Verifying : containerd-1.6.8-1.amzn2022.0.1.aarch64 1/2 Verifying : containerd-1.6.6-1.amzn2022.0.3.aarch64 2/2 ================================================================================================================================================================================== WARNING: A newer release of "Amazon Linux" is available. Available Versions: Version 2022.0.20230118: Run the following command to upgrade to 2022.0.20230118: dnf upgrade --releasever=2022.0.20230118 Release notes: https://docs.aws.amazon.com/linux/al2022/release-notes/relnotes.html ================================================================================================================================================================================== Upgraded: containerd-1.6.8-1.amzn2022.0.1.aarch64 Complete!
x86のころと異なりcontainerdというパッケージが更新されました。
Java11をインストール
# dnf search Corretto Last metadata expiration check: 0:10:53 ago on Sun 12 Mar 2023 02:50:48 PM JST. ======================================================================== Name & Summary Matched: Corretto ======================================================================== java-1.8.0-amazon-corretto.aarch64 : Amazon Corretto runtime environment java-1.8.0-amazon-corretto-devel.aarch64 : Amazon Corretto development environment java-11-amazon-corretto.aarch64 : Amazon Corretto development environment java-11-amazon-corretto-devel.aarch64 : Amazon Corretto 11 development tools java-11-amazon-corretto-headless.aarch64 : Amazon Corretto headless development environment java-11-amazon-corretto-javadoc.aarch64 : Amazon Corretto 11 API documentation java-11-amazon-corretto-jmods.aarch64 : Amazon Corretto 11 jmods java-17-amazon-corretto.aarch64 : Amazon Corretto development environment java-17-amazon-corretto-devel.aarch64 : Amazon Corretto 17 development tools java-17-amazon-corretto-headless.aarch64 : Amazon Corretto headless development environment java-17-amazon-corretto-javadoc.aarch64 : Amazon Corretto 17 API documentation java-17-amazon-corretto-jmods.aarch64 : Amazon Corretto 17 jmods maven-amazon-corretto11.noarch : Amazon Corretto 11 binding for Maven maven-amazon-corretto17.noarch : Amazon Corretto 17 binding for Maven maven-amazon-corretto8.noarch : Amazon Corretto 8 binding for Maven maven-local-amazon-corretto11.noarch : Amazon Corretto 11 toolchain for XMvn maven-local-amazon-corretto17.noarch : Amazon Corretto 17 toolchain for XMvn maven-local-amazon-corretto8.noarch : Amazon Corretto 8 toolchain for XMvn # dnf search openjdk Last metadata expiration check: 0:10:59 ago on Sun 12 Mar 2023 02:50:48 PM JST. No matches found.
↑x86の頃と異なり、openjdkのパッケージが存在せず代わりにAmazon Correttoがインストール可能であることを確認
# dnf install java-11-amazon-corretto-devel Last metadata expiration check: 0:12:38 ago on Sun 12 Mar 2023 02:50:48 PM JST. Dependencies resolved. ================================================================================================================================================================================== Package Architecture Version Repository Size ================================================================================================================================================================================== Installing: java-11-amazon-corretto-devel aarch64 1:11.0.17+8-1.amzn2022 amazonlinux 221 k Installing dependencies: alsa-lib aarch64 1.2.7.2-1.amzn2022.0.1 amazonlinux 492 k chkconfig aarch64 1.15-2.amzn2022.0.1 amazonlinux 162 k dejavu-sans-fonts noarch 2.37-16.amzn2022.0.1 amazonlinux 1.3 M dejavu-sans-mono-fonts noarch 2.37-16.amzn2022.0.1 amazonlinux 467 k dejavu-serif-fonts noarch 2.37-16.amzn2022.0.1 amazonlinux 1.0 M fontconfig aarch64 2.13.94-2.amzn2022.0.1 amazonlinux 277 k fonts-filesystem noarch 1:2.0.5-5.amzn2022.0.1 amazonlinux 8.7 k freetype aarch64 2.11.0-6.amzn2022.0.1 amazonlinux 403 k google-noto-fonts-common noarch 20201206-2.amzn2022 amazonlinux 16 k google-noto-sans-vf-fonts noarch 20201206-2.amzn2022 amazonlinux 493 k graphite2 aarch64 1.3.14-7.amzn2022.0.1 amazonlinux 93 k harfbuzz aarch64 2.9.1-1.amzn2022.0.2 amazonlinux 681 k java-11-amazon-corretto-headless aarch64 1:11.0.17+8-1.amzn2022 amazonlinux 90 M javapackages-filesystem noarch 6.0.0-7.amzn2022.0.4 amazonlinux 13 k langpacks-core-font-en noarch 3.0-21.amzn2022.0.1 amazonlinux 11 k libbrotli aarch64 1.0.9-4.amzn2022.0.1 amazonlinux 314 k libjpeg-turbo aarch64 2.0.90-3.amzn2022.0.1 amazonlinux 189 k libpng aarch64 2:1.6.37-10.amzn2022.0.1 amazonlinux 121 k xml-common noarch 0.6.3-56.amzn2022.0.1 amazonlinux 32 k Transaction Summary ================================================================================================================================================================================== Install 20 Packages Total download size: 96 M Installed size: 247 M Is this ok [y/N]: y Downloading Packages: (1/20): javapackages-filesystem-6.0.0-7.amzn2022.0.4.noarch.rpm 80 kB/s | 13 kB 00:00 (2/20): dejavu-sans-mono-fonts-2.37-16.amzn2022.0.1.noarch.rpm 2.7 MB/s | 467 kB 00:00 (3/20): google-noto-fonts-common-20201206-2.amzn2022.noarch.rpm 325 kB/s | 16 kB 00:00 (4/20): dejavu-serif-fonts-2.37-16.amzn2022.0.1.noarch.rpm 4.8 MB/s | 1.0 MB 00:00 (5/20): xml-common-0.6.3-56.amzn2022.0.1.noarch.rpm 629 kB/s | 32 kB 00:00 (6/20): langpacks-core-font-en-3.0-21.amzn2022.0.1.noarch.rpm 336 kB/s | 11 kB 00:00 (7/20): fonts-filesystem-2.0.5-5.amzn2022.0.1.noarch.rpm 184 kB/s | 8.7 kB 00:00 (8/20): google-noto-sans-vf-fonts-20201206-2.amzn2022.noarch.rpm 9.1 MB/s | 493 kB 00:00 (9/20): dejavu-sans-fonts-2.37-16.amzn2022.0.1.noarch.rpm 15 MB/s | 1.3 MB 00:00 (10/20): graphite2-1.3.14-7.amzn2022.0.1.aarch64.rpm 1.3 MB/s | 93 kB 00:00 (11/20): freetype-2.11.0-6.amzn2022.0.1.aarch64.rpm 5.2 MB/s | 403 kB 00:00 (12/20): alsa-lib-1.2.7.2-1.amzn2022.0.1.aarch64.rpm 5.3 MB/s | 492 kB 00:00 (13/20): java-11-amazon-corretto-devel-11.0.17+8-1.amzn2022.aarch64.rpm 3.8 MB/s | 221 kB 00:00 (14/20): libbrotli-1.0.9-4.amzn2022.0.1.aarch64.rpm 3.7 MB/s | 314 kB 00:00 (15/20): chkconfig-1.15-2.amzn2022.0.1.aarch64.rpm 2.2 MB/s | 162 kB 00:00 (16/20): libpng-1.6.37-10.amzn2022.0.1.aarch64.rpm 2.1 MB/s | 121 kB 00:00 (17/20): fontconfig-2.13.94-2.amzn2022.0.1.aarch64.rpm 3.4 MB/s | 277 kB 00:00 (18/20): harfbuzz-2.9.1-1.amzn2022.0.2.aarch64.rpm 8.6 MB/s | 681 kB 00:00 (19/20): libjpeg-turbo-2.0.90-3.amzn2022.0.1.aarch64.rpm 3.2 MB/s | 189 kB 00:00 (20/20): java-11-amazon-corretto-headless-11.0.17+8-1.amzn2022.aarch64.rpm 71 MB/s | 90 MB 00:01 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Total 59 MB/s | 96 MB 00:01 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : fonts-filesystem-1:2.0.5-5.amzn2022.0.1.noarch 1/20 Installing : dejavu-sans-mono-fonts-2.37-16.amzn2022.0.1.noarch 2/20 Installing : dejavu-sans-fonts-2.37-16.amzn2022.0.1.noarch 3/20 Installing : dejavu-serif-fonts-2.37-16.amzn2022.0.1.noarch 4/20 Installing : libjpeg-turbo-2.0.90-3.amzn2022.0.1.aarch64 5/20 Installing : libpng-2:1.6.37-10.amzn2022.0.1.aarch64 6/20 Installing : chkconfig-1.15-2.amzn2022.0.1.aarch64 7/20 Installing : libbrotli-1.0.9-4.amzn2022.0.1.aarch64 8/20 Installing : alsa-lib-1.2.7.2-1.amzn2022.0.1.aarch64 9/20 Installing : graphite2-1.3.14-7.amzn2022.0.1.aarch64 10/20 Installing : freetype-2.11.0-6.amzn2022.0.1.aarch64 11/20 Installing : harfbuzz-2.9.1-1.amzn2022.0.2.aarch64 12/20 Running scriptlet: xml-common-0.6.3-56.amzn2022.0.1.noarch 13/20 Installing : xml-common-0.6.3-56.amzn2022.0.1.noarch 13/20 Installing : google-noto-fonts-common-20201206-2.amzn2022.noarch 14/20 Installing : google-noto-sans-vf-fonts-20201206-2.amzn2022.noarch 15/20 Installing : langpacks-core-font-en-3.0-21.amzn2022.0.1.noarch 16/20 Installing : fontconfig-2.13.94-2.amzn2022.0.1.aarch64 17/20 Running scriptlet: fontconfig-2.13.94-2.amzn2022.0.1.aarch64 17/20 Installing : javapackages-filesystem-6.0.0-7.amzn2022.0.4.noarch 18/20 Installing : java-11-amazon-corretto-headless-1:11.0.17+8-1.amzn2022.aarch64 19/20 Running scriptlet: java-11-amazon-corretto-headless-1:11.0.17+8-1.amzn2022.aarch64 19/20 Installing : java-11-amazon-corretto-devel-1:11.0.17+8-1.amzn2022.aarch64 20/20 Running scriptlet: java-11-amazon-corretto-devel-1:11.0.17+8-1.amzn2022.aarch64 20/20 Running scriptlet: fontconfig-2.13.94-2.amzn2022.0.1.aarch64 20/20 Running scriptlet: java-11-amazon-corretto-devel-1:11.0.17+8-1.amzn2022.aarch64 20/20 Verifying : javapackages-filesystem-6.0.0-7.amzn2022.0.4.noarch 1/20 Verifying : dejavu-serif-fonts-2.37-16.amzn2022.0.1.noarch 2/20 Verifying : dejavu-sans-mono-fonts-2.37-16.amzn2022.0.1.noarch 3/20 Verifying : google-noto-fonts-common-20201206-2.amzn2022.noarch 4/20 Verifying : xml-common-0.6.3-56.amzn2022.0.1.noarch 5/20 Verifying : langpacks-core-font-en-3.0-21.amzn2022.0.1.noarch 6/20 Verifying : fonts-filesystem-1:2.0.5-5.amzn2022.0.1.noarch 7/20 Verifying : google-noto-sans-vf-fonts-20201206-2.amzn2022.noarch 8/20 Verifying : dejavu-sans-fonts-2.37-16.amzn2022.0.1.noarch 9/20 Verifying : graphite2-1.3.14-7.amzn2022.0.1.aarch64 10/20 Verifying : java-11-amazon-corretto-headless-1:11.0.17+8-1.amzn2022.aarch64 11/20 Verifying : alsa-lib-1.2.7.2-1.amzn2022.0.1.aarch64 12/20 Verifying : freetype-2.11.0-6.amzn2022.0.1.aarch64 13/20 Verifying : java-11-amazon-corretto-devel-1:11.0.17+8-1.amzn2022.aarch64 14/20 Verifying : libbrotli-1.0.9-4.amzn2022.0.1.aarch64 15/20 Verifying : chkconfig-1.15-2.amzn2022.0.1.aarch64 16/20 Verifying : libpng-2:1.6.37-10.amzn2022.0.1.aarch64 17/20 Verifying : fontconfig-2.13.94-2.amzn2022.0.1.aarch64 18/20 Verifying : harfbuzz-2.9.1-1.amzn2022.0.2.aarch64 19/20 Verifying : libjpeg-turbo-2.0.90-3.amzn2022.0.1.aarch64 20/20 ================================================================================================================================================================================== WARNING: A newer release of "Amazon Linux" is available. Available Versions: Version 2022.0.20230118: Run the following command to upgrade to 2022.0.20230118: dnf upgrade --releasever=2022.0.20230118 Release notes: https://docs.aws.amazon.com/linux/al2022/release-notes/relnotes.html ================================================================================================================================================================================== Installed: alsa-lib-1.2.7.2-1.amzn2022.0.1.aarch64 chkconfig-1.15-2.amzn2022.0.1.aarch64 dejavu-sans-fonts-2.37-16.amzn2022.0.1.noarch dejavu-sans-mono-fonts-2.37-16.amzn2022.0.1.noarch dejavu-serif-fonts-2.37-16.amzn2022.0.1.noarch fontconfig-2.13.94-2.amzn2022.0.1.aarch64 fonts-filesystem-1:2.0.5-5.amzn2022.0.1.noarch freetype-2.11.0-6.amzn2022.0.1.aarch64 google-noto-fonts-common-20201206-2.amzn2022.noarch google-noto-sans-vf-fonts-20201206-2.amzn2022.noarch graphite2-1.3.14-7.amzn2022.0.1.aarch64 harfbuzz-2.9.1-1.amzn2022.0.2.aarch64 java-11-amazon-corretto-devel-1:11.0.17+8-1.amzn2022.aarch64 java-11-amazon-corretto-headless-1:11.0.17+8-1.amzn2022.aarch64 javapackages-filesystem-6.0.0-7.amzn2022.0.4.noarch langpacks-core-font-en-3.0-21.amzn2022.0.1.noarch libbrotli-1.0.9-4.amzn2022.0.1.aarch64 libjpeg-turbo-2.0.90-3.amzn2022.0.1.aarch64 libpng-2:1.6.37-10.amzn2022.0.1.aarch64 xml-common-0.6.3-56.amzn2022.0.1.noarch Complete!
↑Amazon Corretto 11をインストール
# java -version openjdk version "11.0.17" 2022-10-18 LTS OpenJDK Runtime Environment Corretto-11.0.17.8.1 (build 11.0.17+8-LTS) OpenJDK 64-Bit Server VM Corretto-11.0.17.8.1 (build 11.0.17+8-LTS, mixed mode)
httpdをインストール
Tomcatへのajpによるリクエスト転送を行うためにhttpdをインストール
# dnf install httpd Last metadata expiration check: 0:14:14 ago on Sun 12 Mar 2023 02:50:48 PM JST. Dependencies resolved. ================================================================================================================================================================================== Package Architecture Version Repository Size ================================================================================================================================================================================== Installing: httpd aarch64 2.4.54-3.amzn2022.0.3 amazonlinux 47 k Installing dependencies: apr aarch64 1.7.0-9.amzn2022.0.1 amazonlinux 117 k apr-util aarch64 1.6.1-16.amzn2022.0.1 amazonlinux 99 k generic-logos-httpd noarch 18.0.0-12.amzn2022.0.2 amazonlinux 19 k httpd-core aarch64 2.4.54-3.amzn2022.0.3 amazonlinux 1.3 M httpd-filesystem noarch 2.4.54-3.amzn2022.0.3 amazonlinux 13 k httpd-tools aarch64 2.4.54-3.amzn2022.0.3 amazonlinux 81 k mailcap noarch 2.1.49-3.amzn2022.0.2 amazonlinux 33 k Installing weak dependencies: apr-util-bdb aarch64 1.6.1-16.amzn2022.0.1 amazonlinux 14 k apr-util-openssl aarch64 1.6.1-16.amzn2022.0.1 amazonlinux 16 k mod_http2 aarch64 1.15.24-1.amzn2022.0.2 amazonlinux 148 k mod_lua aarch64 2.4.54-3.amzn2022.0.3 amazonlinux 59 k Transaction Summary ================================================================================================================================================================================== Install 12 Packages Total download size: 2.0 M Installed size: 11 M Is this ok [y/N]: y Downloading Packages: (1/12): mailcap-2.1.49-3.amzn2022.0.2.noarch.rpm 275 kB/s | 33 kB 00:00 (2/12): httpd-filesystem-2.4.54-3.amzn2022.0.3.noarch.rpm 96 kB/s | 13 kB 00:00 (3/12): generic-logos-httpd-18.0.0-12.amzn2022.0.2.noarch.rpm 112 kB/s | 19 kB 00:00 (4/12): httpd-tools-2.4.54-3.amzn2022.0.3.aarch64.rpm 905 kB/s | 81 kB 00:00 (5/12): mod_lua-2.4.54-3.amzn2022.0.3.aarch64.rpm 1.2 MB/s | 59 kB 00:00 (6/12): httpd-core-2.4.54-3.amzn2022.0.3.aarch64.rpm 15 MB/s | 1.3 MB 00:00 (7/12): httpd-2.4.54-3.amzn2022.0.3.aarch64.rpm 1.1 MB/s | 47 kB 00:00 (8/12): apr-util-bdb-1.6.1-16.amzn2022.0.1.aarch64.rpm 270 kB/s | 14 kB 00:00 (9/12): apr-1.7.0-9.amzn2022.0.1.aarch64.rpm 1.5 MB/s | 117 kB 00:00 (10/12): apr-util-1.6.1-16.amzn2022.0.1.aarch64.rpm 1.8 MB/s | 99 kB 00:00 (11/12): apr-util-openssl-1.6.1-16.amzn2022.0.1.aarch64.rpm 391 kB/s | 16 kB 00:00 (12/12): mod_http2-1.15.24-1.amzn2022.0.2.aarch64.rpm 2.6 MB/s | 148 kB 00:00 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Total 4.9 MB/s | 2.0 MB 00:00 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : apr-1.7.0-9.amzn2022.0.1.aarch64 1/12 Installing : apr-util-bdb-1.6.1-16.amzn2022.0.1.aarch64 2/12 Installing : apr-util-openssl-1.6.1-16.amzn2022.0.1.aarch64 3/12 Installing : apr-util-1.6.1-16.amzn2022.0.1.aarch64 4/12 Installing : mailcap-2.1.49-3.amzn2022.0.2.noarch 5/12 Installing : httpd-tools-2.4.54-3.amzn2022.0.3.aarch64 6/12 Running scriptlet: httpd-filesystem-2.4.54-3.amzn2022.0.3.noarch 7/12 Installing : httpd-filesystem-2.4.54-3.amzn2022.0.3.noarch 7/12 Installing : httpd-core-2.4.54-3.amzn2022.0.3.aarch64 8/12 Installing : mod_http2-1.15.24-1.amzn2022.0.2.aarch64 9/12 Installing : generic-logos-httpd-18.0.0-12.amzn2022.0.2.noarch 10/12 Installing : mod_lua-2.4.54-3.amzn2022.0.3.aarch64 11/12 Installing : httpd-2.4.54-3.amzn2022.0.3.aarch64 12/12 Running scriptlet: httpd-2.4.54-3.amzn2022.0.3.aarch64 12/12 Verifying : generic-logos-httpd-18.0.0-12.amzn2022.0.2.noarch 1/12 Verifying : mailcap-2.1.49-3.amzn2022.0.2.noarch 2/12 Verifying : httpd-filesystem-2.4.54-3.amzn2022.0.3.noarch 3/12 Verifying : httpd-tools-2.4.54-3.amzn2022.0.3.aarch64 4/12 Verifying : httpd-core-2.4.54-3.amzn2022.0.3.aarch64 5/12 Verifying : mod_lua-2.4.54-3.amzn2022.0.3.aarch64 6/12 Verifying : apr-1.7.0-9.amzn2022.0.1.aarch64 7/12 Verifying : httpd-2.4.54-3.amzn2022.0.3.aarch64 8/12 Verifying : apr-util-bdb-1.6.1-16.amzn2022.0.1.aarch64 9/12 Verifying : apr-util-1.6.1-16.amzn2022.0.1.aarch64 10/12 Verifying : apr-util-openssl-1.6.1-16.amzn2022.0.1.aarch64 11/12 Verifying : mod_http2-1.15.24-1.amzn2022.0.2.aarch64 12/12 ================================================================================================================================================================================== WARNING: A newer release of "Amazon Linux" is available. Available Versions: Version 2022.0.20230118: Run the following command to upgrade to 2022.0.20230118: dnf upgrade --releasever=2022.0.20230118 Release notes: https://docs.aws.amazon.com/linux/al2022/release-notes/relnotes.html ================================================================================================================================================================================== Installed: apr-1.7.0-9.amzn2022.0.1.aarch64 apr-util-1.6.1-16.amzn2022.0.1.aarch64 apr-util-bdb-1.6.1-16.amzn2022.0.1.aarch64 apr-util-openssl-1.6.1-16.amzn2022.0.1.aarch64 generic-logos-httpd-18.0.0-12.amzn2022.0.2.noarch httpd-2.4.54-3.amzn2022.0.3.aarch64 httpd-core-2.4.54-3.amzn2022.0.3.aarch64 httpd-filesystem-2.4.54-3.amzn2022.0.3.noarch httpd-tools-2.4.54-3.amzn2022.0.3.aarch64 mailcap-2.1.49-3.amzn2022.0.2.noarch mod_http2-1.15.24-1.amzn2022.0.2.aarch64 mod_lua-2.4.54-3.amzn2022.0.3.aarch64 Complete!
↑2.4系がインストールできる
# httpd -v Server version: Apache/2.4.54 (Amazon Linux) Server built: Oct 4 2022 00:00:00 # systemctl is-enabled httpd disabled # systemctl enable httpd Created symlink /etc/systemd/system/multi-user.target.wants/httpd.service → /usr/lib/systemd/system/httpd.service. # systemctl start httpd
↑バージョン確認、自動起動設定、いったん起動
↑ブラウザでパブリックIPにアクセスして「It works!」の表示を確認
Tomcat9をインストール
# dnf list | grep tomcat tomcat-taglibs-parent.noarch 3-18.amzn2022 amazonlinux tomcat9.noarch 1:9.0.64-1.amzn2022.0.1 amazonlinux tomcat9-admin-webapps.noarch 1:9.0.64-1.amzn2022.0.1 amazonlinux tomcat9-docs-webapp.noarch 1:9.0.64-1.amzn2022.0.1 amazonlinux tomcat9-el-3.0-api.noarch 1:9.0.64-1.amzn2022.0.1 amazonlinux tomcat9-jsp-2.3-api.noarch 1:9.0.64-1.amzn2022.0.1 amazonlinux tomcat9-lib.noarch 1:9.0.64-1.amzn2022.0.1 amazonlinux tomcat9-servlet-4.0-api.noarch 1:9.0.64-1.amzn2022.0.1 amazonlinux tomcat9-webapps.noarch 1:9.0.64-1.amzn2022.0.1 amazonlinux
↑x86の頃と同様でTomcat9がインストール可能ですが、パッケージ名がtomcatではなくtomcat9となっていることを確認
# dnf install tomcat9 tomcat9-webapps Last metadata expiration check: 0:17:32 ago on Sun 12 Mar 2023 02:50:48 PM JST. Dependencies resolved. ================================================================================================================================================================================== Package Architecture Version Repository Size ================================================================================================================================================================================== Installing: tomcat9 noarch 1:9.0.64-1.amzn2022.0.1 amazonlinux 92 k tomcat9-webapps noarch 1:9.0.64-1.amzn2022.0.1 amazonlinux 82 k Installing dependencies: ecj noarch 1:4.23-1.amzn2022.0.2 amazonlinux 2.4 M java-17-amazon-corretto-headless aarch64 1:17.0.5+8-1.amzn2022.1 amazonlinux 90 M javapackages-tools noarch 6.0.0-7.amzn2022.0.4 amazonlinux 26 k tomcat9-el-3.0-api noarch 1:9.0.64-1.amzn2022.0.1 amazonlinux 107 k tomcat9-jsp-2.3-api noarch 1:9.0.64-1.amzn2022.0.1 amazonlinux 66 k tomcat9-lib noarch 1:9.0.64-1.amzn2022.0.1 amazonlinux 5.9 M tomcat9-servlet-4.0-api noarch 1:9.0.64-1.amzn2022.0.1 amazonlinux 285 k Transaction Summary ================================================================================================================================================================================== Install 9 Packages Total download size: 99 M Installed size: 246 M Is this ok [y/N]: y Downloading Packages: (1/9): tomcat9-jsp-2.3-api-9.0.64-1.amzn2022.0.1.noarch.rpm 474 kB/s | 66 kB 00:00 (2/9): tomcat9-webapps-9.0.64-1.amzn2022.0.1.noarch.rpm 497 kB/s | 82 kB 00:00 (3/9): tomcat9-el-3.0-api-9.0.64-1.amzn2022.0.1.noarch.rpm 631 kB/s | 107 kB 00:00 (4/9): tomcat9-servlet-4.0-api-9.0.64-1.amzn2022.0.1.noarch.rpm 5.1 MB/s | 285 kB 00:00 (5/9): tomcat9-9.0.64-1.amzn2022.0.1.noarch.rpm 869 kB/s | 92 kB 00:00 (6/9): javapackages-tools-6.0.0-7.amzn2022.0.4.noarch.rpm 693 kB/s | 26 kB 00:00 (7/9): ecj-4.23-1.amzn2022.0.2.noarch.rpm 17 MB/s | 2.4 MB 00:00 (8/9): tomcat9-lib-9.0.64-1.amzn2022.0.1.noarch.rpm 23 MB/s | 5.9 MB 00:00 (9/9): java-17-amazon-corretto-headless-17.0.5+8-1.amzn2022.1.aarch64.rpm 76 MB/s | 90 MB 00:01 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Total 62 MB/s | 99 MB 00:01 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : java-17-amazon-corretto-headless-1:17.0.5+8-1.amzn2022.1.aarch64 1/9 Running scriptlet: java-17-amazon-corretto-headless-1:17.0.5+8-1.amzn2022.1.aarch64 1/9 Installing : tomcat9-el-3.0-api-1:9.0.64-1.amzn2022.0.1.noarch 2/9 Running scriptlet: tomcat9-el-3.0-api-1:9.0.64-1.amzn2022.0.1.noarch 2/9 Installing : tomcat9-servlet-4.0-api-1:9.0.64-1.amzn2022.0.1.noarch 3/9 Running scriptlet: tomcat9-servlet-4.0-api-1:9.0.64-1.amzn2022.0.1.noarch 3/9 Installing : tomcat9-jsp-2.3-api-1:9.0.64-1.amzn2022.0.1.noarch 4/9 Running scriptlet: tomcat9-jsp-2.3-api-1:9.0.64-1.amzn2022.0.1.noarch 4/9 Installing : ecj-1:4.23-1.amzn2022.0.2.noarch 5/9 Installing : tomcat9-lib-1:9.0.64-1.amzn2022.0.1.noarch 6/9 Installing : javapackages-tools-6.0.0-7.amzn2022.0.4.noarch 7/9 Running scriptlet: tomcat9-1:9.0.64-1.amzn2022.0.1.noarch 8/9 Installing : tomcat9-1:9.0.64-1.amzn2022.0.1.noarch 8/9 Running scriptlet: tomcat9-1:9.0.64-1.amzn2022.0.1.noarch 8/9 Installing : tomcat9-webapps-1:9.0.64-1.amzn2022.0.1.noarch 9/9 Running scriptlet: tomcat9-webapps-1:9.0.64-1.amzn2022.0.1.noarch 9/9 Verifying : tomcat9-webapps-1:9.0.64-1.amzn2022.0.1.noarch 1/9 Verifying : tomcat9-el-3.0-api-1:9.0.64-1.amzn2022.0.1.noarch 2/9 Verifying : tomcat9-jsp-2.3-api-1:9.0.64-1.amzn2022.0.1.noarch 3/9 Verifying : tomcat9-lib-1:9.0.64-1.amzn2022.0.1.noarch 4/9 Verifying : tomcat9-servlet-4.0-api-1:9.0.64-1.amzn2022.0.1.noarch 5/9 Verifying : tomcat9-1:9.0.64-1.amzn2022.0.1.noarch 6/9 Verifying : ecj-1:4.23-1.amzn2022.0.2.noarch 7/9 Verifying : javapackages-tools-6.0.0-7.amzn2022.0.4.noarch 8/9 Verifying : java-17-amazon-corretto-headless-1:17.0.5+8-1.amzn2022.1.aarch64 9/9 ================================================================================================================================================================================== WARNING: A newer release of "Amazon Linux" is available. Available Versions: Version 2022.0.20230118: Run the following command to upgrade to 2022.0.20230118: dnf upgrade --releasever=2022.0.20230118 Release notes: https://docs.aws.amazon.com/linux/al2022/release-notes/relnotes.html ================================================================================================================================================================================== Installed: ecj-1:4.23-1.amzn2022.0.2.noarch java-17-amazon-corretto-headless-1:17.0.5+8-1.amzn2022.1.aarch64 javapackages-tools-6.0.0-7.amzn2022.0.4.noarch tomcat9-1:9.0.64-1.amzn2022.0.1.noarch tomcat9-el-3.0-api-1:9.0.64-1.amzn2022.0.1.noarch tomcat9-jsp-2.3-api-1:9.0.64-1.amzn2022.0.1.noarch tomcat9-lib-1:9.0.64-1.amzn2022.0.1.noarch tomcat9-servlet-4.0-api-1:9.0.64-1.amzn2022.0.1.noarch tomcat9-webapps-1:9.0.64-1.amzn2022.0.1.noarch Complete!
↑tomcat9とtomcat9-webappsをインストール(tomcat9-webappsは動作確認用にインストールしています。本番では不要)
※ArmのAL2022ではパッケージマネージャから標準のtomcat9をインストールしようとするとjava-17-amazon-corretto-headlessが依存関係によりインストールされてしまいました。これによってjavaのバージョンが11から17に書き換わってしまいました(とりあえず続行)。。
# java -version openjdk version "17.0.5" 2022-10-18 LTS OpenJDK Runtime Environment Corretto-17.0.5.8.1 (build 17.0.5+8-LTS) OpenJDK 64-Bit Server VM Corretto-17.0.5.8.1 (build 17.0.5+8-LTS, mixed mode, sharing) # which java /usr/bin/java # ll /usr/bin/java lrwxrwxrwx 1 root root 22 Mar 12 15:03 /usr/bin/java -> /etc/alternatives/java # ll /etc/alternatives/java lrwxrwxrwx 1 root root 53 Mar 12 15:08 /etc/alternatives/java -> /usr/lib/jvm/java-17-amazon-corretto.aarch64/bin/java
↑javaのバージョンが書き換わってしまったことについて確認。
# tomcat9 version /usr/sbin/tomcat9: line 4: /usr/libexec/tomcat/preamble: No such file or directory /usr/sbin/tomcat9: line 5: /lib/catalina.jar: No such file or directory
↑tomcat versionより各種バージョン情報を確認しようとしたらエラーが出てしまいました(いったん無視)
# vi /etc/tomcat9/server.xml
<?xml version="1.0" encoding="UTF-8"?> <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <!-- Note: A "Server" is not itself a "Container", so you may not define subcomponents such as "Valves" at this level. Documentation at /docs/config/server.html --> <Server port="8005" shutdown="SHUTDOWN"> <Listener className="org.apache.catalina.startup.VersionLoggerListener" /> <!-- Security listener. Documentation at /docs/config/listeners.html <Listener className="org.apache.catalina.security.SecurityListener" /> --> <!-- APR library loader. Documentation at /docs/apr.html --> <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" /> <!-- Prevent memory leaks due to use of particular java/javax APIs--> <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" /> <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" /> <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" /> <!-- Global JNDI resources Documentation at /docs/jndi-resources-howto.html --> <GlobalNamingResources> <!-- Editable user database that can also be used by UserDatabaseRealm to authenticate users --> <Resource name="UserDatabase" auth="Container" type="org.apache.catalina.UserDatabase" description="User database that can be updated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory" pathname="conf/tomcat-users.xml" /> </GlobalNamingResources> <!-- A "Service" is a collection of one or more "Connectors" that share a single "Container" Note: A "Service" is not itself a "Container", so you may not define subcomponents such as "Valves" at this level. Documentation at /docs/config/service.html --> <Service name="Catalina"> <!--The connectors can use a shared executor, you can define one or more named thread pools--> <!-- <Executor name="tomcatThreadPool" namePrefix="catalina-exec-" maxThreads="150" minSpareThreads="4"/> --> <!-- A "Connector" represents an endpoint by which requests are received and responses are returned. Documentation at : Java HTTP Connector: /docs/config/http.html Java AJP Connector: /docs/config/ajp.html APR (HTTP/AJP) Connector: /docs/apr.html Define a non-SSL/TLS HTTP/1.1 Connector on port 8080 --> <Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" /> <!-- A "Connector" using the shared thread pool--> <!-- <Connector executor="tomcatThreadPool" port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" /> --> <!-- Define an SSL/TLS HTTP/1.1 Connector on port 8443 This connector uses the NIO implementation. The default SSLImplementation will depend on the presence of the APR/native library and the useOpenSSL attribute of the AprLifecycleListener. Either JSSE or OpenSSL style configuration may be used regardless of the SSLImplementation selected. JSSE style configuration is used below. --> <!-- <Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol" maxThreads="150" SSLEnabled="true"> <SSLHostConfig> <Certificate certificateKeystoreFile="conf/localhost-rsa.jks" type="RSA" /> </SSLHostConfig> </Connector> --> <!-- Define an SSL/TLS HTTP/1.1 Connector on port 8443 with HTTP/2 This connector uses the APR/native implementation which always uses OpenSSL for TLS. Either JSSE or OpenSSL style configuration may be used. OpenSSL style configuration is used below. --> <!-- <Connector port="8443" protocol="org.apache.coyote.http11.Http11AprProtocol" maxThreads="150" SSLEnabled="true" > <UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" /> <SSLHostConfig> <Certificate certificateKeyFile="conf/localhost-rsa-key.pem" certificateFile="conf/localhost-rsa-cert.pem" certificateChainFile="conf/localhost-rsa-chain.pem" type="RSA" /> </SSLHostConfig> </Connector> --> <!-- Define an AJP 1.3 Connector on port 8009 --> - <!-- <Connector protocol="AJP/1.3" - address="::1" port="8009" + secretRequired="false" + useBodyEncodingForURI="true" redirectPort="8443" /> - --> <!-- An Engine represents the entry point (within Catalina) that processes every request. The Engine implementation for Tomcat stand alone analyzes the HTTP headers included with the request, and passes them on to the appropriate Host (virtual host). Documentation at /docs/config/engine.html --> <!-- You should set jvmRoute to support load-balancing via AJP ie : <Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1"> --> <Engine name="Catalina" defaultHost="localhost"> <!--For clustering, please take a look at documentation at: /docs/cluster-howto.html (simple how to) /docs/config/cluster.html (reference documentation) --> <!-- <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/> --> <!-- Use the LockOutRealm to prevent attempts to guess user passwords via a brute-force attack --> <Realm className="org.apache.catalina.realm.LockOutRealm"> <!-- This Realm uses the UserDatabase configured in the global JNDI resources under the key "UserDatabase". Any edits that are performed against this UserDatabase are immediately available for use by the Realm. --> <Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/> </Realm> <Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true"> <!-- SingleSignOn valve, share authentication between web applications Documentation at: /docs/config/valve.html --> <!-- <Valve className="org.apache.catalina.authenticator.SingleSignOn" /> --> <!-- Access log processes all example. Documentation at: /docs/config/valve.html Note: The pattern used is equivalent to using pattern="common" --> <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="localhost_access_log" suffix=".txt" pattern="%h %l %u %t "%r" %s %b" /> </Host> </Engine> </Service> </Server>
↑コメントアウトされているajpのコネクタについて修正
# pwd /var/lib/tomcat9 # ll total 0 drwxrwxr-x 3 root tomcat 18 Mar 12 15:08 webapps # ll webapps/ total 0 drwxr-xr-x 3 tomcat tomcat 223 Mar 12 15:08 ROOT
↑AL2022(x86)においてパッケージマネージャからインストールしたtomcatのROOTディレクトリは/var/lib/tomcat9配下に存在する
# vi /etc/httpd/conf.d/httpd-ajp.conf # systemctl reload httpd
ProxyRequests Off ProxyPass / ajp://localhost:8009/ ProxyPassReverse / ajp://localhost:8009/
↑httpdのconf.dディレクトリに新規でajp連携のための設定ファイルを作成。
すべてのリクエストをlocalhostの8009番(tomcatが待ち受けてるポート)に向ける設定を行う。
設定作成後、httpdの設定についてリロード
# systemctl is-enabled tomcat9 disabled # systemctl enable tomcat9 Created symlink /etc/systemd/system/multi-user.target.wants/tomcat9.service → /usr/lib/systemd/system/tomcat9.service. # systemctl start tomcat9 # ps -ax | grep [t]omcat9 11607 ? Ssl 0:03 /usr/lib/jvm/jre/bin/java -Djavax.sql.DataSource.Factory=org.apache.commons.dbcp.BasicDataSourceFactory -classpath /usr/share/tomcat9/bin/bootstrap.jar:/usr/share/tomcat9/bin/tomcat-juli.jar: -Dcatalina.base=/usr/share/tomcat9 -Dcatalina.home=/usr/share/tomcat9 -Djava.endorsed.dirs= -Djava.io.tmpdir=/var/cache/tomcat9/temp -Djava.util.logging.config.file=/usr/share/tomcat9/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager org.apache.catalina.startup.Bootstrap start
↑tomcatについて自動起動設定を行い、起動
↑tomcat起動後、ブラウザでパブリックIPにアクセスしてTomcatのホーム画面が表示されることを確認。
MySQL8.0をインストール
- MySQLはamazonlinux.repo標準ではサポートされていないためMySQL Communityのリポジトリを追加する
- 追加するリポジトリはopensslのバージョンとの兼ね合いで変わるので注意が必要
- 2023年3月現在、ArmのAL2022にはopensslのバージョン3系(3.0.5)が入っているためRHEL9用のリポジトリを追加する必要がありそう
# dnf search mysql Last metadata expiration check: 0:03:13 ago on Sun 12 Mar 2023 03:19:22 PM JST. ========================================================================= Name & Summary Matched: mysql ========================================================================== apr-util-mysql.aarch64 : APR utility library MySQL DBD driver bind-dlz-mysql.aarch64 : BIND server mysql and mysqldyn DLZ modules mysql-selinux.noarch : SELinux policy modules for MySQL and MariaDB packages perl-DBD-MySQL.aarch64 : A MySQL interface for Perl perl-DateTime-Format-MySQL.noarch : Parse and format MySQL dates and times php8.1-mysqlnd.aarch64 : A module for PHP 8.1 applications that use MySQL databases postfix-mysql.aarch64 : Postfix MySQL map support ============================================================================= Summary Matched: mysql ============================================================================= mariadb105-devel.aarch64 : Files for development of MariaDB/MySQL applications mariadb105-server-utils.aarch64 : Non-essential server utilities for MariaDB/MySQL applications perl-DBD-MariaDB.aarch64 : MariaDB and MySQL driver for the Perl5 Database Interface (DBI)
↑リポジトリ追加前、標準でインストール可能なMySQL関連のパッケージ。
mariadb10.5のパッケージが存在する(サーバーではない)。
# dnf localinstall https://dev.mysql.com/get/mysql80-community-release-el9-1.noarch.rpm Last metadata expiration check: 0:03:38 ago on Sun 12 Mar 2023 03:19:22 PM JST. mysql80-community-release-el9-1.noarch.rpm 30 kB/s | 10 kB 00:00 Dependencies resolved. ================================================================================================================================================================================== Package Architecture Version Repository Size ================================================================================================================================================================================== Installing: mysql80-community-release noarch el9-1 @commandline 10 k Transaction Summary ================================================================================================================================================================================== Install 1 Package Total size: 10 k Installed size: 5.7 k Is this ok [y/N]: y Downloading Packages: Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : mysql80-community-release-el9-1.noarch 1/1 Verifying : mysql80-community-release-el9-1.noarch 1/1 ================================================================================================================================================================================== WARNING: A newer release of "Amazon Linux" is available. Available Versions: Version 2022.0.20230118: Run the following command to upgrade to 2022.0.20230118: dnf upgrade --releasever=2022.0.20230118 Release notes: https://docs.aws.amazon.com/linux/al2022/release-notes/relnotes.html ================================================================================================================================================================================== Installed: mysql80-community-release-el9-1.noarch Complete!
↑RHEL9用のリポジトリを追加
# ll /etc/yum.repos.d/ total 16 -rw-r--r--. 1 root root 968 Oct 28 05:08 amazonlinux.repo -rw-r--r-- 1 root root 951 Jul 6 2022 mysql-community-debuginfo.repo -rw-r--r-- 1 root root 827 Jul 6 2022 mysql-community.repo -rw-r--r-- 1 root root 871 Jul 6 2022 mysql-community-source.repo # cat /etc/yum.repos.d/mysql-community.repo [mysql80-community] name=MySQL 8.0 Community Server baseurl=http://repo.mysql.com/yum/mysql-8.0-community/el/9/$basearch/ enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022 [mysql-connectors-community] name=MySQL Connectors Community baseurl=http://repo.mysql.com/yum/mysql-connectors-community/el/9/$basearch/ enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022 [mysql-tools-community] name=MySQL Tools Community baseurl=http://repo.mysql.com/yum/mysql-tools-community/el/9/$basearch/ enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022 [mysql-cluster-8.0-community] name=MySQL Cluster 8.0 Community baseurl=http://repo.mysql.com/yum/mysql-cluster-8.0-community/el/9/$basearch/ enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022
↑mysql-communityについてデフォルトで有効化されてることを確認
# dnf search mysql MySQL 8.0 Community Server 15 MB/s | 626 kB 00:00 MySQL Connectors Community 493 kB/s | 14 kB 00:00 MySQL Tools Community 4.5 MB/s | 186 kB 00:00 ========================================================================= Name & Summary Matched: mysql ========================================================================== apr-util-mysql.aarch64 : APR utility library MySQL DBD driver bind-dlz-mysql.aarch64 : BIND server mysql and mysqldyn DLZ modules mysql-community-client.aarch64 : MySQL database client applications and tools mysql-community-client-plugins.aarch64 : Shared plugins for MySQL client applications mysql-community-common.aarch64 : MySQL database common files for server and client libs mysql-community-debugsource.aarch64 : Debug sources for package mysql-community mysql-community-devel.aarch64 : Development header files and libraries for MySQL database client applications mysql-community-icu-data-files.aarch64 : MySQL packaging of ICU data files mysql-community-libs.aarch64 : Shared libraries for MySQL database client applications mysql-community-server-debug.aarch64 : The debug version of MySQL server mysql-community-test.aarch64 : Test suite for the MySQL database server mysql-connector-c++.aarch64 : MySQL database connector for C++ mysql-connector-c++-debugsource.aarch64 : Debug sources for package mysql-connector-c++ mysql-connector-c++-devel.aarch64 : Development header files and libraries for MySQL C++ client applications mysql-connector-c++-jdbc.aarch64 : MySQL Driver for C++ which mimics the JDBC 4.0 API mysql-connector-j.noarch : Standardized MySQL database driver for Java mysql-connector-odbc.aarch64 : An ODBC 8.0 driver for MySQL - driver package mysql-connector-odbc-debugsource.aarch64 : Debug sources for package mysql-connector-odbc mysql-connector-odbc-setup.aarch64 : An ODBC 8.0 driver for MySQL - setup library mysql-connector-python3.aarch64 : Standardized MySQL database driver for Python 3 mysql-router-community.aarch64 : MySQL Router mysql-selinux.noarch : SELinux policy modules for MySQL and MariaDB packages mysql-shell.aarch64 : Command line shell and scripting environment for MySQL mysql-shell-debugsource.aarch64 : Debug sources for package mysql-shell mysql80-community-release.noarch : MySQL repository configuration for yum perl-DBD-MySQL.aarch64 : A MySQL interface for Perl perl-DateTime-Format-MySQL.noarch : Parse and format MySQL dates and times php8.1-mysqlnd.aarch64 : A module for PHP 8.1 applications that use MySQL databases postfix-mysql.aarch64 : Postfix MySQL map support ============================================================================== Name Matched: mysql =============================================================================== mysql-community-server.aarch64 : A very fast and reliable SQL database server ============================================================================= Summary Matched: mysql ============================================================================= mariadb105-devel.aarch64 : Files for development of MariaDB/MySQL applications mariadb105-server-utils.aarch64 : Non-essential server utilities for MariaDB/MySQL applications perl-DBD-MariaDB.aarch64 : MariaDB and MySQL driver for the Perl5 Database Interface (DBI)
↑リポジトリ追加前と比べてmysql-community-serverなどのパッケージが追加されたことを確認
# dnf install mysql-community-server Last metadata expiration check: 0:00:30 ago on Sun 12 Mar 2023 03:24:28 PM JST. Dependencies resolved. ================================================================================================================================================================================== Package Architecture Version Repository Size ================================================================================================================================================================================== Installing: mysql-community-server aarch64 8.0.32-1.el9 mysql80-community 48 M Installing dependencies: libaio aarch64 0.3.111-11.amzn2022.0.1 amazonlinux 25 k mysql-community-client aarch64 8.0.32-1.el9 mysql80-community 3.7 M mysql-community-client-plugins aarch64 8.0.32-1.el9 mysql80-community 1.3 M mysql-community-common aarch64 8.0.32-1.el9 mysql80-community 544 k mysql-community-icu-data-files aarch64 8.0.32-1.el9 mysql80-community 2.2 M mysql-community-libs aarch64 8.0.32-1.el9 mysql80-community 1.5 M perl-AutoLoader noarch 5.74-477.amzn2022.0.2 amazonlinux 23 k perl-B aarch64 1.80-477.amzn2022.0.2 amazonlinux 182 k perl-Carp noarch 1.50-458.amzn2022.0.1 amazonlinux 29 k perl-Class-Struct noarch 0.66-477.amzn2022.0.2 amazonlinux 24 k perl-Data-Dumper aarch64 2.174-460.amzn2022.0.1 amazonlinux 55 k perl-Digest noarch 1.20-1.amzn2022.0.1 amazonlinux 26 k perl-Digest-MD5 aarch64 2.58-2.amzn2022.0.1 amazonlinux 37 k perl-DynaLoader aarch64 1.47-477.amzn2022.0.2 amazonlinux 28 k perl-Encode aarch64 4:3.15-462.amzn2022.0.1 amazonlinux 1.7 M perl-Errno aarch64 1.30-477.amzn2022.0.2 amazonlinux 17 k perl-Exporter noarch 5.74-459.amzn2022.0.1 amazonlinux 32 k perl-Fcntl aarch64 1.13-477.amzn2022.0.2 amazonlinux 23 k perl-File-Basename noarch 2.85-477.amzn2022.0.2 amazonlinux 19 k perl-File-Path noarch 2.18-2.amzn2022.0.1 amazonlinux 36 k perl-File-Temp noarch 1:0.231.100-2.amzn2022.0.1 amazonlinux 60 k perl-File-stat noarch 1.09-477.amzn2022.0.2 amazonlinux 19 k perl-FileHandle noarch 2.03-477.amzn2022.0.2 amazonlinux 18 k perl-Getopt-Long noarch 1:2.52-2.amzn2022.0.1 amazonlinux 60 k perl-Getopt-Std noarch 1.12-477.amzn2022.0.2 amazonlinux 18 k perl-HTTP-Tiny noarch 0.078-1.amzn2022.0.1 amazonlinux 56 k perl-IO aarch64 1.43-477.amzn2022.0.2 amazonlinux 89 k perl-IPC-Open3 noarch 1.21-477.amzn2022.0.2 amazonlinux 25 k perl-MIME-Base64 aarch64 3.16-2.amzn2022.0.1 amazonlinux 31 k perl-Net-SSLeay aarch64 1.92-2.amzn2022.0.1 amazonlinux 368 k perl-POSIX aarch64 1.94-477.amzn2022.0.2 amazonlinux 99 k perl-PathTools aarch64 3.78-459.amzn2022.0.1 amazonlinux 85 k perl-Pod-Escapes noarch 1:1.07-458.amzn2022.0.1 amazonlinux 20 k perl-Pod-Perldoc noarch 3.28.01-459.amzn2022.0.1 amazonlinux 84 k perl-Pod-Simple noarch 1:3.42-2.amzn2022.0.1 amazonlinux 215 k perl-Pod-Usage noarch 4:2.01-2.amzn2022.0.1 amazonlinux 41 k perl-Scalar-List-Utils aarch64 4:1.56-459.amzn2022.0.1 amazonlinux 70 k perl-SelectSaver noarch 1.02-477.amzn2022.0.2 amazonlinux 14 k perl-Socket aarch64 4:2.032-1.amzn2022.0.1 amazonlinux 55 k perl-Storable aarch64 1:3.21-458.amzn2022.0.1 amazonlinux 94 k perl-Symbol noarch 1.08-477.amzn2022.0.2 amazonlinux 16 k perl-Term-ANSIColor noarch 5.01-459.amzn2022.0.1 amazonlinux 48 k perl-Term-Cap noarch 1.17-458.amzn2022.0.1 amazonlinux 22 k perl-Text-ParseWords noarch 3.30-458.amzn2022.0.1 amazonlinux 17 k perl-Text-Tabs+Wrap noarch 2021.0726-1.amzn2022 amazonlinux 23 k perl-Time-Local noarch 2:1.300-5.amzn2022.0.1 amazonlinux 34 k perl-URI noarch 5.09-1.amzn2022.0.1 amazonlinux 109 k perl-base noarch 2.27-477.amzn2022.0.2 amazonlinux 18 k perl-constant noarch 1.33-459.amzn2022.0.1 amazonlinux 23 k perl-if noarch 0.60.800-477.amzn2022.0.2 amazonlinux 16 k perl-interpreter aarch64 4:5.32.1-477.amzn2022.0.2 amazonlinux 73 k perl-libnet noarch 3.13-2.amzn2022.0.1 amazonlinux 126 k perl-libs aarch64 4:5.32.1-477.amzn2022.0.2 amazonlinux 2.0 M perl-mro aarch64 1.23-477.amzn2022.0.2 amazonlinux 30 k perl-overload noarch 1.31-477.amzn2022.0.2 amazonlinux 48 k perl-overloading noarch 0.02-477.amzn2022.0.2 amazonlinux 15 k perl-parent noarch 1:0.238-458.amzn2022.0.1 amazonlinux 15 k perl-podlators noarch 1:4.14-458.amzn2022.0.1 amazonlinux 112 k perl-subs noarch 1.03-477.amzn2022.0.2 amazonlinux 14 k perl-vars noarch 1.05-477.amzn2022.0.2 amazonlinux 15 k Installing weak dependencies: perl-IO-Socket-IP noarch 0.41-3.amzn2022.0.1 amazonlinux 42 k perl-IO-Socket-SSL noarch 2.070-2.amzn2022 amazonlinux 215 k perl-Mozilla-CA noarch 20200520-4.amzn2022.0.1 amazonlinux 13 k perl-NDBM_File aarch64 1.15-477.amzn2022.0.2 amazonlinux 24 k Transaction Summary ================================================================================================================================================================================== Install 65 Packages Total download size: 64 M Installed size: 356 M Is this ok [y/N]: y Downloading Packages: (1/65): perl-IO-Socket-IP-0.41-3.amzn2022.0.1.noarch.rpm 294 kB/s | 42 kB 00:00 (2/65): perl-Getopt-Long-2.52-2.amzn2022.0.1.noarch.rpm 406 kB/s | 60 kB 00:00 (3/65): perl-vars-1.05-477.amzn2022.0.2.noarch.rpm 89 kB/s | 15 kB 00:00 (4/65): perl-if-0.60.800-477.amzn2022.0.2.noarch.rpm 286 kB/s | 16 kB 00:00 (5/65): perl-Mozilla-CA-20200520-4.amzn2022.0.1.noarch.rpm 238 kB/s | 13 kB 00:00 (6/65): perl-base-2.27-477.amzn2022.0.2.noarch.rpm 904 kB/s | 18 kB 00:00 (7/65): perl-IO-Socket-SSL-2.070-2.amzn2022.noarch.rpm 3.6 MB/s | 215 kB 00:00 (8/65): perl-Pod-Usage-2.01-2.amzn2022.0.1.noarch.rpm 1.0 MB/s | 41 kB 00:00 (9/65): perl-constant-1.33-459.amzn2022.0.1.noarch.rpm 726 kB/s | 23 kB 00:00 (10/65): perl-parent-0.238-458.amzn2022.0.1.noarch.rpm 386 kB/s | 15 kB 00:00 (11/65): perl-Class-Struct-0.66-477.amzn2022.0.2.noarch.rpm 694 kB/s | 24 kB 00:00 (12/65): perl-Exporter-5.74-459.amzn2022.0.1.noarch.rpm 781 kB/s | 32 kB 00:00 (13/65): perl-Pod-Simple-3.42-2.amzn2022.0.1.noarch.rpm 3.0 MB/s | 215 kB 00:00 (14/65): perl-subs-1.03-477.amzn2022.0.2.noarch.rpm 454 kB/s | 14 kB 00:00 (15/65): perl-File-Temp-0.231.100-2.amzn2022.0.1.noarch.rpm 2.0 MB/s | 60 kB 00:00 (16/65): perl-File-Basename-2.85-477.amzn2022.0.2.noarch.rpm 286 kB/s | 19 kB 00:00 (17/65): perl-HTTP-Tiny-0.078-1.amzn2022.0.1.noarch.rpm 1.1 MB/s | 56 kB 00:00 (18/65): perl-Term-ANSIColor-5.01-459.amzn2022.0.1.noarch.rpm 524 kB/s | 48 kB 00:00 (19/65): perl-IPC-Open3-1.21-477.amzn2022.0.2.noarch.rpm 683 kB/s | 25 kB 00:00 (20/65): perl-Getopt-Std-1.12-477.amzn2022.0.2.noarch.rpm 517 kB/s | 18 kB 00:00 (21/65): perl-SelectSaver-1.02-477.amzn2022.0.2.noarch.rpm 465 kB/s | 14 kB 00:00 (22/65): perl-Carp-1.50-458.amzn2022.0.1.noarch.rpm 718 kB/s | 29 kB 00:00 (23/65): perl-Term-Cap-1.17-458.amzn2022.0.1.noarch.rpm 428 kB/s | 22 kB 00:00 (24/65): perl-Symbol-1.08-477.amzn2022.0.2.noarch.rpm 458 kB/s | 16 kB 00:00 (25/65): perl-Pod-Perldoc-3.28.01-459.amzn2022.0.1.noarch.rpm 1.3 MB/s | 84 kB 00:00 (26/65): perl-overloading-0.02-477.amzn2022.0.2.noarch.rpm 350 kB/s | 15 kB 00:00 (27/65): perl-File-stat-1.09-477.amzn2022.0.2.noarch.rpm 520 kB/s | 19 kB 00:00 (28/65): perl-Digest-1.20-1.amzn2022.0.1.noarch.rpm 1.0 MB/s | 26 kB 00:00 (29/65): perl-libnet-3.13-2.amzn2022.0.1.noarch.rpm 1.4 MB/s | 126 kB 00:00 (30/65): perl-AutoLoader-5.74-477.amzn2022.0.2.noarch.rpm 496 kB/s | 23 kB 00:00 (31/65): perl-Text-ParseWords-3.30-458.amzn2022.0.1.noarch.rpm 329 kB/s | 17 kB 00:00 (32/65): perl-overload-1.31-477.amzn2022.0.2.noarch.rpm 1.4 MB/s | 48 kB 00:00 (33/65): perl-podlators-4.14-458.amzn2022.0.1.noarch.rpm 1.5 MB/s | 112 kB 00:00 (34/65): perl-Time-Local-1.300-5.amzn2022.0.1.noarch.rpm 1.1 MB/s | 34 kB 00:00 (35/65): perl-FileHandle-2.03-477.amzn2022.0.2.noarch.rpm 317 kB/s | 18 kB 00:00 (36/65): perl-Text-Tabs+Wrap-2021.0726-1.amzn2022.noarch.rpm 297 kB/s | 23 kB 00:00 (37/65): perl-File-Path-2.18-2.amzn2022.0.1.noarch.rpm 816 kB/s | 36 kB 00:00 (38/65): perl-Pod-Escapes-1.07-458.amzn2022.0.1.noarch.rpm 499 kB/s | 20 kB 00:00 (39/65): perl-URI-5.09-1.amzn2022.0.1.noarch.rpm 1.5 MB/s | 109 kB 00:00 (40/65): perl-mro-1.23-477.amzn2022.0.2.aarch64.rpm 806 kB/s | 30 kB 00:00 (41/65): perl-PathTools-3.78-459.amzn2022.0.1.aarch64.rpm 1.0 MB/s | 85 kB 00:00 (42/65): perl-Socket-2.032-1.amzn2022.0.1.aarch64.rpm 1.2 MB/s | 55 kB 00:00 (43/65): perl-Storable-3.21-458.amzn2022.0.1.aarch64.rpm 1.0 MB/s | 94 kB 00:00 (44/65): perl-MIME-Base64-3.16-2.amzn2022.0.1.aarch64.rpm 996 kB/s | 31 kB 00:00 (45/65): perl-DynaLoader-1.47-477.amzn2022.0.2.aarch64.rpm 711 kB/s | 28 kB 00:00 (46/65): perl-libs-5.32.1-477.amzn2022.0.2.aarch64.rpm 19 MB/s | 2.0 MB 00:00 (47/65): perl-Encode-3.15-462.amzn2022.0.1.aarch64.rpm 15 MB/s | 1.7 MB 00:00 (48/65): perl-Scalar-List-Utils-1.56-459.amzn2022.0.1.aarch64.rpm 957 kB/s | 70 kB 00:00 (49/65): perl-Net-SSLeay-1.92-2.amzn2022.0.1.aarch64.rpm 5.3 MB/s | 368 kB 00:00 (50/65): libaio-0.3.111-11.amzn2022.0.1.aarch64.rpm 481 kB/s | 25 kB 00:00 (51/65): perl-Fcntl-1.13-477.amzn2022.0.2.aarch64.rpm 451 kB/s | 23 kB 00:00 (52/65): perl-Digest-MD5-2.58-2.amzn2022.0.1.aarch64.rpm 861 kB/s | 37 kB 00:00 (53/65): perl-POSIX-1.94-477.amzn2022.0.2.aarch64.rpm 1.6 MB/s | 99 kB 00:00 (54/65): perl-B-1.80-477.amzn2022.0.2.aarch64.rpm 2.7 MB/s | 182 kB 00:00 (55/65): perl-interpreter-5.32.1-477.amzn2022.0.2.aarch64.rpm 1.1 MB/s | 73 kB 00:00 (56/65): perl-Data-Dumper-2.174-460.amzn2022.0.1.aarch64.rpm 1.3 MB/s | 55 kB 00:00 (57/65): perl-NDBM_File-1.15-477.amzn2022.0.2.aarch64.rpm 688 kB/s | 24 kB 00:00 (58/65): perl-Errno-1.30-477.amzn2022.0.2.aarch64.rpm 405 kB/s | 17 kB 00:00 (59/65): mysql-community-client-plugins-8.0.32-1.el9.aarch64.rpm 49 MB/s | 1.3 MB 00:00 (60/65): mysql-community-common-8.0.32-1.el9.aarch64.rpm 42 MB/s | 544 kB 00:00 (61/65): mysql-community-client-8.0.32-1.el9.aarch64.rpm 48 MB/s | 3.7 MB 00:00 (62/65): mysql-community-icu-data-files-8.0.32-1.el9.aarch64.rpm 40 MB/s | 2.2 MB 00:00 (63/65): mysql-community-libs-8.0.32-1.el9.aarch64.rpm 31 MB/s | 1.5 MB 00:00 (64/65): perl-IO-1.43-477.amzn2022.0.2.aarch64.rpm 637 kB/s | 89 kB 00:00 (65/65): mysql-community-server-8.0.32-1.el9.aarch64.rpm 122 MB/s | 48 MB 00:00 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Total 38 MB/s | 64 MB 00:01 MySQL 8.0 Community Server 3.0 MB/s | 3.1 kB 00:00 Importing GPG key 0x3A79BD29: Userid : "MySQL Release Engineering <mysql-build@oss.oracle.com>" Fingerprint: 859B E8D7 C586 F538 430B 19C2 467B 942D 3A79 BD29 From : /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022 Is this ok [y/N]: y Key imported successfully Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : perl-Digest-1.20-1.amzn2022.0.1.noarch 1/65 Installing : perl-Digest-MD5-2.58-2.amzn2022.0.1.aarch64 2/65 Installing : perl-B-1.80-477.amzn2022.0.2.aarch64 3/65 Installing : perl-FileHandle-2.03-477.amzn2022.0.2.noarch 4/65 Installing : perl-AutoLoader-5.74-477.amzn2022.0.2.noarch 5/65 Installing : perl-Data-Dumper-2.174-460.amzn2022.0.1.aarch64 6/65 Installing : perl-libnet-3.13-2.amzn2022.0.1.noarch 7/65 Installing : perl-base-2.27-477.amzn2022.0.2.noarch 8/65 Installing : perl-Net-SSLeay-1.92-2.amzn2022.0.1.aarch64 9/65 Installing : perl-URI-5.09-1.amzn2022.0.1.noarch 10/65 Installing : perl-if-0.60.800-477.amzn2022.0.2.noarch 11/65 Installing : perl-Text-Tabs+Wrap-2021.0726-1.amzn2022.noarch