The document discusses various ways to use the ZFS file system on Amazon EC2 instances. It describes ZFS as a file system and logical volume manager with features like data protection, high storage capacities, and snapshots. It provides instructions for installing and using ZFS on Linux, OmniOS, and FreeBSD AMIs, including attaching EBS volumes to an instance and creating ZFS pools and filesystems on them similar to using physical disks.
13. Get the AS Command Line Tools:
aws.amazon.com/developertools/2535
1) Launch config:AMI to be used
2) Autoscaling group: where/how to launch
3) Autoscaling policy: what should AS do?
4) Autoscaling trigger: what will activate AS
13
AutoScaling (AS):
Four main components
13
16. FILE: ec2.bat
@echo off
set EC2_HOME=c:ec2
set PATH=%PATH%;%EC2_HOME%bin
set JAVA_HOME=C:Program FilesJavajre6
"%JAVA_HOME%binjava" -version
set JAVA_HOME=C:Program Files (x86)Javajre6 (Windows 7)
set EC2_PRIVATE_KEY=c:ec2PrivateKey.pem
set EC2_CERT=c:ec2509Certificate.pem
set AWS_AUTO_SCALING_HOME=c:ec2AutoScaling
set AWS_CLOUDWATCH_HOME=c:ec2CloudWatch
set PATH=%PATH%;%AWS_AUTO_SCALING_HOME%bin;%AWS_CLOUDWATCH_HOME%bin
16
Windows setup
16
50. 08
ZFS on Amazon EC2
How to install and run
ZFS on Amazon EC2
(yes, you can!)
Thanks to:
Constantin Gonzalez
Dougal Ballantyne
(demo coming soon)
50
51. What is ZFS?
ZFS is a file system + logical volume manager.
Features:
- protection against data corruption
- support for high storage capacities
- integration of filesystem and volume management
- snapshots and copy-on-write clones
- continuous integrity checking and automatic repair
- RAID-Z
- native NFSv4 ACLs.
OpenZFS is an Open Source implementation of it.
51
52. How can I use it?
Launch an EC2 instance with an AMI which supports
ZFS.
1) Linux
2) OmniOS (native ZFS support based on a fork of the
original OpenSolaris project that open-sourced ZFS)
3) FreeBSD (native ZFS support based on a port of the
OpenSolaris ZFS code)
52
56. And now what?
It works the same as with any other hardware
platform:
1) Attach a few EBS volumes to your EC2 instance;
2) use them as you would use regular disks with ZFS
An example follows.
56
57. $ sudo modprobe zfs
[attach 3 EBS volumes to the instance]
$ sudo zpool create test raidz sdf sdg sdh
$ sudo zpool status
pool: test
state: ONLINE
scan: none requested
config:
NAME STATE READ WRITE CKSUM
test ONLINE 0 0 0
raidz1-0 ONLINE 0 0 0
sdf ONLINE 0 0 0
sdg ONLINE 0 0 0
sdh ONLINE 0 0 0
errors: No known data errors
57
58. $ mount
/dev/xvda1 on / type ext4 (rw,noatime)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
test on /test type zfs (rw,xattr)
$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/xvda1 7.9G 1.6G 6.3G 20% /
tmpfs 15G 0 15G 0% /dev/shm
test 196G 0 196G 0% /test
58
59. What can I do with ZFS?
Many things! Here’s one example:
Use an EBS Provisioned IOPS volumes as ZFS cache
and log (ZIL) devices to accelerate your zpools.
This works much like you would use SSDs in the real
world to accelerate ZFS reads and writes.
For instance, you could provision an EBS volume with
1000 IOPS and use it as a ZIL device for your zpool in
order to accelerate database writes.
59