注目の記事

[速報]5年長期サポートのAmazon Linux 2が一般公開されました

この記事は公開されてから1年以上経過しています。情報が古い可能性がありますので、ご注意ください。

大栗です。

昨年末にAmazon Linux 2が発表されました。しかし、当時はRelease Candidateの状態でした。本日Amazon Linux 2がLong Term Supportとして5年間の長期サポートとして正式リリースされたのでレポートします。

Announcing Amazon Linux 2 with Long Term Support

Amazon Linux 2

2017年12月にAmazon Linux 2が発表されました。Amazon Linux2では5年長期サポートやオンプレミスでの使用など、今までのAmazon Linuxには無かった特徴があります。詳しくは、以下のエントリーをご参照下さい。

【速報】AWS向けの新ディストリビューション Amazon Linux 2 を発表!

今回のLTSでは以下の3種類のAMIがリリースされているようです。一般EBS版、GP2版、最小限パッケージ版の模様です。

  • amzn2-ami-hvm-2.0.20180622.1-x86_64-ebs
  • amzn2-ami-hvm-2.0.20180622.1-x86_64-gp2
  • amzn2-ami-minimal-hvm-2.0.20180622.1-x86_64-ebs

起動してみる

EC2のインスタンス起動画面で普通にAMIを選択します。

起動してログインしてみると、Amazon Linux 2 AMIと表示が出てログインできます。

$ ssh -i /path/to/KeyPair.pem ec2-user@ 203.0.113.97
Warning: Permanently added '203.0.113.97' (ECDSA) to the list of known hosts.

       __|  __|_  )
       _|  (     /   Amazon Linux 2 AMI
      ___|\___|___|

https://aws.amazon.com/amazon-linux-2/
[ec2-user@ip-192-0-2-20 ~]$

バージョン情報を確認してみましょう。Kernelのバージョンは4.14.47になっています。

[ec2-user@ip-192-0-2-20 ~]$ cat /etc/system-release
Amazon Linux 2
[ec2-user@ip-192-0-2-20 ~]$ uname -a
Linux ip-192-0-2-20.ap-northeast-1.compute.internal 4.14.47-64.38.amzn2.x86_64 #1 SMP Mon Jun 18 22:33:07 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

Extraの中身を確認してみます。Release Candidateでは14まででしたが、15以降にLibreOfficeやGIMP等GUIツールが入っていることが特徴的です。これはAmazon Linux 2がWorkSpacesに対応したことが理由かと思われます。

[ec2-user@ip-192-0-2-20 ~]$ sudo amazon-linux-extras list
  0  ansible2                 available  [ =2.4.2 ]
  1  emacs                    available  [ =25.3 ]
  2  memcached1.5             available  [ =1.5.1 ]
  3  nginx1.12                available  [ =1.12.2 ]
  4  postgresql9.6            available  [ =9.6.6  =9.6.8 ]
  5  python3                  available  [ =3.6.2 ]
  6  redis4.0                 available  [ =4.0.5 ]
  7  R3.4                     available  [ =3.4.3 ]
  8  rust1                    available  [ =1.22.1  =1.26.0 ]
  9  vim                      available  [ =8.0 ]
 10  golang1.9                available  [ =1.9.2 ]
 11  ruby2.4                  available  [ =2.4.2  =2.4.4 ]
 12  nano                     available  [ =2.9.1 ]
 13  php7.2                   available  [ =7.2.0  =7.2.4  =7.2.5 ]
 14  lamp-mariadb10.2-php7.2  available  \
        [ =10.2.10_7.2.0  =10.2.10_7.2.4  =10.2.10_7.2.5 ]
 15  libreoffice              available  [ =5.0.6.2_15 ]
 16  gimp                     available  [ =2.8.22 ]
 17  docker=latest            enabled    [ =17.12.1  =18.03.1 ]
 18  mate-desktop1.x          available  [ =1.19.0  =1.20.0 ]
 19  GraphicsMagick1.3        available  [ =1.3.29 ]
 20  tomcat8.5                available  [ =8.5.31 ]

登録されているサービスは以下のようになっています。

[ec2-user@ip-192-0-2-20 ~]$ systemctl list-unit-files --type=service
UNIT FILE                                     STATE
amazon-ssm-agent.service                      enabled
arp-ethers.service                            disabled
atd.service                                   enabled
auditd.service                                enabled
auth-rpcgss-module.service                    static
autovt@.service                               enabled
blk-availability.service                      disabled
brandbot.service                              static
chrony-dnssrv@.service                        static
chrony-wait.service                           disabled
chronyd.service                               enabled
cloud-config.service                          enabled
cloud-final.service                           enabled
cloud-init-local.service                      enabled
cloud-init.service                            enabled
console-getty.service                         disabled
console-shell.service                         disabled
container-getty@.service                      static
crond.service                                 enabled
dbus-org.freedesktop.hostname1.service        static
dbus-org.freedesktop.import1.service          static
dbus-org.freedesktop.locale1.service          static
dbus-org.freedesktop.login1.service           static
dbus-org.freedesktop.machine1.service         static
dbus-org.freedesktop.timedate1.service        static
dbus.service                                  static
debug-shell.service                           disabled
dm-event.service                              static
dmraid-activation.service                     enabled
dracut-cmdline.service                        static
dracut-initqueue.service                      static
dracut-mount.service                          static
dracut-pre-mount.service                      static
dracut-pre-pivot.service                      static
dracut-pre-trigger.service                    static
dracut-pre-udev.service                       static
dracut-shutdown.service                       static
ec2net-ifup@.service                          static
ec2net-scan.service                           disabled
emergency.service                             static
fstrim.service                                static
getty@.service                                enabled
gssproxy.service                              disabled
halt-local.service                            static
hibagent.service                              disabled
initrd-cleanup.service                        static
initrd-parse-etc.service                      static
initrd-switch-root.service                    static
initrd-udevadm-cleanup-db.service             static
irqbalance.service                            enabled
kmod-static-nodes.service                     static
kpatch.service                                disabled
libstoragemgmt.service                        enabled
lvm2-lvmetad.service                          static
lvm2-lvmpolld.service                         static
lvm2-monitor.service                          enabled
lvm2-pvscan@.service                          static
mdadm-grow-continue@.service                  static
mdadm-last-resort@.service                    static
mdmon@.service                                static
mdmonitor.service                             enabled
messagebus.service                            static
nfs-blkmap.service                            disabled
nfs-config.service                            static
nfs-idmap.service                             static
nfs-idmapd.service                            static
nfs-lock.service                              static
nfs-mountd.service                            static
nfs-rquotad.service                           disabled
nfs-secure.service                            static
nfs-server.service                            disabled
nfs-utils.service                             static
nfs.service                                   disabled
nfslock.service                               static
plymouth-halt.service                         disabled
plymouth-kexec.service                        disabled
plymouth-poweroff.service                     disabled
plymouth-quit-wait.service                    disabled
plymouth-quit.service                         disabled
plymouth-read-write.service                   disabled
plymouth-reboot.service                       disabled
plymouth-start.service                        disabled
plymouth-switch-root.service                  static
postfix.service                               enabled
psacct.service                                disabled
quotaon.service                               static
rc-local.service                              static
rdisc.service                                 disabled
rescue.service                                static
rhel-autorelabel-mark.service                 static
rhel-autorelabel.service                      static
rhel-configure.service                        static
rhel-dmesg.service                            disabled
rhel-domainname.service                       disabled
rhel-import-state.service                     static
rhel-loadmodules.service                      static
rhel-readonly.service                         static
rngd.service                                  enabled
rpc-gssd.service                              static
rpc-rquotad.service                           disabled
rpc-statd-notify.service                      static
rpc-statd.service                             static
rpcbind.service                               indirect
rpcgssd.service                               static
rpcidmapd.service                             static
rsyncd.service                                disabled
rsyncd@.service                               static
rsyslog.service                               enabled
selinux-policy-migrate-local-changes@.service static
serial-getty@.service                         disabled
sshd-keygen.service                           static
sshd.service                                  enabled
sshd@.service                                 static
sysstat.service                               enabled
systemd-ask-password-console.service          static
systemd-ask-password-plymouth.service         static
systemd-ask-password-wall.service             static
systemd-backlight@.service                    static
systemd-binfmt.service                        static
systemd-bootchart.service                     disabled
systemd-firstboot.service                     static
systemd-fsck-root.service                     static
systemd-fsck@.service                         static
systemd-halt.service                          static
systemd-hibernate-resume@.service             static
systemd-hibernate.service                     static
systemd-hostnamed.service                     static
systemd-hwdb-update.service                   static
systemd-hybrid-sleep.service                  static
systemd-importd.service                       static
systemd-initctl.service                       static
systemd-journal-catalog-update.service        static
systemd-journal-flush.service                 static
systemd-journald.service                      static
systemd-kexec.service                         static
systemd-localed.service                       static
systemd-logind.service                        static
systemd-machine-id-commit.service             static
systemd-machined.service                      static
systemd-modules-load.service                  static
systemd-nspawn@.service                       disabled
systemd-poweroff.service                      static
systemd-quotacheck.service                    static
systemd-random-seed.service                   static
systemd-readahead-collect.service             enabled
systemd-readahead-done.service                indirect
systemd-readahead-drop.service                enabled
systemd-readahead-replay.service              enabled
systemd-reboot.service                        static
systemd-remount-fs.service                    static
systemd-rfkill@.service                       static
systemd-shutdownd.service                     static
systemd-suspend.service                       static
systemd-sysctl.service                        static
systemd-timedated.service                     static
systemd-tmpfiles-clean.service                static
systemd-tmpfiles-setup-dev.service            static
systemd-tmpfiles-setup.service                static
systemd-udev-settle.service                   static
systemd-udev-trigger.service                  static
systemd-udevd.service                         static
systemd-update-done.service                   static
systemd-update-utmp-runlevel.service          static
systemd-update-utmp.service                   static
systemd-user-sessions.service                 static
systemd-vconsole-setup.service                static
teamd@.service                                static
update-motd.service                           enabled

168 unit files listed.

ファイルシステムはxfsになっています。

[ec2-user@ip-192-0-2-20 ~]$ df -Th
ファイルシス   タイプ   サイズ  使用  残り 使用% マウント位置
devtmpfs       devtmpfs   981M     0  981M    0% /dev
tmpfs          tmpfs      998M     0  998M    0% /dev/shm
tmpfs          tmpfs      998M  344K  998M    1% /run
tmpfs          tmpfs      998M     0  998M    0% /sys/fs/cgroup
/dev/xvda1     xfs        8.0G  1.2G  6.9G   15% /
tmpfs          tmpfs      200M     0  200M    0% /run/user/0
tmpfs          tmpfs      200M     0  200M    0% /run/user/1000

主な注意点

Amazon Linux 2のコアコンポーネントは何ですか?

Amazon Linux 2の主要コンポーネントは次のとおりです。

  1. Amazon EC2のパフォーマンスをチューニングしたLinux Kernel。
  2. AWSからLong Term Support(LTS)を受け取るsystemd、GCC 7.3、Glibc 2.26、Binutils 2.29.1を含む一連のコアパッケージ。
  3. 頻繁に更新される可能性がある、長期サポート(LTS)モデル外で高速に進化するテクノロジーのためのExtraチャネル。

Amazon Linux 2とAmazon Linux AMIの違いは何ですか?

Amazon Linux 2とAmazon Linux AMIの主な違いは次のとおりです。

  1. Amazon Linux 2は、2023年6月30日まで長期サポートを提供します。
  2. Amazon Linux 2は、オンプレミスの開発およびテスト用の仮想マシンイメージとして利用可能です。
  3. Amazon Linux 2は、Amazon Linux AMIのSystem V initシステムと対照的に、systemdとsystems managerを提供します。
  4. Amazon Linux 2には、更新されたLinux kernel、Cライブラリ、コンパイラ、およびツールが付属しています。
  5. Amazon Linux 2は、extrasメカニズムで追加ソフトウェアパッケージをインストールする機能を提供します。

Amazon Linux 2の長期サポートには何が含まれていますか?

Amazon Linux 2の長期サポートは、コアパッケージにのみ適用され、以下を含みます

1) AWSは、2023年6月30日まで、コア内のすべてのパッケージのセキュリティアップデートとバグ修正を提供します 2) AWSは次のパッケージについてユーザー空間のABIの互換性を維持します:

elfutils-libelf, glibc, glibc-utils, hesiod, krb5-libs, libgcc, libgomp, libstdc++, libtbb.so, libtbbmalloc.so, libtbbmalloc_proxy.so, libusb, libxml2, libxslt, pam, audit-libs, audit-libs-python, bzip2-libs, c-ares, clutter, cups-libs, cyrus-sasl-gssapi, cyrus-sasl-lib, cyrus-sasl-md5, dbus-glib, dbus-libs, elfutils-libs, expat, fuse-libs, glib2, gmp, gnutls, httpd, libICE, libSM, libX11, libXau, libXaw, libXext, libXft, libXi, libXinerama, libXpm, libXrandr, libXrender, libXt, libXtst, libacl, libaio, libatomic, libattr, libblkid, libcap-ng, libdb, libdb-cxx, libgudev1, libhugetlbfs, libnotify, libpfm, libsmbclient, libtalloc, libtdb, libtevent, libusb, libuuid, ncurses-libs, nss, nss-sysinit, numactl, openssl, p11-kit, papi, pcre, perl, perl-Digest-SHA, perl-Time-Piece, perl-libs, popt, python, python-libs, readline, realmd, ruby, scl-utils, sqlite, systemd-libs, systemtap, tcl, tcp_wrappers-libs, xz-libs, and zlib

3) AWSの管理を超えた理由で互換性を提供できない場合の除き、AWSはコア内の他のすべてのパッケージに対してアプリケーションバイナリインターフェイス(ABI)互換性を提供します。

Amazon Linux 2 LTS Candidate からLTSバージョンのAmazon Linux 2にローリング・アップグレードを実行できますか?

はい。Amazon Linux 2 LTS Candidate からAmazon Linux 2へのローリングアップグレードが可能です。ただし、final LTS buildの変更により、アプリケーションが破損する可能性があります。移行する前に新規インストールのAmazon Linux 2のでアプリケーションをテストすることをお勧めします。

AWSはAmazon Linux AMIをサポートしますか?

はい。Amazon Linux 2への移行を容易にするため、AWSは2020年6月30日までAmazon Linuxおよびコンテナの最新バージョンのセキュリティアップデートを提供します。AWS Premium SupportやAmazon Linux Discussion Forumなどの既存のサポートチャネルを使用して、サポートリクエストを引き続きリクエストできます。

他にも様々な注意点がありますのでAmazon Linux 2のFAQページを確認しましょう。

Amazon Linux 2 FAQs

最後に

待ちに待ったAmazon Linux 2の長期サポートバージョンが登場しました。今までのAmazon Linuxはアップデートを続けているディストリビューションのスナップショットであったのでセキュリティアップデートのために頻繁なバージョンアップが必要など運用面で課題を抱えていました。Amazon Linux 2のコアパッケージはABIでの互換性維持が提供されます。ただしExtraパッケージはLTS外であるため使用可否について検討した上でご使用下さい。