Netdata Cloudでネットワーク上の機器を一元監視できるようにして初めて、エージェントのバージョンアップを促す警告が現れました。 OpenWRT へ入れた 静的ビルド 版や、AlmaLinuxのパッケージ版のNetdata アップデート 手順を確認します。
Netdata Cloudにアップデートを促される
以前、Netdata Cloudでネットワーク上の機器を一元監視できるようにしましたが(これまでのNetdata関連記事はこちら)、
その後のある日より、各ノードへインストールされているエージェントのアップデートを促す警告が、Netdata Cloudに挙がるようになりました。
導入当時、各ノードへインストールしたNetdataはv1.38、現在リリースされているのはv1.40なので、小数点以下の2世代以上乖離すると警告が出るのでしょう(それでもモニタリングなどこれまで通りに使用可能)。
1)NanoPi R2S OpenWRT 21.02 静的ビルド版Netdataの更新
OpenWRTで用意されているパッケージ版Netdataは、Cloud非対応のスタンドアロン版なので、前回Netdata謹製の静的ビルド版をインストールしました。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
root@R2S:~# uname -a Linux R2S 5.4.179 #0 SMP PREEMPT Wed Feb 16 20:29:10 2022 aarch64 GNU/Linux root@R2S:~# cat /etc/os-release NAME="OpenWrt" VERSION="21.02.2" ID="openwrt" ID_LIKE="lede openwrt" PRETTY_NAME="OpenWrt 21.02.2" VERSION_ID="21.02.2" HOME_URL="https://openwrt.org/" BUG_URL="https://bugs.openwrt.org/" SUPPORT_URL="https://forum.openwrt.org/" BUILD_ID="r16495-bf0c965af0" OPENWRT_BOARD="rockchip/armv8" OPENWRT_ARCH="aarch64_generic" OPENWRT_TAINTS="" OPENWRT_DEVICE_MANUFACTURER="OpenWrt" OPENWRT_DEVICE_MANUFACTURER_URL="https://openwrt.org/" OPENWRT_DEVICE_PRODUCT="Generic" OPENWRT_DEVICE_REVISION="v0" OPENWRT_RELEASE="OpenWrt 21.02.2 r16495-bf0c965af0" root@R2S:~# /opt/netdata/bin/netdatacli version netdata v1.38.0-90-gd6b071100 root@R2S:~# /opt/netdata/bin/netdata -W buildinfo | grep 'Install type:' Install type: kickstart-static |
Netdata公式ドキュメントによると、アップデートもインストール時に使用した kickstart.sh がアップデートも対応してくれそうなので、まずは --dry-run を付けて実行してみます。
なお、OpenWRTのデフォルトシェルはBusyBoxにリンクされた ash で、
1 2 |
root@R2S:~# ls -l /bin/sh lrwxrwxrwx 1 root root 7 Feb 17 2022 /bin/sh -> busybox |
その作法が多少異なるのでダウンロードした kickstart.sh を実行する部分を sh から bash へ変更しました。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
root@R2S:~# wget -O /tmp/netdata-kickstart.sh https://my-netdata.io/kickstart.sh && bash /tmp/netdata-kickstart.sh --dry-run Downloading 'https://my-netdata.io/kickstart.sh' Connecting to 172.67.156.192:443 Writing to '/tmp/netdata-kickstart.sh' Download completed (83335 bytes) --- Using /tmp/netdata-kickstart-XXXXAHmJla as a temporary directory. --- --- Checking for existing installations of Netdata... --- Would run command:\n[/tmp/netdata-kickstart-XXXXAHmJla]# sh -c cat "/opt/netdata/etc/netdata/.install-type" > "/tmp/netdata-kickstart-XXXXAHmJla/install-type" OK /tmp/netdata-kickstart.sh: line 864: /tmp/netdata-kickstart-XXXXAHmJla/install-type: No such file or directory Would run command:\n[/tmp/netdata-kickstart-XXXXAHmJla]# sh -c cat "/opt/netdata/etc/netdata/.environment" > "/tmp/netdata-kickstart-XXXXAHmJla/environment" OK /tmp/netdata-kickstart.sh: line 874: /tmp/netdata-kickstart-XXXXAHmJla/environment: No such file or directory WARNING Found an existing netdata install at /opt/netdata, but could not determine the install type. Usually this means you installed Netdata through your distribution’s regular package repositories or some other unsupported method. Attempting to update an existing install is not officially supported. It may work, but it also might break your system. If you just want to claim this install, you should re-run this command with the --claim-only option instead. Are you sure you want to continue? [y/n] y --- OK, continuing --- Would run command:\n[/tmp/netdata-kickstart-XXXXAHmJla]# test -x /opt/netdata/usr/libexec/netdata/netdata-updater.sh OK --- Would attempt to update existing installation by running the updater script located at: /opt/netdata/usr/libexec/netdata/netdata-updater.sh --- --- Successfully updated existing netdata install at /opt/netdata. --- --- Not attempting to claim existing install at /opt/netdata (no claiming token provided). --- The following non-fatal warnings or errors were encountered: - Found an existing netdata install at /opt/netdata, but could not determine the install type. Usually this means you installed Netdata through your distribution’s regular package repositories or some other unsupported method. Official documentation can be found online at https://learn.netdata.cloud/docs/. Looking to monitor all of your infrastructure with Netdata? Check out Netdata Cloud at https://app.netdata.cloud. Join our community and connect with us on: - GitHub: https://github.com/netdata/netdata/discussions - Discord: https://discord.gg/5ygS846fR6 - Our community forums: https://community.netdata.cloud/ Would run command:\n[/root]# rm -rf /tmp/netdata-kickstart-XXXXAHmJla OK |
途中やや微妙なところもありますが、 --dry-run 外して本実行するとそれ以前にチェクサムエラーで異常終了しました。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
root@R2S:~# wget -O /tmp/netdata-kickstart.sh https://my-netdata.io/kickstart.sh && bash /tmp/netdata-kickstart.sh Downloading 'https://my-netdata.io/kickstart.sh' Connecting to 172.67.156.192:443 Writing to '/tmp/netdata-kickstart.sh' Download completed (83335 bytes) --- Using /tmp/netdata-kickstart-XXXXNNiceL as a temporary directory. --- --- Checking for existing installations of Netdata... --- [/tmp/netdata-kickstart-XXXXNNiceL]# sh -c cat "/opt/netdata/etc/netdata/.install-type" > "/tmp/netdata-kickstart-XXXXNNiceL/install-type" OK --- Found an existing netdata install at /opt/netdata, with installation type 'kickstart-static'. --- [/tmp/netdata-kickstart-XXXXNNiceL]# test -x /opt/netdata/usr/libexec/netdata/netdata-updater.sh OK [/tmp/netdata-kickstart-XXXXNNiceL]# /opt/netdata/usr/libexec/netdata/netdata-updater.sh --interactive --not-running-from-cron Tue Jun 20 14:41:28 HKT 2023 : INFO: netdata-updater.sh: Checking if a newer version of the updater script is available. Traceback (most recent call last): File "<string>", line 1, in <module> File "/usr/lib/python3.9/json/__init__.py", line 293, in load File "/usr/lib/python3.9/json/__init__.py", line 346, in loads File "/usr/lib/python3.9/json/decoder.py", line 337, in decode File "/usr/lib/python3.9/json/decoder.py", line 355, in raw_decode json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) Tue Jun 20 14:41:28 HKT 2023 : INFO: netdata-updater.sh: Downloading newest version of updater script. Tue Jun 20 14:41:29 HKT 2023 : INFO: netdata-updater.sh: Entering /tmp/netdata-updater-XXXXnkGJdk sh: invalid number '' sh: invalid number '' sh: invalid number '' Tue Jun 20 14:41:30 HKT 2023 : INFO: netdata-updater.sh: Current Version: 00104000000016 Tue Jun 20 14:41:30 HKT 2023 : INFO: netdata-updater.sh: Latest Version: 00000000000000 Tue Jun 20 14:41:30 HKT 2023 : INFO: netdata-updater.sh: Update available Tue Jun 20 14:41:31 HKT 2023 : FATAL: netdata-updater.sh: FAILED TO UPDATE NETDATA: Static binary checksum validation failed. Stopping netdata installation and leaving binary in /tmp/netdata-updater-XXXXnkGJdk\nUsually this is a result of an older copy of the file being cached somewhere and can be resolved by simply retrying in an hour. FAILED --- Updated existing install at /opt/netdata --- --- Successfully updated existing netdata install at /opt/netdata. --- --- Not attempting to claim existing install at /opt/netdata (no claiming token provided). --- The following non-fatal warnings or errors were encountered: - Static binary checksum validation failed. Stopping netdata installation and leaving binary in /tmp/netdata-updater-XXXXnkGJdk Usually this is a result of an older copy of the file being cached somewhere and can be resolved by simply retrying in an hour. Official documentation can be found online at https://learn.netdata.cloud/docs/. Looking to monitor all of your infrastructure with Netdata? Check out Netdata Cloud at https://app.netdata.cloud. Join our community and connect with us on: - GitHub: https://github.com/netdata/netdata/discussions - Discord: https://discord.gg/5ygS846fR6 - Our community forums: https://community.netdata.cloud/ [/root]# rm -rf /tmp/netdata-kickstart-XXXXNNiceL OK |
スムースなアップデートが見込めないので、公式ドキュメントに従い kickstart.sh による再インストールを試してみます。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 |
root@R2S:~# /tmp/netdata-kickstart.sh --reinstall --- Using /tmp/netdata-kickstart-XXXXBIepFO as a temporary directory. --- WARNING Unable to determine Linux distribution for native packages. WARNING Could not install native binary packages, falling back to alternative installation method. [/tmp/netdata-kickstart-XXXXBIepFO]# sh -c /usr/bin/curl https://github.com/netdata/netdata-nightlies/releases/latest -s -L -I -o /dev/null -w '%{url_effective}' | grep -o '[^/]*$' OK --- Attempting to install using static build... --- [/tmp/netdata-kickstart-XXXXBIepFO]# /usr/bin/curl --fail -q -sSL --connect-timeout 10 --retry 3 --output /tmp/netdata-kickstart-XXXXBIepFO/netdata-aarch64-latest.gz.run https://github.com/netdata/netdata-nightlies/releases/download/v1.40.0-16-nightly/netdata-aarch64-latest.gz.run OK [/tmp/netdata-kickstart-XXXXBIepFO]# /usr/bin/curl --fail -q -sSL --connect-timeout 10 --retry 3 --output /tmp/netdata-kickstart-XXXXBIepFO/sha256sum.txt https://github.com/netdata/netdata-nightlies/releases/download/v1.40.0-16-nightly/sha256sums.txt OK --- Installing netdata --- [/tmp/netdata-kickstart-XXXXBIepFO]# sh /tmp/netdata-kickstart-XXXXBIepFO/netdata-aarch64-latest.gz.run -- ^ |.-. .-. .-. .-. . netdata | '-' '-' '-' '-' real-time performance monitoring, done right! +----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+---> (C) Copyright 2017-2023, Costa Tsaousis All rights reserved Released under GPL v3+ You are about to install netdata to this system. netdata will be installed at: /opt/netdata The following changes will be made to your system: # USERS / GROUPS User 'netdata' and group 'netdata' will be added, if not present. # LOGROTATE This file will be installed if logrotate is present. - /etc/logrotate.d/netdata # SYSTEM INIT If a supported init system is detected, appropriate configuration will be installed to allow Netdata to run as a system service. We currently support systemd, OpenRC, LSB init scripts, and traditional init.d setups, as well as having experimental support for runit. This package can also update a netdata installation that has been created with another version of it. Your netdata configuration will be retained. After installation, netdata will be (re-)started. netdata re-distributes a lot of open source software components. Check its full license at: https://github.com/netdata/netdata/blob/master/LICENSE Please type y to accept, n otherwise: y Creating directory /opt/netdata Verifying archive integrity... 100% MD5 checksums are OK. All good. Uncompressing netdata, the real-time performance and health monitoring system 100% --- Attempt to create user/group netdata/netadata --- Adding netdata user group ... WARNING Failed to add netdata user group ! FAILED I could not add group netdata, so no user netdata will be created as well. Netdata run as root:root --- Install logrotate configuration for netdata --- FAILED Cannot install logrotate file for netdata. --- Telemetry configuration --- You can opt out from anonymous statistics via the --disable-telemetry option, or by creating an empty file /opt/netdata/etc/netdata/.opt-out-from-anonymous-statistics --- Install netdata at system init --- ERROR: Failed to detect what type of service manager is in use. WARNING Failed to detect system service manager type. Cannot cleanly install or manage Netdata as a system service. If you are running this script in a container, this is expected and can safely be ignored. --- Install (but not enable) netdata updater tool --- Update script is located at /opt/netdata/usr/libexec/netdata/netdata-updater.sh --- creating quick links --- [/opt/netdata]# rm sbin OK '' [/opt/netdata]# ln -s bin sbin OK '' [/opt/netdata/usr]# rm bin OK '' [/opt/netdata/usr]# ln -s ../bin bin OK '' [/opt/netdata/usr]# rm sbin OK '' [/opt/netdata/usr]# ln -s ../bin sbin OK '' [/opt/netdata/usr]# rm local OK '' [/opt/netdata/usr]# ln -s . local OK '' [/opt/netdata]# rm netdata-configs OK '' [/opt/netdata]# ln -s etc/netdata netdata-configs OK '' [/opt/netdata]# rm netdata-web-files OK '' [/opt/netdata]# ln -s usr/share/netdata/web netdata-web-files OK '' [/opt/netdata]# rm netdata-plugins OK '' [/opt/netdata]# ln -s usr/libexec/netdata netdata-plugins OK '' [/opt/netdata]# rm netdata-dbs OK '' [/opt/netdata]# ln -s var/lib/netdata netdata-dbs OK '' [/opt/netdata]# rm netdata-metrics OK '' [/opt/netdata]# ln -s var/cache/netdata netdata-metrics OK '' [/opt/netdata]# rm netdata-logs OK '' [/opt/netdata]# ln -s var/log/netdata netdata-logs OK '' [/opt/netdata/etc/netdata]# rm orig OK '' [/opt/netdata/etc/netdata]# ln -s ../../usr/lib/netdata/conf.d orig OK '' --- fix permissions --- [/opt/netdata]# chmod g+rx,o+rx /opt OK '' [/opt/netdata]# find /opt/netdata -type d -exec chmod go+rx {} + OK '' [/opt/netdata]# chown -R root:root /opt/netdata/var OK '' --- changing plugins ownership and permissions --- [/opt/netdata]# chown root:root usr/libexec/netdata/plugins.d/apps.plugin OK '' [/opt/netdata]# chmod 4750 usr/libexec/netdata/plugins.d/apps.plugin OK '' [/opt/netdata]# chown root:root usr/libexec/netdata/plugins.d/perf.plugin OK '' [/opt/netdata]# chmod 4750 usr/libexec/netdata/plugins.d/perf.plugin OK '' [/opt/netdata]# chown root:root usr/libexec/netdata/plugins.d/slabinfo.plugin OK '' [/opt/netdata]# chmod 4750 usr/libexec/netdata/plugins.d/slabinfo.plugin OK '' [/opt/netdata]# chown root:root usr/libexec/netdata/plugins.d/debugfs.plugin OK '' [/opt/netdata]# chmod 4750 usr/libexec/netdata/plugins.d/debugfs.plugin OK '' [/opt/netdata]# chown root:root usr/libexec/netdata/plugins.d/ioping OK '' [/opt/netdata]# chmod 4750 usr/libexec/netdata/plugins.d/ioping OK '' [/opt/netdata]# chown root:root usr/libexec/netdata/plugins.d/cgroup-network OK '' [/opt/netdata]# chmod 4750 usr/libexec/netdata/plugins.d/cgroup-network OK '' [/opt/netdata]# chown root:root usr/libexec/netdata/plugins.d/nfacct.plugin OK '' [/opt/netdata]# chmod 4750 usr/libexec/netdata/plugins.d/nfacct.plugin OK '' Configure TLS certificate paths Using /etc/ssl for TLS configuration and certificates Save install options --- starting netdata --- --- Restarting netdata instance --- ERROR: Failed to detect what type of service manager is in use. Stopping all netdata threads [/opt/netdata]# stop_all_netdata ERROR: Failed to detect what type of service manager is in use. Stopping netdata on pid 24920 ............... netdata on pid 24920 stopped. Stopping netdata on pid 24905 ............... netdata on pid 24905 stopped. OK '' Starting netdata using command '/opt/netdata/bin/netdata' [/opt/netdata]# /opt/netdata/bin/netdata OK '' ^ |.-. .-. .-. .-. .-. . netdata .-. .-. .-. .-. .-. .- | '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' +----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+---> [/opt/netdata]# chmod 0644 /opt/netdata/etc/netdata/netdata.conf OK '' OK [/tmp/netdata-kickstart-XXXXBIepFO]# sh -c cat "/opt/netdata/etc/netdata/.install-type" > "/tmp/netdata-kickstart-XXXXBIepFO/install-type" OK [/tmp/netdata-kickstart-XXXXBIepFO]# chown 0:0 /tmp/netdata-kickstart-XXXXBIepFO/install-type OK [/tmp/netdata-kickstart-XXXXBIepFO]# chown netdata:netdata /tmp/netdata-kickstart-XXXXBIepFO/install-type chown: unknown user/group netdata:netdata FAILED [/tmp/netdata-kickstart-XXXXBIepFO]# cp /tmp/netdata-kickstart-XXXXBIepFO/install-type /opt/netdata/etc/netdata/.install-type OK [/tmp/netdata-kickstart-XXXXBIepFO]# test -x /opt/netdata/usr/libexec/netdata/netdata-updater.sh OK [/tmp/netdata-kickstart-XXXXBIepFO]# grep -q \-\-enable-auto-updates /opt/netdata/usr/libexec/netdata/netdata-updater.sh OK [/tmp/netdata-kickstart-XXXXBIepFO]# /opt/netdata/usr/libexec/netdata/netdata-updater.sh --enable-auto-updates Tue Jun 20 12:40:48 HKT 2023 : ERROR: netdata-updater.sh: Unable to determine what type of auto-update scheduling to use. Auto-updates have NOT been enabled. FAILED WARNING Failed to enable auto updates. Netdata will still work, but you will need to update manually. Successfully installed the Netdata Agent. The following non-fatal warnings or errors were encountered: - Unable to determine Linux distribution for native packages. - Could not install native binary packages, falling back to alternative installation method. - Command "chown netdata:netdata /tmp/netdata-kickstart-XXXXBIepFO/install-type" failed with exit code 1. - Command "/opt/netdata/usr/libexec/netdata/netdata-updater.sh --enable-auto-updates " failed with exit code 1. - Failed to enable auto updates. Netdata will still work, but you will need to update manually. Official documentation can be found online at https://learn.netdata.cloud/docs/. Looking to monitor all of your infrastructure with Netdata? Check out Netdata Cloud at https://app.netdata.cloud. Join our community and connect with us on: - GitHub: https://github.com/netdata/netdata/discussions - Discord: https://discord.gg/5ygS846fR6 - Our community forums: https://community.netdata.cloud/ [/root]# rm -rf /tmp/netdata-kickstart-XXXXBIepFO OK |
再インストールは正常に終了しましたが、古いプロセスも残ったままになっているので、全て停止してから手動でサービスを起動します。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
root@R2S:~# netstat -tulnp | grep 19999 tcp 0 0 0.0.0.0:19999 0.0.0.0:* LISTEN 27453/netdata tcp 0 0 0.0.0.0:19999 0.0.0.0:* LISTEN 27329/netdata tcp 0 0 :::19999 :::* LISTEN 27329/netdata tcp 0 0 :::19999 :::* LISTEN 27453/netdata root@R2S:~# /etc/init.d/netdata stop root@R2S:~# netstat -tulnp | grep 19999 tcp 0 0 0.0.0.0:19999 0.0.0.0:* LISTEN 27453/netdata tcp 0 0 :::19999 :::* LISTEN 27453/netdata root@R2S:~# kill 27453 root@R2S:~# /etc/init.d/netdata start root@R2S:~# netstat -tulnp | grep 19999 tcp 0 0 0.0.0.0:19999 0.0.0.0:* LISTEN 30425/netdata tcp 0 0 :::19999 :::* LISTEN 30425/netdata |
ターミナル上とNetdata Cloud上で、Netdataのバージョンが更新されたことを確認。
1 2 3 4 5 |
root@R2S:~# /opt/netdata/bin/netdatacli version netdata v1.40.0-16-g7348c85c1 root@R2S:~# /opt/netdata/bin/netdata -W buildinfo | grep 'Install type:' Install type: kickstart-static |
2)x86_64仮想マシン OpenWRT 22.03 静的ビルド版Netdataの更新
続いては同じOpenWRTではあるものの、x86_64ベースの仮想マシンに入れたNetdataを更新します(こちらも静的ビルド版)。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
root@vWrt:~# uname -a Linux vWrt 5.10.161 #0 SMP Tue Jan 3 00:24:21 2023 x86_64 GNU/Linux root@vWrt:~# cat /etc/os-release NAME="OpenWrt" VERSION="22.03.3" ID="openwrt" ID_LIKE="lede openwrt" PRETTY_NAME="OpenWrt 22.03.3" VERSION_ID="22.03.3" HOME_URL="https://openwrt.org/" BUG_URL="https://bugs.openwrt.org/" SUPPORT_URL="https://forum.openwrt.org/" BUILD_ID="r20028-43d71ad93e" OPENWRT_BOARD="x86/64" OPENWRT_ARCH="x86_64" OPENWRT_TAINTS="" OPENWRT_DEVICE_MANUFACTURER="OpenWrt" OPENWRT_DEVICE_MANUFACTURER_URL="https://openwrt.org/" OPENWRT_DEVICE_PRODUCT="Generic" OPENWRT_DEVICE_REVISION="v0" OPENWRT_RELEASE="OpenWrt 22.03.3 r20028-43d71ad93e" |
ターミナルで現在のNetdataを確認。
1 2 3 4 5 6 7 8 9 |
root@vWrt:~# netstat -tulnp | grep 19999 tcp 0 0 0.0.0.0:19999 0.0.0.0:* LISTEN 5294/netdata tcp 0 0 :::19999 :::* LISTEN 5294/netdata root@vWrt:~# /opt/netdata/bin/netdatacli version netdata v1.38.0-73-g5bfc81f85 root@vWrt:~# /opt/netdata/bin/netdata -W buildinfo | grep 'Install type:' Install type: kickstart-static |
こちらは kickstart.sh に再インストールオプションを付与せずとも、自動的にアップデートが正常終了しました(途中、ユーザ名云々の警告は出るものの特に影響は無し)。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 |
root@vWrt:~# wget -O /tmp/netdata-kickstart.sh https://my-netdata.io/kickstart.sh && bash /tmp/netdata-kickstart.sh --- Using /tmp/netdata-kickstart-XXXXnEmHPE as a temporary directory. --- --- Checking for existing installations of Netdata... --- [/tmp/netdata-kickstart-XXXXnEmHPE]# sh -c cat "/opt/netdata/etc/netdata/.install-type" > "/tmp/netdata-kickstart-XXXXnEmHPE/install-type" OK --- Found an existing netdata install at /opt/netdata, with installation type 'kickstart-static'. --- [/tmp/netdata-kickstart-XXXXnEmHPE]# test -x /opt/netdata/usr/libexec/netdata/netdata-updater.sh OK [/tmp/netdata-kickstart-XXXXnEmHPE]# /opt/netdata/usr/libexec/netdata/netdata-updater.sh --interactive --not-running-from-cron Tue Jun 20 13:03:07 HKT 2023 : INFO: netdata-updater.sh: Checking if a newer version of the updater script is available. date: invalid date '2023-04-07T11:19:46Z' sh: out of range Tue Jun 20 13:03:08 HKT 2023 : INFO: netdata-updater.sh: Entering /tmp/netdata-updater-XXXXEADNgb Tue Jun 20 13:03:09 HKT 2023 : INFO: netdata-updater.sh: Current Version: 00103800000073 Tue Jun 20 13:03:09 HKT 2023 : INFO: netdata-updater.sh: Latest Version: 00104000000016 Tue Jun 20 13:03:09 HKT 2023 : INFO: netdata-updater.sh: Update available ^ |.-. .-. .-. .-. . netdata | '-' '-' '-' '-' real-time performance monitoring, done right! +----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+---> (C) Copyright 2017-2023, Costa Tsaousis All rights reserved Released under GPL v3+ You are about to install netdata to this system. netdata will be installed at: /opt/netdata The following changes will be made to your system: # USERS / GROUPS User 'netdata' and group 'netdata' will be added, if not present. # LOGROTATE This file will be installed if logrotate is present. - /etc/logrotate.d/netdata # SYSTEM INIT If a supported init system is detected, appropriate configuration will be installed to allow Netdata to run as a system service. We currently support systemd, OpenRC, LSB init scripts, and traditional init.d setups, as well as having experimental support for runit. This package can also update a netdata installation that has been created with another version of it. Your netdata configuration will be retained. After installation, netdata will be (re-)started. netdata re-distributes a lot of open source software components. Check its full license at: https://github.com/netdata/netdata/blob/master/LICENSE Creating directory /opt/netdata Verifying archive integrity.. 100% MD5 checksums are OK. All good. Uncompressing netdata, the real-time performance and health monitoring system 100% --- Attempt to create user/group netdata/netadata --- Adding netdata user group ... WARNING Failed to add netdata user group ! FAILED I could not add group netdata, so no user netdata will be created as well. Netdata run as root:root --- Install logrotate configuration for netdata --- FAILED Cannot install logrotate file for netdata. --- Telemetry configuration --- You can opt out from anonymous statistics via the --disable-telemetry option, or by creating an empty file /opt/netdata/etc/netdata/.opt-out-from-anonymous-statistics --- Install netdata at system init --- ERROR: Failed to detect what type of service manager is in use. WARNING Failed to detect system service manager type. Cannot cleanly install or manage Netdata as a system service. If you are running this script in a container, this is expected and can safely be ignored. --- Install (but not enable) netdata updater tool --- Update script is located at /opt/netdata/usr/libexec/netdata/netdata-updater.sh --- creating quick links --- [/opt/netdata]# rm sbin OK '' [/opt/netdata]# ln -s bin sbin OK '' [/opt/netdata/usr]# rm bin OK '' [/opt/netdata/usr]# ln -s ../bin bin OK '' [/opt/netdata/usr]# rm sbin OK '' [/opt/netdata/usr]# ln -s ../bin sbin OK '' [/opt/netdata/usr]# rm local OK '' [/opt/netdata/usr]# ln -s . local OK '' [/opt/netdata]# rm netdata-configs OK '' [/opt/netdata]# ln -s etc/netdata netdata-configs OK '' [/opt/netdata]#rm netdata-web-files OK '' [/opt/netdata]# ln -s usr/share/netdata/web netdata-web-files OK '' [/opt/netdata]# rm netdata-plugins OK '' [/opt/netdata]# ln -s usr/libexec/netdata netdata-plugins OK '' [/opt/netdata]# rm netdata-dbs OK '' [/opt/netdata]# ln -s var/lib/netdata netdata-dbs OK '' [/opt/netdata]# rm netdata-metrics OK '' [/opt/netdata]# ln -s var/cache/netdata netdata-metrics OK '' [/opt/netdata]# rm netdata-logs OK '' [/opt/netdata]# ln -s var/log/netdata netdata-logs OK '' [/opt/netdata/etc/netdata]# rm orig OK '' [/opt/netdata/etc/netdata]# ln -s ../../usr/lib/netdata/conf.d orig OK '' --- fix permissions --- [/opt/netdata]# chmod g+rx,o+rx /opt OK '' [/opt/netdata]# find /opt/netdata -type d -exec chmod go+rx {} + OK '' [/opt/netdata]# chown -R root:root /opt/netdata/var OK '' --- changing plugins ownership and permissions --- [/opt/netdata]# chown root:root usr/libexec/netdata/plugins.d/apps.plugin OK '' [/opt/netdata]# chmod 4750 usr/libexec/netdata/plugins.d/apps.plugin OK '' [/opt/netdata]# chown root:root usr/libexec/netdata/plugins.d/perf.plugin OK '' [/opt/netdata]# chmod 4750 usr/libexec/netdata/plugins.d/perf.plugin OK '' [/opt/netdata]# chown root:root usr/libexec/netdata/plugins.d/slabinfo.plugin OK '' [/opt/netdata]# chmod 4750 usr/libexec/netdata/plugins.d/slabinfo.plugin OK '' [/opt/netdata]# chown root:root usr/libexec/netdata/plugins.d/debugfs.plugin OK '' [/opt/netdata]# chmod 4750 usr/libexec/netdata/plugins.d/debugfs.plugin OK '' [/opt/netdata]# chown root:root usr/libexec/netdata/plugins.d/ioping OK '' [/opt/netdata]# chmod 4750 usr/libexec/netdata/plugins.d/ioping OK '' [/opt/netdata]# chown root:root usr/libexec/netdata/plugins.d/cgroup-network OK '' [/opt/netdata]# chmod 4750 usr/libexec/netdata/plugins.d/cgroup-network OK '' [/opt/netdata]# chown root:root usr/libexec/netdata/plugins.d/ebpf.plugin OK '' [/opt/netdata]# chmod 4750 usr/libexec/netdata/plugins.d/ebpf.plugin OK '' [/opt/netdata]# chown root:root usr/libexec/netdata/plugins.d/nfacct.plugin OK '' [/opt/netdata]# chmod 4750 usr/libexec/netdata/plugins.d/nfacct.plugin OK '' Configure TLS certificate paths Using /etc/ssl for TLS configuration and certificates Save install options --- starting netdata --- --- Restarting netdata instance --- ERROR: Failed to detect what type of service manager is in use. Stopping all netdata threads [/opt/netdata]# stop_all_netdata ERROR: Failed to detect what type of service manager is in use. [/opt/netdata]# /sbin/service netdata stop OK '' Starting netdata using command '/opt/netdata/bin/netdata' [/opt/netdata]# /opt/netdata/bin/netdata OK '' ^ |.-. .-. .-. .-. .-. . netdata .-. .-. .-. .-. .-. .- | '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' +----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+---> [/opt/netdata]# chmod 0644 /opt/netdata/etc/netdata/netdata.conf OK '' Tue Jun 20 13:03:32 HKT 2023 : INFO: netdata-updater.sh: Switching back to /tmp/netdata-kickstart-XXXXnEmHPE OK --- Updated existing install at /opt/netdata --- --- Successfully updated existing netdata install at /opt/netdata. --- --- Not attempting to claim existing install at /opt/netdata (no claiming token provided). --- Official documentation can be found online at https://learn.netdata.cloud/docs/. Looking to monitor all of your infrastructure with Netdata? Check out Netdata Cloud athttps://app.netdata.cloud. Join our community and connect with us on: - GitHub: https://github.com/netdata/netdata/discussions - Discord: https://discord.gg/5ygS846fR6 - Our community forums: https://community.netdata.cloud/ [/root]# rm -rf /tmp/netdata-kickstart-XXXXnEmHPE OK |
ターミナルでNetdataがアップデートされたことを確認。
1 2 3 4 5 6 |
root@vWrt:~# /opt/netdata/bin/netdatacli version netdata v1.40.0-16-g7348c85c1 root@vWrt:~# netstat -tulnp | grep 19999 tcp 0 0 0.0.0.0:19999 0.0.0.0:* LISTEN 19788/netdata tcp 0 0 :::19999 :::* LISTEN 19788/netdata |
Netdata Cloudでも新しいバージョンが認識され、このデバイスへの警告は解除されました。
3)x86_64仮想マシン AlpineLinux パッケージ版Netdataの更新
最後に残ったノードは、AlpineLinuxを入れた仮想マシンのDNSサーバで、この中のNetdataはAlpineLinuxのレポジトリから入れたパッケージ版です。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
resolv9:~$ uname -a Linux resolv9 5.15.93-0-virt #1-Alpine SMP Thu, 09 Feb 2023 19:05:18 +0000 x86_64 Linux resolv9:~$ cat /etc/os-release NAME="Alpine Linux" ID=alpine VERSION_ID=3.17.1 PRETTY_NAME="Alpine Linux v3.17" HOME_URL="https://alpinelinux.org/" BUG_REPORT_URL="https://gitlab.alpinelinux.org/alpine/aports/-/issues" resolv9:~$ netstat -tulnp | grep 19999 netstat: can't scan /proc - are you root? tcp 0 0 0.0.0.0:19999 0.0.0.0:* LISTEN - tcp 0 0 :::19999 :::* LISTEN - resolv9:~$ sudo netdatacli version netdata v1.38.0 resolv9:~$ netdata -W buildinfo | grep 'Install type:' Install type: custom |
パッケージマネージャでパッケージリストを更新すると、現行版Netdataへ更新可能なことが分かりました。
1 2 3 4 5 6 7 8 9 |
resolv9:~$ sudo apk -u list | grep netdata netdata-go-plugins-0.50.0-r3 x86_64 {netdata-go-plugins} (GPL-3.0-or-later) [upgradable from: netdata-go-plugins-0.50.0-r1] netdata-go-plugins-0.53.0-r0 x86_64 {netdata-go-plugins} (GPL-3.0-or-later) [upgradable from: netdata-go-plugins-0.50.0-r1] netdata-openrc-1.40.0-r0 x86_64 {netdata} (GPL-3.0-or-later) [upgradable from: netdata-openrc-1.38.0-r0] netdata-1.40.0-r0 x86_64 {netdata} (GPL-3.0-or-later) [upgradable from: netdata-1.38.0-r0] netdata-go-plugins-0.50.0-r3 x86_64 {netdata-go-plugins} (GPL-3.0-or-later) [upgradable from: netdata-go-plugins-0.50.0-r1] netdata-go-plugins-0.53.0-r0 x86_64 {netdata-go-plugins} (GPL-3.0-or-later) [upgradable from: netdata-go-plugins-0.50.0-r1] netdata-openrc-1.40.0-r0 x86_64 {netdata} (GPL-3.0-or-later) [upgradable from: netdata-openrc-1.38.0-r0] netdata-1.40.0-r0 x86_64 {netdata} (GPL-3.0-or-later) [upgradable from: netdata-1.38.0-r0] |
パッケージマネージャで更新後、サービスを再起動するとNetdataが更新されました。
1 2 3 4 5 6 7 8 9 10 11 12 |
resolv9:~$ sudo apk upgrade resolv9:~$ sudo /usr/sbin/netdatacli version netdata v1.38.0 resolv9:~$ sudo rc-service netdata restart * Caching service dependencies ... [ ok ] * Stopping Netdata ... [ ok ] * Starting Netdata ... [ ok ] resolv9:~$ sudo /usr/sbin/netdatacli version netdata v1.40.0 |
2023年12月29日追記
パッケージマネージャを使いnetdata v1.43.2へのアップデートを試みるも、依存パッケージ(abseil-cpp系列)が見つからずエラー終了してしまいます。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
resolv9:~$ sudo apk upgrade netdata ERROR: unable to select packages: so:libabsl_base.so.2308.0.0 (no such package): required by: netdata-1.43.2-r2[so:libabsl_base.so.2308.0.0] so:libabsl_civil_time.so.2308.0.0 (no such package): required by: netdata-1.43.2-r2[so:libabsl_civil_time.so.2308.0.0] so:libabsl_hash.so.2308.0.0 (no such package): required by: netdata-1.43.2-r2[so:libabsl_hash.so.2308.0.0] so:libabsl_log_internal_check_op.so.2308.0.0 (no such package): required by: netdata-1.43.2-r2[so:libabsl_log_internal_check_op.so.2308.0.0] so:libabsl_log_internal_message.so.2308.0.0 (no such package): required by: netdata-1.43.2-r2[so:libabsl_log_internal_message.so.2308.0.0] so:libabsl_log_internal_nullguard.so.2308.0.0 (no such package): required by: netdata-1.43.2-r2[so:libabsl_log_internal_nullguard.so.2308.0.0] so:libabsl_status.so.2308.0.0 (no such package): required by: netdata-1.43.2-r2[so:libabsl_status.so.2308.0.0] so:libabsl_strings.so.2308.0.0 (no such package): required by: netdata-1.43.2-r2[so:libabsl_strings.so.2308.0.0] so:libabsl_strings_internal.so.2308.0.0 (no such package): required by: netdata-1.43.2-r2[so:libabsl_strings_internal.so.2308.0.0] so:libabsl_time_zone.so.2308.0.0 (no such package): required by: netdata-1.43.2-r2[so:libabsl_time_zone.so.2308.0.0] so:libprotobuf.so.24 (no such package): required by: netdata-1.43.2-r2[so:libprotobuf.so.24] |
このライブラリが収録されているレポジトリ、 edge/main が有効になっていないためでした(netdataパッケージ自身は edge/community に収録されており、こちらは有効な参照先にしています)。早速、レポジトリファイルを修正。
1 2 3 4 5 6 |
#/media/cdrom/apks http://ftp.udx.icscoe.jp/Linux/alpine/v3.17/main http://ftp.udx.icscoe.jp/Linux/alpine/v3.17/community http://ftp.udx.icscoe.jp/Linux/alpine/edge/main <--コメント外す http://ftp.udx.icscoe.jp/Linux/alpine/edge/community #http://ftp.udx.icscoe.jp/Linux/alpine/edge/testing |
パッケージマネージャを更新後、無事にアップグレードすることができました。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
resolv9:~$ sudo apk update fetch http://ftp.udx.icscoe.jp/Linux/alpine/v3.17/main/x86_64/APKINDEX.tar.gz fetch http://ftp.udx.icscoe.jp/Linux/alpine/v3.17/community/x86_64/APKINDEX.tar.gz fetch http://ftp.udx.icscoe.jp/Linux/alpine/edge/main/x86_64/APKINDEX.tar.gz fetch http://ftp.udx.icscoe.jp/Linux/alpine/edge/community/x86_64/APKINDEX.tar.gz v3.17.6-43-g71d71117727 [http://ftp.udx.icscoe.jp/Linux/alpine/v3.17/main] v3.17.6-43-g71d71117727 [http://ftp.udx.icscoe.jp/Linux/alpine/v3.17/community] v20231219-543-gc28c890c445 [http://ftp.udx.icscoe.jp/Linux/alpine/edge/main] v20231219-549-g7244ecec167 [http://ftp.udx.icscoe.jp/Linux/alpine/edge/community] OK: 40606 distinct packages available resolv9:~$ sudo apk upgrade -略- resolv9:~$ sudo rc-service netdata restart * Caching service dependencies ... [ ok ] * Stopping Netdata ... [ ok ] * Starting Netdata ... [ ok ] resolv9:~$ sudo netdatacli version netdata v1.43.2 |
まとめ
以上でNetdata Cloudに登録している全てのノードが、現行版へアップデートされました。
結論として、アーキテクチャがやや特殊で、カーネルがやや古いNanoPi R2Sが少しイレギュラーでしたが、それ以外は通常のアップデート操作が問題無くエージェントの更新できることが分かりました。