「RaspberryPiで新型コロナウイルスの解析」の版間の差分
(→具合) |
(→具合) |
||
22行目: | 22行目: | ||
Status Monitor COVID-19<br /> | Status Monitor COVID-19<br /> | ||
− | + | 同じことを7回書いてるので400行程度でいける予感 | |
=='''環境'''== | =='''環境'''== |
2021年5月5日 (水) 08:06時点における版
新型コロナウイルスの解析プロジェクトに参加してみます。
COVID-19-01 Rosetta@home 3B+
COVID-19-02 Rosetta@home 3B
COVID-19-03 Rosetta@home 3B
COVID-19-04 World Community Grid 2B
COVID-19-05 World Community Grid 2B
COVID-19-06 World Community Grid Zero
COVID-19-07 World Community Grid Zero
COVID-19-08 Folding@home 4B
COVID-19-00 JSON Server Netdata 2B
具合
Rosetta@home
1GBモデル ZRAM監視1.2GB辺り境界にグローバル設定コア数制御で安定する予感
Status Monitor COVID-19
同じことを7回書いてるので400行程度でいける予感
環境
モデル | Raspberry Pi 全種 |
OS | Raspberry Pi OS Lite (32bit) 2020-08-20 Raspberry Pi OS Lite (arm64) 2020-08-20 |
ストレージ | microSDHC 16GB CLASS10 |
発熱対策 | ヒートシンク 40×40×25, ALPHA 45×45×50 銅サイコロ 20×20×20 熱伝導性両面テープ 0.6W/m・K 200x300 |
リモート操作 | Windows10, SSH |
下調べ
Folding@home
Folding@home - Wikipedia
Manual installation (advanced) - Folding@home
ワシントン大学
Rosetta@home
Rosetta@home - Wikipedia
Running Rosetta (COVID-19 workunits) on Raspberry Pi 3B+ ... - reddit.com
Raspberry Pi 3 Model BとRaspbian Buster LiteでRosetta@home - Pastebin.com
ワシントン大学
World Community Grid
World Community Grid - Wikipedia
Volunteer your Raspberry Pi to IBM's World Community Grid - Raspberry Pi
IBM
TN-Grid
TN-Grid
トレント大学
SiDock@home
SiDock@home
ロシア科学アカデミー
Forum
Folding@home | https://foldingforum.org/ |
Rosetta@home | https://boinc.bakerlab.org/rosetta/forum_index.php |
World Community Grid | https://www.worldcommunitygrid.org/forums/wcg/index |
TN-Grid | https://gene.disi.unitn.it/test/forum_index.php |
SiDock@home | https://www.sidock.si/sidock/forum_index.php |
Applications
Folding@home | https://foldingathome.org/alternative-downloads/ |
Rosetta@home | https://boinc.bakerlab.org/rosetta/apps.php |
World Community Grid | https://www.worldcommunitygrid.org/help/viewTopic.do?shortName=minimumreq |
TN-Grid | https://gene.disi.unitn.it/test/apps.php |
SiDock@home | https://www.sidock.si/sidock/apps.php |
Server Status
Folding@home | - |
Rosetta@home | https://boinc.bakerlab.org/rosetta/server_status.php |
World Community Grid | https://www.worldcommunitygrid.org/stat/viewGlobal.do |
TN-Grid | https://gene.disi.unitn.it/test/server_status.php |
SiDock@home | https://www.sidock.si/sidock/server_status.php |
統計 2021/03/20
Aggregate Teams Summary - Folding@Home Stats - EXTREME Overclocking
Users | Computers | |
Folding@home | 837,120 | - |
Rosetta@home | 1,363,958 | 4,378,710 |
World Community Grid | 798,111 | 6,856,536 |
TN-Grid | 2,755 | 50,772 |
SiDock@home | 2,194 | 8,443 |
Cross-project identification - BOINC
複数のプロジェクトを設定する場合、登録アカウントのメールアドレスを同じにしておくとプロジェクト横断の統計機能が使える
Free-DC
BOINC Combined Statistics
BOINCstats
ARM非対応
BOINC@TACC テキサス大学
GPUGRID ポンペウ・ファブラ大学
COVID-PHYM Ibercivis
Quarantine@Home Aleph-1 Foundation
クローン
Fold for Covid balena
動作環境
プラットフォーム
Folding@home … FAH
Rosetta@home … BOINC
World Community Grid … BOINC
TN-Grid … BOINC
SiDock@home …
必要なCPU
Folding@home … ARMv8 (64bit)
Rosetta@home … ARMv8 (64bit)
World Community Grid … 制限無し
TN-Grid … 制限無し
SiDock@home …
必要なメモリ
Folding@home … 512MB~
Rosetta@home … 1000MB程度~
World Community Grid … 250MB程度~
TN-Grid … 70MB程度~
SiDock@home …
多分動くモデル
1A | 1A+ | 3A+ | 1B | 1B+ | 2B | 3B | 3B+ | 4B | Zero | |
CPU ARMv | 6 | 6 | 8 | 6 | 6 | 7,8 | 8 | 8 | 8 | 6 |
Folding@home | ▲ | ▲ | ▲ | 〇 | ||||||
Rosetta@home | ? | 〇 | 〇 | 〇 | ||||||
World Community Grid | 〇 | 〇 | 〇 | 〇 | 〇 | 〇 | 〇 | 〇 | 〇 | 〇 |
TN-Grid | ▲ | ▲ | 〇 | ▲ | ▲ | ▲ | 〇 | 〇 | 〇 | ▲ |
SiDock@home |
▲: タイムアウトするかも
多分動くOS
Folding@home … Raspberry Pi OS Lite (arm64)
Rosetta@home … Raspberry Pi OS Lite (arm64) または (32bit) + 64bitカーネル設定
World Community Grid … 制限無し
TN-Grid … 制限無し
SiDock@home …
CPU温度の限界点
70°C~ … ソフト温度制限 (3A+, 3B+のみ, 最高設定)
80°C~ … サーマルスロットリング
85°C~ … CPU, GPU停止
リモート環境
Raspberry PiをSSHリモート操作環境にする
mDNS
Windows10使用
iTunes - Apple(日本)
ほかのバージョンをお探しですか? > Windows > ダウンロード
WinRARでiTunes64Setup.exeからBonjour64.msiを取り出し
インストール
SSHクライアント
Windows10 Tera Term使用
https://forest.watch.impress.co.jp/library/software/utf8teraterm/
インストール
OSインストール
Raspberry Pi Imager
Raspberry Pi OS Lite (arm64) の場合イメージが無いのでダウンロード
Index of /raspios_lite_arm64/images
Raspberry Pi Imager > Use customでイメージを選択し焼き込み
ヘッドレスセットアップ
ヘッドレスセットアップ - Google 検索
ヘッドレスセットアップ A+ - Google 検索
rootディレクトリにssh空ファイル作成
電源ON
SSH接続
ホスト: raspberrypi.local ユーザ名: pi パスフレーズ: raspberry
確認
$ more /proc/device-tree/model | sed "s/$/\n/";getconf LONG_BIT | sed "s/^/os: /" | sed "s/$/bit/";arch | sed "s/^/kernel: /"
Raspberry Pi 3 Model B Plus Rev 1.3
os: 32bit
kernel: aarch64
64bitカーネル
Raspberry Pi OS Lite (32bit) + 64bitカーネル設定 の場合
ARMv8 (64bit)のみ設定可
$ sudo nano /boot/config.txt
末尾に追記
arm_64bit=1 gpu_mem=16
保存: Ctrl + o > リターン
終了: Ctrl + x
$ sudo reboot
expand
$ sudo raspi-config Advanced Options > Expand Filesystem > <Ok> > tab > <Finish> > reboot<Yes>
locale
$ sudo raspi-config Localisation Options > Change Locale > [*] en_GB.UTF-8 UTF-8 [*] ja_JP.UTF-8 UTF-8 > スペースキー > tab > <Ok> > ja_JP.UTF-8 リターン > tab > <Finish> $ sudo reboot
timezone
$ sudo raspi-config Localisation Options > Change Time Zone > アジア > 東京 > tab > <Finish> $ sudo reboot
hostname
$ sudo raspi-config Network Options > Hostname > <了解>
変更
covid-19-01
tab > <了解> > tab > <Finish> > <はい>
SSH接続
ホスト: covid-19-01.local ユーザ名: pi パスフレーズ: raspberry
timesyncd
設定
$ sudo nano /etc/systemd/timesyncd.conf
修正
[Time] NTP=ntp.nict.jp #FallbackNTP=0.debian.pool.ntp.org 1.debian.pool.ntp.org 2.debian.pool.ntp.org 3.debian.pool.ntp.org #RootDistanceMaxSec=5 #PollIntervalMinSec=32 #PollIntervalMaxSec=2048
保存: Ctrl + o > リターン
終了: Ctrl + x
起動
$ sudo timedatectl set-ntp true
確認
$ timedatectl status
upgrade
$ sudo apt update $ sudo apt upgrade
zram
$ sudo nano /usr/bin/zram.sh
設定
#!/bin/bash cores=$(nproc --all) modprobe zram num_devices=$cores swapoff -a totalmem=`free | grep -e "^Mem:" | awk '{print $2}'` mem=$(( ($totalmem * 2 / $cores)* 1024 )) modprobe deflate modprobe zlib modprobe lz4hc_compress core=0 while [ $core -lt $cores ]; do echo deflate > /sys/block/zram$core/comp_algorithm || echo zlib > /sys/block/zram$core/comp_algorithm || echo lz4hc > /sys/block/zram$core/comp_algorithm || echo lz4 > /sys/block/zram$core/comp_algorithm # not sure which one this kernel has echo $mem > /sys/block/zram$core/disksize mkswap /dev/zram$core swapon --discard -p 5 /dev/zram$core # reclaim memory better let core=core+1 done
保存: Ctrl + o > リターン
終了: Ctrl + x
$ sudo chmod +x /usr/bin/zram.sh $ sudo nano /etc/rc.local
末尾のexit 0手前に追記
/usr/bin/zram.sh &
保存: Ctrl + o > リターン
終了: Ctrl + x
$ sudo reboot
確認
$ zramctl
swap
$ sudo nano /etc/dphys-swapfile
変更
#CONF_SWAPSIZE=100 CONF_SWAPSIZE=2048
保存: Ctrl + o > リターン
終了: Ctrl + x
$ sudo systemctl start dphys-swapfile $ sudo systemctl enable dphys-swapfile $ sudo reboot
確認
$ sudo swapon --show
サービスは動いてるけどswapが無い
確認
$ systemctl list-unit-files --type=service
rc.localで起動してみる
設定
$ sudo systemctl stop dphys-swapfile $ sudo systemctl disable dphys-swapfile $ sudo nano /etc/rc.local
zramの下に追記
/usr/bin/zram.sh & systemctl start dphys-swapfile
保存: Ctrl + o > リターン
終了: Ctrl + x
$ sudo reboot
確認
$ sudo swapon --show
service
$ sudo systemctl stop rsyslog $ sudo systemctl disable rsyslog
$ sudo systemctl stop hciuart bluetooth $ sudo systemctl disable hciuart bluetooth
journald
$ sudo nano /etc/systemd/journald.conf
末尾に追記
Storage=none
保存: Ctrl + o > リターン
終了: Ctrl + x
overclocking
documentation/overclocking.md at master · raspberrypi/documentation · GitHub
$ sudo nano /boot/config.txt
末尾に追記
Zero のみ
arm_freq = 1100 over_voltage = 8 sdram_freq = 500 sdram_over_voltage = 2 force_turbo = 1 boot_delay = 1
1B+ のみ
arm_freq=1000 core_freq=500 sdram_freq=600 over_voltage=6
2B のみ ※安定しない
arm_freq=1000 core_freq=500 sdram_freq=500 over_voltage=2
3B のみ
arm_freq=1350 core_freq=500 over_voltage=4
3B+ のみ
temp_soft_limit=70
4B のみ
over_voltage=2 arm_freq=1750
保存: Ctrl + o > リターン
終了: Ctrl + x
$ sudo reboot
確認
$ vcgencmd get_config arm_freq
Folding@home
FAHClient
Username: GGGGGG Passkey: FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF Passkeyメールが届く
インストール
Alternative Downloads - Folding@home
$ wget https://download.foldingathome.org/releases/public/release/fahclient/debian-stable-arm64/v7.6/fahclient_7.6.21_arm64.deb $ sudo dpkg -i fahclient_7.6.21_arm64.deb
fahclientを設定しています
Folding@home User Name: Anonymous <tab> <OK>
Folding@home Team Number: 0 <tab> <OK>
Folding@home Passkey: FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF <tab> <OK>
light or medium or full: full <リターン>
Should FAHClient be automatically started?: <OK>
設定
$ sudo nano /etc/fahclient/config.xml
設定
192.168.1.0/24 はプライベートIPアドレス
<config> <!-- Client Control --> <fold-anon v='true'/> <!-- Folding Slot Configuration --> <cause v='COVID_19'/> <gpu v='false'/> <!-- HTTP Server --> <allow v='127.0.0.1 192.168.1.0/24'/> <!-- Network --> <proxy v=':8080'/> <!-- Remote Command Server --> <command-allow-no-pass v='127.0.0.1 192.168.1.0/24'/> <!-- Slot Control --> <power v='full'/> <!-- User Information --> <passkey v='FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF'/> <!-- Web Server --> <web-allow v='127.0.0.1 192.168.1.0/24'/> <!-- Folding Slots --> <slot id='0' type='CPU'/> </config>
再起動
$ sudo reboot
確認
$ htop
終了: Ctrl + c
CPU温度
$ while true; do vcgencmd measure_temp; sleep 1s; done
終了: Ctrl + c
FAHControl
Alternative Downloads - Folding@home
Windows10使用
スタートメニュー > Folding@home > FAHControl
FAHControl > 左下: Clients +Add > Connection
設定
Name: COVID-19 Hostname or IP: covid-19-06.local Port: 36330
WEB CONTROL
http://covid-19-06.local:7396
Rosetta@home
インストール
$ sudo apt install boinc-client boinctui $ sudo nano /var/lib/boinc-client/cc_config.xml
設定
<cc_config> <log_flags> <task>1</task> <file_xfer>1</file_xfer> <sched_ops>1</sched_ops> </log_flags> <options> <alt_platform>aarch64-unknown-linux-gnu</alt_platform> <allow_remote_gui_rpc>1</allow_remote_gui_rpc> </options> </cc_config>
保存: Ctrl + o > リターン
終了: Ctrl + x
$ sudo nano /var/lib/boinc-client/global_prefs_override.xml
設定
<!-- This configuration file global_prefs_override.xml for the BOINC core client can be used to override global preferences locally. For a complete list of all preferences which can be overridden see: http://boinc.berkeley.edu/trac/wiki/PrefsOverride --> <global_preferences> <run_on_batteries>1</run_on_batteries> <run_if_user_active>1</run_if_user_active> <run_gpu_if_user_active>1</run_gpu_if_user_active> <suspend_cpu_usage>0.000000</suspend_cpu_usage> <start_hour>0.000000</start_hour> <end_hour>0.000000</end_hour> <net_start_hour>0.000000</net_start_hour> <net_end_hour>0.000000</net_end_hour> <leave_apps_in_memory>0</leave_apps_in_memory> <confirm_before_connecting>0</confirm_before_connecting> <hangup_if_dialed>0</hangup_if_dialed> <dont_verify_images>0</dont_verify_images> <work_buf_min_days>2.000000</work_buf_min_days> <work_buf_additional_days>0.200000</work_buf_additional_days> <max_ncpus_pct>75.000000</max_ncpus_pct> <cpu_scheduling_period_minutes>60.000000</cpu_scheduling_period_minutes> <disk_interval>300.000000</disk_interval> <disk_max_used_gb>0.000000</disk_max_used_gb> <disk_max_used_pct>100.000000</disk_max_used_pct> <disk_min_free_gb>0.000000</disk_min_free_gb> <vm_max_used_pct>90.000000</vm_max_used_pct> <ram_max_used_busy_pct>200.000000</ram_max_used_busy_pct> <ram_max_used_idle_pct>200.000000</ram_max_used_idle_pct> <max_bytes_sec_up>0.000000</max_bytes_sec_up> <max_bytes_sec_down>0.000000</max_bytes_sec_down> <cpu_usage_limit>100.000000</cpu_usage_limit> <daily_xfer_limit_mb>0.000000</daily_xfer_limit_mb> <daily_xfer_period_days>0</daily_xfer_period_days> </global_preferences>
保存: Ctrl + o > リターン
終了: Ctrl + x
$ sudo nano /etc/boinc-client/gui_rpc_auth.cfg
適当なパスワードを平文で書く AAAAAAAAA
保存: Ctrl + o > リターン
終了: Ctrl + x
$ sudo reboot
アカウント
Rosetta@home
Join Rosetta@home > Sign Up > アカウントを作成する
名前: GGGGGG Eメール: BBB@BBB.BBB パスワード: CCCCCCCCC
アカウント・キーの確認
アカウント・キー
アカウント・キー: DDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
設定
$ boinccmd --passwd AAAAAAAAA --project_attach https://boinc.bakerlab.org/rosetta/ DDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
確認
$ htop
終了: Ctrl + c
$ boinctui host 127.0.0.1 port 31416 pwd AAAAAAAAA
boinctuiメモ
Projects > Rosetta@home > Update project: プロジェクトの更新 Suspend project: プロジェクトの一時停止 Resume project: プロジェクトの再開 No new tasks: 新しいタスクの取得中止 Allow new tasks: 新しいタスクの取得許可 Reset project: 現在のタスクの削除とプロジェクトの更新 Detach project: プロジェクトのデタッチ
Task > Suspend task: タスクの一時停止 Resume task: タスクの再開 Abort task: タスクの完全停止
Boinccmd メモ
再読み込み 構成ファイル $ boinccmd --passwd AAAAAAAAA --read_cc_config 再読み込み グローバル設定 $ boinccmd --passwd AAAAAAAAA --read_global_prefs_override
プロジェクトを更新 $ boinccmd --passwd AAAAAAAAA --project https://boinc.bakerlab.org/rosetta/ update プロジェクトを停止 $ boinccmd --passwd AAAAAAAAA --project https://boinc.bakerlab.org/rosetta/ suspend プロジェクトを再開 $ boinccmd --passwd AAAAAAAAA --project https://boinc.bakerlab.org/rosetta/ resume
CPU温度
$ while true; do vcgencmd measure_temp; sleep 1s; done
終了: Ctrl + c
World Community Grid
インストール
$ sudo apt install boinc-client boinctui $ sudo nano /var/lib/boinc-client/cc_config.xml
設定
<cc_config> <log_flags> <task>1</task> <file_xfer>1</file_xfer> <sched_ops>1</sched_ops> </log_flags> <options> <alt_platform>arm-unknown-linux-gnueabihf</alt_platform> <allow_remote_gui_rpc>1</allow_remote_gui_rpc> </options> </cc_config>
保存: Ctrl + o > リターン
終了: Ctrl + x
$ sudo nano /var/lib/boinc-client/global_prefs_override.xml
設定
<!-- This configuration file global_prefs_override.xml for the BOINC core client can be used to override global preferences locally. For a complete list of all preferences which can be overridden see: http://boinc.berkeley.edu/trac/wiki/PrefsOverride --> <global_preferences> <run_on_batteries>1</run_on_batteries> <run_if_user_active>1</run_if_user_active> <run_gpu_if_user_active>1</run_gpu_if_user_active> <suspend_cpu_usage>0.000000</suspend_cpu_usage> <start_hour>0.000000</start_hour> <end_hour>0.000000</end_hour> <net_start_hour>0.000000</net_start_hour> <net_end_hour>0.000000</net_end_hour> <leave_apps_in_memory>0</leave_apps_in_memory> <confirm_before_connecting>0</confirm_before_connecting> <hangup_if_dialed>0</hangup_if_dialed> <dont_verify_images>0</dont_verify_images> <work_buf_min_days>2.000000</work_buf_min_days> <work_buf_additional_days>0.200000</work_buf_additional_days> <max_ncpus_pct>100.000000</max_ncpus_pct> <cpu_scheduling_period_minutes>60.000000</cpu_scheduling_period_minutes> <disk_interval>300.000000</disk_interval> <disk_max_used_gb>0.000000</disk_max_used_gb> <disk_max_used_pct>100.000000</disk_max_used_pct> <disk_min_free_gb>0.000000</disk_min_free_gb> <vm_max_used_pct>90.000000</vm_max_used_pct> <ram_max_used_busy_pct>100.000000</ram_max_used_busy_pct> <ram_max_used_idle_pct>100.000000</ram_max_used_idle_pct> <max_bytes_sec_up>0.000000</max_bytes_sec_up> <max_bytes_sec_down>0.000000</max_bytes_sec_down> <cpu_usage_limit>100.000000</cpu_usage_limit> <daily_xfer_limit_mb>0.000000</daily_xfer_limit_mb> <daily_xfer_period_days>0</daily_xfer_period_days> </global_preferences>
保存: Ctrl + o > リターン
終了: Ctrl + x
$ sudo nano /etc/boinc-client/gui_rpc_auth.cfg
適当なパスワードを平文で書く AAAAAAAAA
保存: Ctrl + o > リターン
終了: Ctrl + x
$ sudo reboot
アカウント
World Community Grid - ホーム
いますぐ参加 > サインアップ 電子メールアドレス: BBB@BBB.BBB パスワード: CCCCCCCCC プロジェクトを選択します > OpenPandemics-COVID-19 以降適当に 確認メールが届く
アカウント・キーの確認
World Community Grid - マイ・プロファイル
アカウント・キー: EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
設定
$ boinccmd --passwd AAAAAAAA --project_attach http://www.worldcommunitygrid.org EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
確認
$ htop
終了: Ctrl + c
$ boinctui host 127.0.0.1 port 31416 pwd AAAAAAAAA
boinctuiメモ
Projects > World Community Grid > Update project: プロジェクトの更新 Suspend project: プロジェクトの一時停止 Resume project: プロジェクトの再開 No new tasks: 新しいタスクの取得中止 Allow new tasks: 新しいタスクの取得許可 Reset project: 現在のタスクの削除とプロジェクトの更新 Detach project: プロジェクトのデタッチ
Task > Suspend task: タスクの一時停止 Resume task: タスクの再開 Abort task: タスクの完全停止
Boinccmd メモ
再読み込み 構成ファイル $ boinccmd --passwd AAAAAAAAA --read_cc_config 再読み込み グローバル設定 $ boinccmd --passwd AAAAAAAAA --read_global_prefs_override
プロジェクトを更新 $ boinccmd --passwd AAAAAAAAA --project http://www.worldcommunitygrid.org update プロジェクトを停止 $ boinccmd --passwd AAAAAAAAA --project http://www.worldcommunitygrid.org suspend プロジェクトを再開 $ boinccmd --passwd AAAAAAAAA --project http://www.worldcommunitygrid.org resume
CPU温度
$ while true; do vcgencmd measure_temp; sleep 1s; done
終了: Ctrl + c
TN-Grid
インストール
$ sudo apt install boinc-client boinctui $ sudo nano /var/lib/boinc-client/cc_config.xml
設定
<cc_config> <log_flags> <task>1</task> <file_xfer>1</file_xfer> <sched_ops>1</sched_ops> </log_flags> <options> <alt_platform>arm-unknown-linux-gnueabihf</alt_platform> <allow_remote_gui_rpc>1</allow_remote_gui_rpc> </options> </cc_config>
保存: Ctrl + o > リターン
終了: Ctrl + x
$ sudo nano /var/lib/boinc-client/global_prefs_override.xml
設定
<!-- This configuration file global_prefs_override.xml for the BOINC core client can be used to override global preferences locally. For a complete list of all preferences which can be overridden see: http://boinc.berkeley.edu/trac/wiki/PrefsOverride --> <global_preferences> <run_on_batteries>1</run_on_batteries> <run_if_user_active>1</run_if_user_active> <run_gpu_if_user_active>1</run_gpu_if_user_active> <suspend_cpu_usage>0.000000</suspend_cpu_usage> <start_hour>0.000000</start_hour> <end_hour>0.000000</end_hour> <net_start_hour>0.000000</net_start_hour> <net_end_hour>0.000000</net_end_hour> <leave_apps_in_memory>0</leave_apps_in_memory> <confirm_before_connecting>0</confirm_before_connecting> <hangup_if_dialed>0</hangup_if_dialed> <dont_verify_images>0</dont_verify_images> <work_buf_min_days>2.000000</work_buf_min_days> <work_buf_additional_days>0.200000</work_buf_additional_days> <max_ncpus_pct>75.000000</max_ncpus_pct> <cpu_scheduling_period_minutes>60.000000</cpu_scheduling_period_minutes> <disk_interval>300.000000</disk_interval> <disk_max_used_gb>0.000000</disk_max_used_gb> <disk_max_used_pct>100.000000</disk_max_used_pct> <disk_min_free_gb>0.000000</disk_min_free_gb> <vm_max_used_pct>90.000000</vm_max_used_pct> <ram_max_used_busy_pct>100.000000</ram_max_used_busy_pct> <ram_max_used_idle_pct>100.000000</ram_max_used_idle_pct> <max_bytes_sec_up>0.000000</max_bytes_sec_up> <max_bytes_sec_down>0.000000</max_bytes_sec_down> <cpu_usage_limit>100.000000</cpu_usage_limit> <daily_xfer_limit_mb>0.000000</daily_xfer_limit_mb> <daily_xfer_period_days>0</daily_xfer_period_days> </global_preferences>
保存: Ctrl + o > リターン
終了: Ctrl + x
$ sudo nano /etc/boinc-client/gui_rpc_auth.cfg
適当なパスワードを平文で書く AAAAAAAAA
保存: Ctrl + o > リターン
終了: Ctrl + x
$ sudo reboot
アカウント
新しいアカウントを作成
Invitation Code: science@tn 名前: GGGGGG Eメール: BBB@BBB.BBB パスワード: CCCCCCCCC
アカウント・キーの確認
アカウント・キー
アカウント・キー: HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
設定
$ boinccmd --passwd AAAAAAAAA --project_attach http://gene.disi.unitn.it/test/ HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
確認
$ htop
終了: Ctrl + c
$ boinctui host 127.0.0.1 port 31416 pwd AAAAAAAAA
boinctuiメモ
Projects > TN-Grid Platform > Update project: プロジェクトの更新 Suspend project: プロジェクトの一時停止 Resume project: プロジェクトの再開 No new tasks: 新しいタスクの取得中止 Allow new tasks: 新しいタスクの取得許可 Reset project: 現在のタスクの削除とプロジェクトの更新 Detach project: プロジェクトのデタッチ
Task > Suspend task: タスクの一時停止 Resume task: タスクの再開 Abort task: タスクの完全停止
Boinccmd メモ
再読み込み 構成ファイル $ boinccmd --passwd AAAAAAAAA --read_cc_config 再読み込み グローバル設定 $ boinccmd --passwd AAAAAAAAA --read_global_prefs_override
プロジェクトを更新 $ boinccmd --passwd AAAAAAAAA --project http://gene.disi.unitn.it/test/ update プロジェクトを停止 $ boinccmd --passwd AAAAAAAAA --project http://gene.disi.unitn.it/test/ suspend プロジェクトを再開 $ boinccmd --passwd AAAAAAAAA --project http://gene.disi.unitn.it/test/ resume
CPU温度
$ while true; do vcgencmd measure_temp; sleep 1s; done
終了: Ctrl + c
SiDock@home
Boinc
BOINCプラットフォームのみ
Boinc Manager
Install BOINC
Windows10使用
設定
ファイル > コンピュータの選択 計算機名(ホスト名): covid-19-01 パスワード: AAAAAAAAA
リンク修正
BOINC Managerを終了
BOINC Managerのアイコンを右クリック > プロパティ
リンク先: "C:\Program Files\BOINC\boincmgr.exe" -n covid-19-01 -p AAAAAAAAA
BOINC Managerを起動
チームに参加
Rosetta@home
rosetta@raspberrypi.linux.5ch
スクリーンセーバー 停止
スクリーンセーバー 設定 - Google 検索
BoincView
BOINC add-on software
BoincView
Windows10使用
設定
ダウンロード解凍し、C:\Program Files (x86)に配置、起動
登録 > +アイコン
Name: COVID-19-01 Get data via network acess: ✔ Hostname: covid-19-01 31416 BOINC password: AAAAAAAAA Apply
BoincTasks
BOINC add-on software
BoincTasks
Windows10使用
設定
計算機tab選択 > メニューの計算機 > 計算機を追加
計算機: COVID-19-01 IPアドレス: covid-19-01.local ポート: 31416 パスワード: AAAAAAAAA
延命化
fstab
$ sudo nano /etc/fstab
末尾に追記
tmpfs /tmp tmpfs defaults,noatime,nodiratime,mode=1777 0 0
保存: Ctrl + o リターン
終了: Ctrl + x
$ sudo reboot
確認
$ df -h
folder2ram
GitHub - bobafetthotmail/folder2ram
$ sudo wget -O /sbin/folder2ram https://raw.githubusercontent.com/bobafetthotmail/folder2ram/master/debian_package/sbin/folder2ram $ sudo chmod +x /sbin/folder2ram $ sudo folder2ram -configure リターン $ sudo nano /etc/folder2ram/folder2ram.conf
末尾に追記
boinc-client/slots BOINCプラットフォームのみ
tmpfs /var/log tmpfs /var/tmp tmpfs /var/spool tmpfs /var/lib/boinc-client/slots
保存: Ctrl + o > リターン
終了: Ctrl + x
$ sudo folder2ram -mountall $ sudo folder2ram -enablesystemd $ sudo reboot
確認
$ df -h
省電力化
HDMI
$ sudo nano /etc/rc.local
末尾のexit 0手前に追記
tvservice --off
保存: Ctrl + o > リターン
終了: Ctrl + x
$ sudo reboot
Bluetooth
$ sudo nano /boot/config.txt
末尾に追記
dtoverlay=disable-bt
保存: Ctrl + o > リターン
終了: Ctrl + x
$ sudo reboot
Wi-Fi
$ sudo nano /boot/config.txt
末尾に追記
dtoverlay=disable-wifi
保存: Ctrl + o > リターン
終了: Ctrl + x
$ sudo reboot
USB
GitHub - mvp/uhubctl
Raspberry Pi turns power off on all ports, not just the one I specified
4Bのみ
$ sudo rpi-eeprom-update
全種
$ sudo apt install libusb-1.0-0-dev git $ cd ~ $ git clone https://github.com/mvp/uhubctl $ cd uhubctl $ make $ sudo make install
$ sudo nano /etc/rc.local
末尾のexit 0手前に追記
1B+, 2B, 3B, 3B+ のみ
uhubctl -l 1-1 -p 2 -a 0
4B のみ
uhubctl -l 1-1 -a 0
保存: Ctrl + o > リターン
終了: Ctrl + x
$ sudo reboot
LED消灯
firmware/README at master · raspberrypi/firmware · GitHub
ファームウェア更新
$ sudo rpi-update $ sudo reboot
設定
$ sudo nano /boot/config.txt
末尾に追記
4Bのみ
dtoverlay=act-led dtparam=act_led_trigger=none dtparam=act_led_activelow=off dtparam=pwr_led_trigger=none dtparam=pwr_led_activelow=off dtparam=eth_led0=4 dtparam=eth_led1=4
3B+のみ
dtoverlay=act-led dtparam=act_led_trigger=none dtparam=act_led_activelow=off dtparam=pwr_led_trigger=none dtparam=pwr_led_activelow=off dtparam=eth_led0=14 dtparam=eth_led1=14
3Bのみ
設定ない?
3A+のみ
dtoverlay=act-led dtparam=act_led_trigger=none dtparam=act_led_activelow=off dtparam=pwr_led_trigger=none dtparam=pwr_led_activelow=off
2B, 1B+, 1B, 1A+, 1Aのみ
dtparam=act_led_trigger=none dtparam=act_led_activelow=off dtparam=pwr_led_trigger=none dtparam=pwr_led_activelow=off
Zeroのみ
dtparam=act_led_trigger=none dtparam=act_led_activelow=on
保存: Ctrl + o > リターン
終了: Ctrl + x
$ sudo reboot
CPU使用率制限
インストール
$ sudo apt install cpulimit $ cpulimit -h
確認 Rosetta@home
$ ps -eo cmd
CMD ../../projects/boinc.bakerlab.org_rosetta/rosetta_4.20_aarch64-unknown-linux-gnu ....
テスト
$ sudo cpulimit -e rosetta_4.20_aarch64-unknown-linux-gnu -l 65
終了: Ctrl + c
確認 World Community Grid
$ ps -eo cmd
CMD ../../projects/www.worldcommunitygrid.org/wcgrid_opn1_autodock_7.17_arm-unknown-linux-gnueabihf ....
テスト
$ sudo cpulimit -e wcgrid_opn1_autodock_7.17_arm-unknown-linux-gnueabihf -l 65
終了: Ctrl + c
確認 TN-Grid
$ ps -eo cmd
CMD ../../projects/gene.disi.unitn.it_test/gene_pcim_v1.10_armv6zk_vfp ....
テスト
$ sudo cpulimit -e gene_pcim_v1.10_armv6zk_vfp -l 65
終了: Ctrl + c
確認 SiDock@home
設定
$ sudo nano /etc/rc.local
末尾のexit 0手前に追記
cpulimit -e rosetta_4.20_aarch64-unknown-linux-gnu -l 65 -b cpulimit -e wcgrid_opn1_autodock_7.17_arm-unknown-linux-gnueabihf -l 65 -b cpulimit -e gene_pcim_v1.10_armv6zk_vfp -l 65 -b
保存: Ctrl + o > リターン
終了: Ctrl + x
$ sudo reboot
SMTPクライアント
Gmailの二段階認証を設定
アプリパスワードを発行
インストール
$ sudo apt install msmtp msmtp-mta
設定
$ sudo nano /etc/msmtprc
XOAUTH2
# Set default values for all following accounts. defaults tls on tls_starttls on tls_certcheck off auth plain logfile ~/.msmtp.log # Gmail account gmail host smtp.gmail.com port 587 from *****@gmail.com user ***** password アプリパスワード # Set a default account account default : gmail
保存: Ctrl + o > リターン
終了: Ctrl + x
変更
$ sudo chmod 0644 /etc/msmtprc
送信テスト
$ echo "Subject: test" | sendmail -v *****@gmail.com
ログ
$ sudo nano ~/.msmtp.log
終了: Ctrl + x
自動アップデート
インストール
$ sudo apt install unattended-upgrades
設定
$ sudo nano /etc/apt/apt.conf.d/50unattended-upgrades
修正
セキュリティーアップデート
Unattended-Upgrade::Origins-Pattern { // Codename based matching: // This will follow the migration of a release through different // archives (e.g. from testing to stable and later oldstable). // Software will be the latest available for the named release, // but the Debian release itself will not be automatically upgraded. // "origin=Debian,codename=${distro_codename}-updates"; // "origin=Debian,codename=${distro_codename}-proposed-updates"; "origin=Debian,codename=${distro_codename},label=Debian"; "origin=Debian,codename=${distro_codename},label=Debian-Security"; "origin=Raspbian,codename=${distro_codename},label=Raspbian"; "origin=Raspberry Pi Foundation,codename=${distro_codename},label=Raspberry Pi Foundation"; // Archive or Suite based matching: // Note that this will silently match a different release after // migration to the specified archive (e.g. testing becomes the // new stable). // "o=Debian,a=stable"; // "o=Debian,a=stable-updates"; // "o=Debian,a=proposed-updates"; // "o=Debian Backports,a=${distro_codename}-backports,l=Debian Backports"; };
メール通知
//Unattended-Upgrade::Mail ""; Unattended-Upgrade::Mail "*****@gmail.com"; //Unattended-Upgrade::MailOnlyOnError "false"; Unattended-Upgrade::MailOnlyOnError "true";
保存: Ctrl + o > リターン
終了: Ctrl + x
動作確認
$ sudo unattended-upgrade -d -v --dry-run
有効化
$ sudo dpkg-reconfigure -plow unattended-upgrades
<はい> > リターン
ログ
$ tail /var/log/unattended-upgrades/unattended-upgrades.log
Netdata
インストール
Get Netdata | Learn Netdata
Install Netdata with kickstart.sh · Netdata Agent | Learn Netdata
複数台の場合、Parent(親機), Child(子機)に設定
1台の場合、Parent(親機)に設定
$ bash <(curl -Ss https://my-netdata.io/kickstart.sh) --auto-update --stable-channel --disable-cloud --disable-telemetry
再インストール
Reinstall the Netdata Agent · Netdata Agent | Learn Netdata
$ bash <(curl -Ss https://my-netdata.io/kickstart.sh) --auto-update --stable-channel --disable-cloud --disable-telemetry --reinstall
ワンライナー
netdata/netdata-installer.sh at master · netdata/netdata · GitHub
設定
$ sudo /etc/netdata/edit-config netdata.conf
[global] history = 600 memory mode = ram debug log = none error log = none access log = none [web] enable gzip compression = no [plugins] cgroups = no tc = no idlejitter = no
保存: Ctrl + o リターン
終了: Ctrl + x
温度センサー
$ sudo /etc/netdata/edit-config charts.d.conf
末尾に追記
sensors=force
保存: Ctrl + o リターン
終了: Ctrl + x
再起動
$ sudo service netdata restart
確認
http://covid-19-01.local:19999
fstab
$ sudo nano /etc/fstab
末尾に追記
tmpfs /var/lib/netdata tmpfs defaults,noatime,nodiratime,mode=1777 0 0
保存: Ctrl + o リターン
終了: Ctrl + x
$ sudo reboot
確認
$ df -h
Streaming
Streaming and replication | Learn Netdata
複数台をParent(親機)で管理する場合
Parent(親機)
$ sudo /etc/netdata/edit-config stream.conf
設定
# [API_KEY] is [YOUR-API-KEY], i.e [11111111-2222-3333-4444-555555555555] [11111111-2222-3333-4444-555555555555] enabled = yes allow from = * default history = 3600 default memory mode = ram health enabled by default = auto
保存: Ctrl + o リターン
終了: Ctrl + x
再起動
$ sudo service netdata restart
確認
http://covid-19-01.local:19999
Child(子機)
ヘッドレスコレクター
$ sudo /etc/netdata/edit-config stream.conf
設定
[stream] enabled = yes destination = covid-19-01.local:19999 api key = 11111111-2222-3333-4444-555555555555
保存: Ctrl + o リターン
終了: Ctrl + x
$ sudo /etc/netdata/edit-config netdata.conf
設定
[global] history = 600 memory mode = none debug log = none error log = none access log = none [web] mode = none accept a streaming request every seconds = 0 enable gzip compression = no [plugins] cgroups = no tc = no idlejitter = no [health] enabled = no
保存: Ctrl + o リターン
終了: Ctrl + x
再起動
$ sudo service netdata restart
確認
http://covid-19-01.local:19999
Modules
BOINC
BOINC monitoring with Netdata | Learn Netdata
Parent(親機), Child(子機)に設定
BOINCプラットフォームのみ
$ cd /etc/netdata $ sudo ./edit-config python.d/boinc.conf
末尾に追記
実機のhostname
remote: hostname: covid-19-03 password: AAAAAAAAA
保存: Ctrl + o > リターン
終了: Ctrl + x
$ sudo service netdata restart
vcgencmd
RPI vcgencmd usage - eLinux.org
python.d.plugin - Netdata Documentation
Parent(親機), Child(子機)に設定
グループvideoに追加
$ sudo adduser netdata video $ sudo reboot
確認
$ vcgencmd get_throttled
0x0 | 正常 |
0x50005 | 現在 低電圧 |
0x80008 | 現在 熱によりクロックダウン |
0x50000 | 過去 低電圧状態になったが現在は正常 |
0x80000 | 過去 熱によりクロックダウンし現在は正常 |
Raspberry Pi Documentation
Monitoring Raspberry Pi Power and Thermal Issues
0 | 現在 低電圧 |
1 | 現在 クロックダウン |
2 | 現在 スロットリング |
3 | 現在 ソフト温度制限 |
16 | 過去 低電圧 (現在正常) |
17 | 過去 周波数制限 (現在正常) |
18 | 過去 スロットリング (現在正常) |
19 | 過去 ソフト温度制限 (現在正常) |
メモ
measure_clock [clock] $ vcgencmd measure_clock arm;vcgencmd measure_clock core;vcgencmd measure_clock H264;vcgencmd measure_clock isp;vcgencmd measure_clock v3d;vcgencmd measure_clock uart;vcgencmd measure_clock pwm;vcgencmd measure_clock emmc;vcgencmd measure_clock pixel;vcgencmd measure_clock vec;vcgencmd measure_clock hdmi;vcgencmd measure_clock dpi
measure_volts [block] $ vcgencmd measure_volts core;vcgencmd measure_volts sdram_c;vcgencmd measure_volts sdram_i;vcgencmd measure_volts sdram_p
otp_dump $ vcgencmd otp_dump
get_mem type $ vcgencmd get_mem arm;vcgencmd get_mem gpu;cat /proc/meminfo
codec_enabled [type] $ vcgencmd codec_enabled AGIF;vcgencmd codec_enabled FLAC;vcgencmd codec_enabled H263;vcgencmd codec_enabled H264;vcgencmd codec_enabled MJPA;vcgencmd codec_enabled MJPB;vcgencmd codec_enabled MJPG;vcgencmd codec_enabled MPG2;vcgencmd codec_enabled MPG4;vcgencmd codec_enabled MVC0;vcgencmd codec_enabled PCM;vcgencmd codec_enabled THRA;vcgencmd codec_enabled VORB;vcgencmd codec_enabled VP6;vcgencmd codec_enabled VP8;vcgencmd codec_enabled WMV9;vcgencmd codec_enabled WVC1
read_ring_osc $ vcgencmd read_ring_osc
display_power [0 | 1 | -1] [display] $ vcgencmd display_power
設定
$ sudo nano /usr/libexec/netdata/python.d/vcgencmd.chart.py
# -*- coding: utf-8 -*-
from bases.FrameworkServices.ExecutableService import ExecutableService
ORDER = ["under-voltage", "arm-frequency", "throttling", "soft-temperature-limit"]
CHARTS = {
"under-voltage": {
"options": [
"vcgencmd get_throttled",
"Under-voltage detected",
"",
"under-voltage",
"",
"line",
],
"lines": [["under-voltage"]],
},
"arm-frequency": {
"options": [
"vcgencmd get_throttled",
"Arm frequency capped",
"",
"arm-frequency",
"",
"line",
],
"lines": [["arm-frequency"]],
},
"throttling": {
"options": [
"vcgencmd get_throttled",
"Currently throttled",
"",
"throttling",
"",
"line",
],
"lines": [["throttling"]],
},
"soft-temperature-limit": {
"options": [
"vcgencmd get_throttled",
"Soft temperature limit active",
"",
"soft-temperature-limit",
"",
"line",
],
"lines": [["soft-temperature-limit"]],
},
}
VCGENCMD_COMMAND = "vcgencmd get_throttled"
class Service(ExecutableService):
def __init__(self, configuration=None, name=None):
ExecutableService.__init__(self, configuration=configuration, name=name)
self.order = ORDER
self.definitions = CHARTS
self.command = VCGENCMD_COMMAND
def _get_data(self):
try:
raw = self._get_raw_data()
throttled_binary = bin(int(raw[0].split("=")[1], 0))
if throttled_binary == "0b0":
throttled_binary = "0b0000000000000000000"
return {
"under-voltage": throttled_binary[-1],
"arm-frequency": throttled_binary[-2],
"throttling": throttled_binary[-3],
"soft-temperature-limit": throttled_binary[-4],
}
except (ValueError, AttributeError):
return None
保存: Ctrl + o リターン
終了: Ctrl + x
$ sudo nano /usr/lib/netdata/conf.d/python.d/vcgencmd.conf
設定
types: - under-voltage - arm-frequency - throttling - soft-temperature-limit
保存: Ctrl + o リターン
終了: Ctrl + x
debug
$ sudo su -s /bin/bash netdata $ /usr/libexec/netdata/plugins.d/python.d.plugin vcgencmd debug trace nolock
Ctrl + c > 停止
Ctrl + d > ログアウト
登録
$ sudo /etc/netdata/edit-config python.d.conf
末尾に追記
vcgencmd: yes
保存: Ctrl + o リターン
終了: Ctrl + x
再起動
$ sudo service netdata restart
確認
http://covid-19-01.local:19999
core-voltage
RPI vcgencmd usage - eLinux.org
python.d.plugin - Netdata Documentation
Parent(親機), Child(子機)に設定
グループvideoに追加
$ sudo adduser netdata video $ sudo reboot
確認
$ vcgencmd measure_volts volt=1.2000V
$ sudo nano /usr/libexec/netdata/python.d/volts.chart.py
設定
# -*- coding: utf-8 -*-
from bases.FrameworkServices.ExecutableService import ExecutableService
VCGENCMD_COMMAND = "vcgencmd measure_volts"
ORDER = ["volts"]
CHARTS = {
"volts": {
"options": [
"vcgencmd measure_volts",
"Core voltage",
"",
"volt",
"volts",
"line",
],
"lines": [["voltage", "volt", "absolute", 1]],
}
}
class Service(ExecutableService):
def __init__(self, configuration=None, name=None):
ExecutableService.__init__(self, configuration=configuration, name=name)
self.order = ORDER
self.definitions = CHARTS
self.command = VCGENCMD_COMMAND
def _get_data(self):
try:
raw = self._get_raw_data()
str = raw[0].split("=")[1].replace("V\n", "")
str_float = float(str) * 1000
return {"voltage": str_float}
except (ValueError, AttributeError):
return None
保存: Ctrl + o リターン
終了: Ctrl + x
$ sudo nano /usr/lib/netdata/conf.d/python.d/volts.conf
設定
types: - core-voltage
保存: Ctrl + o リターン
終了: Ctrl + x
debug
$ sudo su -s /bin/bash netdata $ /usr/libexec/netdata/plugins.d/python.d.plugin volts debug trace Ctrl + c > 停止 Ctrl + d > ログアウト
登録
$ sudo /etc/netdata/edit-config python.d.conf
末尾に追記
volts: yes
保存: Ctrl + o リターン
終了: Ctrl + x
再起動
$ sudo service netdata restart
確認
http://covid-19-01.local:19999
freqmode
python.d.plugin - Netdata Documentation
Parent(親機), Child(子機)に設定
インストール
$ sudo apt install cpufrequtils
確認
$ cpufreq-info -p 600000 1200000 performance
こんな感じにしてみる
cpufreq | value |
powersave | 0 |
conservative | 1 |
ondemand | 2 |
performance | 3 |
$ sudo nano /usr/libexec/netdata/python.d/freqmode.chart.py
設定
# -*- coding: utf-8 -*-
from bases.FrameworkServices.ExecutableService import ExecutableService
COMMAND = "cpufreq-info -p"
ORDER = ["FreqMode"]
CHARTS = {
"FreqMode": {
"options": [None, "FreqMode", "", "FreqMode", "FreqMode", "line"],
"lines": [["freqmode", "FreqMode", "absolute", 1]],
}
}
class Service(ExecutableService):
def __init__(self, configuration=None, name=None):
ExecutableService.__init__(self, configuration=configuration, name=name)
self.order = ORDER
self.definitions = CHARTS
self.command = COMMAND
def _get_data(self):
try:
raw = self._get_raw_data()
str = raw[0].split(" ")[2].replace("\n", "")
if str == "powersave":
return {"freqmode": 0}
elif str == "conservative":
return {"freqmode": 1}
elif str == "ondemand":
return {"freqmode": 2}
elif str == "performance":
return {"freqmode": 3}
except (ValueError, AttributeError):
return None
保存: Ctrl + o リターン
終了: Ctrl + x
$ sudo nano /usr/lib/netdata/conf.d/python.d/freqmode.conf
設定
types: - freqmode
保存: Ctrl + o リターン
終了: Ctrl + x
debug
$ sudo su -s /bin/bash netdata $ /usr/libexec/netdata/plugins.d/python.d.plugin freqmode debug trace Ctrl + c > 停止 Ctrl + d > ログアウト
登録
$ sudo /etc/netdata/edit-config python.d.conf
末尾に追記
freqmode: yes
保存: Ctrl + o リターン
終了: Ctrl + x
再起動
$ sudo service netdata restart
確認
http://covid-19-01.local:19999
reboot-required
unattended-upgradesの再起動要求を監視
Parent(親機), Child(子機)に設定
確認
reboot-requiredのファイルがある場合、再起動が必要
$ test -e /var/run/reboot-required; echo $?
0: 再起動必要
1: 再起動必要ない
設定
$ sudo nano /usr/libexec/netdata/python.d/reboot_required.chart.py
0と1逆にしておく
# -*- coding: utf-8 -*-
from bases.FrameworkServices.ExecutableService import ExecutableService
ORDER = ["reboot-required"]
CHARTS = {
"reboot-required": {
"options": [None, "Reboot Required", "bool", "", "reboot.required", "line"],
"lines": [["reboot-required"]],
}
}
COMMAND = "test -e /var/run/reboot-required"
class Service(ExecutableService):
def __init__(self, configuration=None, name=None):
ExecutableService.__init__(self, configuration=configuration, name=name)
self.order = ORDER
self.definitions = CHARTS
self.command = COMMAND
def _get_data(self):
try:
raw = self._get_raw_data()
if raw == "0":
return {"reboot-required": 1}
else:
return {"reboot-required": 0}
except (ValueError, AttributeError):
return None
保存: Ctrl + o リターン
終了: Ctrl + x
$ sudo nano /usr/lib/netdata/conf.d/python.d/reboot_required.conf
設定
update_every: 15 priority: 60000 retries: 60
保存: Ctrl + o リターン
終了: Ctrl + x
debug
$ sudo su -s /bin/bash netdata $ /usr/libexec/netdata/plugins.d/python.d.plugin reboot_required debug trace nolock
Ctrl + c > 停止
Ctrl + d > ログアウト
登録
$ sudo /etc/netdata/edit-config python.d.conf
末尾に追記
reboot_required: yes
保存: Ctrl + o リターン
終了: Ctrl + x
再起動
$ sudo service netdata restart
確認
http://covid-19-01.local:19999
Alarms
Health quickstart | Learn Netdata
Health configuration reference · Netdata Agent | Learn Netdata
調整
Parent(親機)に設定
swap.conf 停止
ram.conf しきい値調整
$ cd /etc/netdata/ $ sudo ./edit-config health.d/swap.conf
設定
# to: sysadmin to: silent
保存: Ctrl + o > リターン
終了: Ctrl + x
$ cd /etc/netdata/ $ sudo ./edit-config health.d/ram.conf
変更
alarm: ram_available on: mem.available os: linux hosts: * calc: ($avail + $system.ram.used_ram_to_ignore) * 100 / ($system.ram.used + $syste$ units: % every: 10s # warn: $this < (($status >= $WARNING) ? (15) : (10)) # crit: $this < (($status == $CRITICAL) ? (10) : ( 5)) warn: $this < (($status >= $WARNING) ? ( 7.5) : ( 5)) crit: $this < (($status == $CRITICAL) ? ( 5) : ( 2.5)) delay: down 15m multiplier 1.5 max 1h info: estimated amount of RAM available for userspace processes, without causing s$ to: sysadmin
保存: Ctrl + o > リターン
終了: Ctrl + x
リロード
$ sudo netdatacli reload-health
オーバーヒート
Parent(親機)に設定
sensors=forceの温度使用
70度でwarning
80度でcritical
$ cd /etc/netdata/ $ sudo ./edit-config health.d/temperature.conf
設定
template: thermal_temperature on: sensors.temp os: linux lookup: average -1m max units: celsius every: 10s warn: $this > 70 crit: $this > 80 info: Thermal Temperature to: sysadmin
保存: Ctrl + o リターン
終了: Ctrl + x
リロード
$ sudo netdatacli reload-health
再起動要求
Parent(親機)に設定
reboot_required.chart.py使用
1でcritical = 再起動要求
$ cd /etc/netdata/ $ sudo touch health.d/reboot_required.conf $ sudo ./edit-config health.d/reboot_required.conf
設定
template: reboot_required on: reboot.required os: linux lookup: average -15s max units: bool every: 15s crit: $this > 0.5 info: Reboot Required to: sysadmin
保存: Ctrl + o リターン
終了: Ctrl + x
リロード
$ sudo netdatacli reload-health
Parent(親機)に設定
$ sudo /etc/netdata/edit-config health_alarm_notify.conf
設定
criticalのみ
sendmail="/usr/bin/msmtp" SEND_EMAIL="YES" EMAIL_PLAINTEXT_ONLY="YES" DEFAULT_RECIPIENT_EMAIL="*****@gmail.com|critical"
保存: Ctrl + o リターン
終了: Ctrl + x
確認
$ sudo su -s /bin/bash netdata $ /usr/libexec/netdata/plugins.d/alarm-notify.sh test [ROLE]
終了: Ctrl + d
負荷テスト
インストール
$ sudo apt install stress $ stress --help
実行 10分間
$ sudo stress -c 4 -i 4 -m 4 -d 1 -t 10m
自動復旧
Pi OS (32bit)
https://mmonit.com/monit/dist/binary/
インストール
$ cd ~ $ wget https://mmonit.com/monit/dist/binary/5.27.2/monit-5.27.2-linux-arm32.tar.gz $ tar zxvf monit-5.27.2-linux-arm32.tar.gz $ cd monit-5.27.2 $ sudo cp bin/monit /usr/local/sbin/ $ sudo cp conf/monitrc /etc/
確認
$ sudo /usr/local/sbin/monit -t Control file syntax OK $ sudo /usr/local/sbin/monit -c /etc/monitrc Starting Monit 5.27.2 daemon with http interface at [localhost]:2812 $ curl http://admin:monit@localhost:2812/_status?format=json
自動起動
$ sudo nano /lib/systemd/system/monit.service
設定
[Unit] Description=Pro-active monitoring utility for unix systems After=network-online.target Documentation=man:monit(1) https://mmonit.com/wiki/Monit/HowTo [Service] Type=simple KillMode=process ExecStart=/usr/local/sbin/monit -I ExecStop=/usr/local/sbin/monit quit ExecReload=/usr/local/sbin/monit reload Restart = on-abnormal StandardOutput=null [Install] WantedBy=multi-user.target
保存: Ctrl + o リターン
終了: Ctrl + x
起動
$ sudo systemctl enable monit.service $ sudo systemctl start monit.service $ sudo systemctl status monit.service
Pi OS (arm64)
https://mmonit.com/monit/dist/
インストール
$ sudo apt install libssl-dev libpam0g-dev $ cd ~ $ wget https://mmonit.com/monit/dist/monit-5.27.2.tar.gz $ tar zxvf monit-5.27.2.tar.gz $ cd monit-5.27.2 $ ./configure $ make && sudo make install $ sudo cp monitrc /etc/
確認
$ sudo /usr/local/bin/monit -t Control file syntax OK $ sudo /usr/local/bin/monit -c /etc/monitrc Starting Monit 5.27.2 daemon with http interface at [localhost]:2812 $ curl http://admin:monit@localhost:2812/_status?format=json
自動起動
$ sudo nano /lib/systemd/system/monit.service
設定
[Unit] Description=Pro-active monitoring utility for unix systems After=network-online.target Documentation=man:monit(1) https://mmonit.com/wiki/Monit/HowTo [Service] Type=simple KillMode=process ExecStart=/usr/local/bin/monit -I ExecStop=/usr/local/bin/monit quit ExecReload=/usr/local/bin/monit reload Restart = on-abnormal StandardOutput=null [Install] WantedBy=multi-user.target
保存: Ctrl + o リターン
終了: Ctrl + x
起動
$ sudo systemctl enable monit.service $ sudo systemctl start monit.service $ sudo systemctl status monit.service
モニタリング設定
https://mmonit.com/wiki/Monit/ConfigurationExamples
確認中
monit + BOINC: BOINC-Client mit monit überwachen – Rechenkraft
SSHD
Modules
設定
$ cd /etc/netdata $ sudo ./edit-config python.d/monit.conf
末尾に追記
local: name : 'local' url : 'http://localhost:2812' user: : admin pass: : monit
保存: Ctrl + o > リターン
終了: Ctrl + x
$ sudo service netdata restart
更新履歴
- 2021.05.03 設定見直し
- 2021.03.29 設定見直し
- 2021.01.03 TN-Grid追加
- 2020.11.07 Folding@home追加
- 2020.10.18 World Community Grid追加
- 2020.05.03 書き直し
- 2020.04.06 公開