お知らせ

  • 利用規約を守って投稿してください。また、よくある質問および投稿の手引きも参照してください。
  • メッセージの投稿にはアカウントが必要です。未登録の方は、ユーザ登録ページからアカウントを作成することができます。

#1 2021-06-20 19:06:39

mizuti
新しいメンバ
登録日: 2021-06-20

Ubuntu Server 20.04 LTS on Raspberry Pi 4×Docker×ZFSの運用について

初めまして。
以下の環境で自宅Webサーバーを運用しています。

ハードウェア
* Raspberry Pi 4 (8GBモデル)
* 外付けSSD M.2 SATA 120GB (WD Blue) USB3.0接続

ソフトウェア
* Ubuntu Server 20.04 (128GBのSDカードにインストール)
* Docker (docker-ce)
* ZFS (外付けSSDに設定、Dockerで使用するディレクトリを対象)

以上の環境で、以下の現象が発生して困っています。
1. DockerコンテナのMySQL(自製)でDBが更新されない
2. shutdown, rebootに異常に時間がかかる (体感で40分程度)

これを解決したいのが目的です。

調べた範囲で判明していることを記載します。
自分なりの解釈を載せていますが、間違いがありましたらご指摘ください。

1. zpool statusは特に問題は出ていない様子

コード:

$ zpool status
  pool: zpool2
 state: ONLINE
  scan: scrub repaired 0B in 0 days 00:03:58 with 0 errors on Sun Jun 13 00:27:59 2021
config:

        NAME        STATE     READ WRITE CKSUM
        zpool2      ONLINE       0     0     0
          sda       ONLINE       0     0     0

errors: No known data errors

2. smartctlの結果を見ると、累計で5TB近くSSDの書き込みを行っているが、まだ書き込み自体がNGになるような量ではない認識

コード:

 sudo smartctl -a /dev/sda
smartctl 7.1 2019-12-30 r5022 [aarch64-linux-5.4.0-1036-raspi] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org

Warning! Drive Identity Structure error: invalid SMART checksum.
=== START OF INFORMATION SECTION ===
Model Family:     WD Blue and Green SSDs
Device Model:     WDC WDS120G2G0B-00EPW0
Serial Number:    0123456789ABCDEF
LU WWN Device Id: 5 001b44 4a832e282
Firmware Version: UI510000
User Capacity:    120,040,980,480 bytes [120 GB]
Sector Size:      512 bytes logical/physical
Rotation Rate:    Solid State Device
Form Factor:      M.2
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   ACS-2 T13/2015-D revision 3
SATA Version is:  SATA 3.2, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is:    Sun Jun 20 18:41:31 2021 JST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status:  (0x00) Offline data collection activity
                                        was never started.
                                        Auto Offline Data Collection: Disabled.
Self-test execution status:      (  32) The self-test routine was interrupted
                                        by the host with a hard or soft reset.
Total time to complete Offline
data collection:                (  120) seconds.
Offline data collection
capabilities:                    (0x15) SMART execute Offline immediate.
                                        No Auto Offline data collection support.
                                        Abort Offline collection upon new
                                        command.
                                        No Offline surface scan supported.
                                        Self-test supported.
                                        No Conveyance Self-test supported.
                                        No Selective Self-test supported.
SMART capabilities:            (0x0003) Saves SMART data before entering
                                        power-saving mode.
                                        Supports SMART auto save timer.
Error logging capability:        (0x01) Error logging supported.
                                        General Purpose Logging supported.
Short self-test routine
recommended polling time:        (   2) minutes.
Extended self-test routine
recommended polling time:        (  21) minutes.

SMART Attributes Data Structure revision number: 1
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  5 Reallocated_Sector_Ct   0x0032   100   100   000    Old_age   Always       -       0
  9 Power_On_Hours          0x0032   100   100   000    Old_age   Always       -       1910
 12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       24
165 Block_Erase_Count       0x0032   100   100   000    Old_age   Always       -       2080
166 Minimum_PE_Cycles_TLC   0x0032   100   100   ---    Old_age   Always       -       43
167 Max_Bad_Blocks_per_Die  0x0032   100   100   ---    Old_age   Always       -       0
168 Maximum_PE_Cycles_TLC   0x0032   100   100   ---    Old_age   Always       -       101
169 Total_Bad_Blocks        0x0032   100   100   ---    Old_age   Always       -       286
170 Grown_Bad_Blocks        0x0032   100   100   ---    Old_age   Always       -       0
171 Program_Fail_Count      0x0032   100   100   000    Old_age   Always       -       0
172 Erase_Fail_Count        0x0032   100   100   000    Old_age   Always       -       0
173 Average_PE_Cycles_TLC   0x0032   100   100   000    Old_age   Always       -       43
174 Unexpected_Power_Loss   0x0032   100   100   000    Old_age   Always       -       16
184 End-to-End_Error        0x0032   100   100   ---    Old_age   Always       -       0
187 Reported_Uncorrect      0x0032   100   100   000    Old_age   Always       -       0
188 Command_Timeout         0x0032   100   100   ---    Old_age   Always       -       0
194 Temperature_Celsius     0x0022   052   053   000    Old_age   Always       -       48 (Min/Max 22/53)
199 UDMA_CRC_Error_Count    0x0032   100   100   ---    Old_age   Always       -       0
230 Media_Wearout_Indicator 0x0032   100   100   000    Old_age   Always       -       0x055e083c055e
232 Available_Reservd_Space 0x0033   100   100   005    Pre-fail  Always       -       100
233 NAND_GB_Written_TLC     0x0032   100   100   ---    Old_age   Always       -       5055
234 NAND_GB_Written_SLC     0x0032   100   100   000    Old_age   Always       -       11572
241 Host_Writes_GiB         0x0030   100   100   000    Old_age   Offline      -       2302
242 Host_Reads_GiB          0x0030   100   100   000    Old_age   Offline      -       126
244 Temp_Throttle_Status    0x0032   000   100   ---    Old_age   Always       -       0

SMART Error Log Version: 1
No Errors Logged

SMART Self-test log structure revision number 1
No self-tests have been logged.  [To run self-tests, use: smartctl -t]

Selective Self-tests/Logging not supported

3. DockerのZFSドライバは組み込まれている

コード:

$ sudo docker info
Client:
 Context:    default
 Debug Mode: false
 Plugins:
  app: Docker App (Docker Inc., v0.9.1-beta3)
  buildx: Build with BuildKit (Docker Inc., v0.5.1-docker)

Server:
 Containers: 8
  Running: 5
  Paused: 0
  Stopped: 3
 Images: 75
 Server Version: 20.10.7
 Storage Driver: zfs
  Zpool: zpool2
  Zpool Health: ONLINE
  Parent Dataset: zpool2/docker-lib
  Space Used By Parent: 5357899776
  Space Available: 81782161408
  Parent Quota: no
  Compression: off
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: d71fcd7d8303cbf684402823e425e9dd2e99285d
 runc version: b9ee9c6314599f1b4a7f497e1f1f856fe433d3b7
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: default
 Kernel Version: 5.4.0-1036-raspi
 Operating System: Ubuntu 20.04.2 LTS
 OSType: linux
 Architecture: aarch64
 CPUs: 4
 Total Memory: 7.628GiB
 Name: *********
 ID: ****:****:****:****:****:****:****:****:****:****:****:****
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Username: ******
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: No memory limit support
WARNING: No swap limit support
WARNING: No kernel memory TCP limit support
WARNING: No oom kill disable support

以上、よろしくお願いします。

オフライン

 

Board footer

Powered by FluxBB