progetti:cloud-veneto:operations:zfs_howto
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| progetti:cloud-veneto:operations:zfs_howto [2019/11/05 10:57] – cresce@infn.it | progetti:cloud-veneto:operations:zfs_howto [2019/12/20 12:12] (current) – cresce@infn.it | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== ZFS Howto ====== | ||
| + | |||
| + | ===== Replace failed disk ===== | ||
| + | # Remove the failed disk and insert a new one | ||
| + | |||
| + | # Initialize Disk | ||
| + | <code bash> | ||
| + | / | ||
| + | </ | ||
| + | # Copy the partition table from /dev/sda to /dev/sdb | ||
| + | <code bash> | ||
| + | sgdisk --replicate=/ | ||
| + | sgdisk --randomize-guids /dev/sdb | ||
| + | </ | ||
| + | # Install Grub on the new disk | ||
| + | <code bash> | ||
| + | grub-install /dev/sdb | ||
| + | |||
| + | zpool list | ||
| + | zpool status -x | ||
| + | </ | ||
| + | # Replace the disk in the rpool pool | ||
| + | <code bash> | ||
| + | zpool replace rpool /dev/sdb2 | ||
| + | zpool status -x | ||
| + | </ | ||
| + | # Scrub rpool pool | ||
| + | <code bash> | ||
| + | zpool scrub rpool | ||
| + | </ | ||
| + | |||
| + | ===== Monitoring ZFS with nagios ===== | ||
| + | ==== Client ==== | ||
| + | #Install sudo: | ||
| + | |||
| + | Debian | ||
| + | <code bash> | ||
| + | apt-get install sudo | ||
| + | </ | ||
| + | CentOS 6/7 | ||
| + | <code bash> | ||
| + | yum install sudo | ||
| + | </ | ||
| + | |||
| + | Create / | ||
| + | <code bash> | ||
| + | nagios ALL=NOPASSWD: | ||
| + | nagios ALL=NOPASSWD: | ||
| + | </ | ||
| + | |||
| + | Create nagios account | ||
| + | <code bash> | ||
| + | addgroup --gid 50310 nagios | ||
| + | adduser --uid 50310 --gid 50310 --home / | ||
| + | scp -r < | ||
| + | chown -R nagios: | ||
| + | </ | ||
| + | Copy ZFS check script on / | ||
| + | <code bash> | ||
| + | scp ~/ | ||
| + | </ | ||
| + | |||
| + | ==== Server ==== | ||
| + | |||
| + | Edit nagios config file | ||
| + | <code bash> | ||
| + | define service{ | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ===== Monitoring smart with nagios ===== | ||
| + | ==== Client ==== | ||
| + | #Install sudo: | ||
| + | |||
| + | Debian | ||
| + | <code bash> | ||
| + | apt-get install sudo | ||
| + | </ | ||
| + | CentOS 6/7 | ||
| + | <code bash> | ||
| + | yum install sudo | ||
| + | </ | ||
| + | |||
| + | Copy smart check script into / | ||
| + | <code bash> | ||
| + | scp ~/ | ||
| + | </ | ||
| + | Create / | ||
| + | <code bash> | ||
| + | nagios ALL=NOPASSWD: | ||
| + | </ | ||
| + | |||
| + | ==== Server ==== | ||
| + | |||
| + | Edit nagios config file | ||
| + | <code bash> | ||
| + | define service{ | ||
| + | use | ||
| + | host_name | ||
| + | service_description | ||
| + | check_command | ||
| + | } | ||
| + | </ | ||
