Geschichte/Server/top3/Storagekonzept: Unterschied zwischen den Versionen

Aus UUGRN
< Geschichte‎ | Server‎ | top3
K (zfs datasets und jails)
 
(→‎Layout 2: Mischung aus ZFS Datasets und Nullmounts)
Zeile 43: Zeile 43:


=== Layout 2 ===
=== Layout 2 ===
Ähnlich wie Layout 1 bestehen Jails aus mehrere ZFS-Volumens, allerdings werden die Jails beim Starten erst durch Nullmounts tatsächlich in die Zielstruktur gemountet. Das bedeutet weniger ZFS-Datasets, dafür aber pro Jail eine eigene /etc/fstab:
Ähnlich wie Layout 1 bestehen Jails aus mehrere ZFS-Volumens, allerdings werden die Jails beim Starten erst durch Nullmounts tatsächlich in die Zielstruktur gemountet. Das bedeutet weniger ZFS-Datasets, dafür aber pro Jail eine eigene /etc/fstab. Außerdem können gemeinsam genutzte Verzeichnisse read-only in allen jails reingemountet werden, insbesondere /usr/ports/* innerhalb aller Jails.
 
<pre>
<pre>
ZFS Dataset                    ZFS Mountpoint          Properties      Jail-Mount
rpool/ROOT/top3-current        /                      ...            -
rpool/ROOT/top3-old            /                      ...            -
rpool/usr                      /usr                    ...            -
rpool/var                      /var                    ...            -
rpool/var/crash                /var/crash              ...            -
rpool/usr/ports                /usr/ports              ...            -
rpool/jails/root                /data/jails/root        ...            /jails/<jailname>
        +-- foo.uugrn.org      /data/jails/root/foo.uugrn.org          /jails/foo.uugrn.org/
        +-- bar.uugrn.org      /data/jails/root/bar.uugrn.org          /jails/bar.uugrn.org/
rpool/jails/var                /data/jails/var        ...            /jails/<jailname>/var
        +-- foo.uugrn.org      /data/jails/var/foo.uugrn.org          /jails/foo.uugrn.org/var
        +-- bar.uugrn.org      /data/jails/var/bar.uugrn.org          /jails/bar.uugrn.org/var
rpool/jails/local              /data/jails/usr/local  ...            /jails/<jailname>/usr/local
rpool/jails/data                /data/jails/data        ...            /jails/<jailname>/data
rpool/jails/tmp                /data/jails/tmp        ...            /jails/<jailname>/tmp
rpool/jails/etc                /data/jails/etc        ...            /jails/<jailname>/etc
rpool/jails/ports              /data/jails/distfiles  ...            /jails/<jailname>/var/ports
rpool/jails/ports/distfiles    /data/jails/distfiles  ...            /jails/<jailname>/var/ports/distfiles
rpool/jails/ports/packages      /data/jails/packages    ...            /jails/<jailname>/var/ports/packages
rpool/shared                    /data/jails/shared              ...    -
rpool/shared/ports              /data/jails/shared/ports (!)    ...    /jails/<jailname>/usr/ports            (r/o)
                                /data/jails/shared/ports (!)            /jails/foo.uugrn.org/usr/ports          (r/o)
                                /data/jails/shared/ports (!)            /jails/bar.uugrn.org/usr/ports          (r/o) 
rpool/shared/distfiles          /data/jails/shared/distfiles    ...    /jails/<jailname>/usr/ports/distfiles  (r/o)
                                /data/jails/shared/distfiles (!)        /jails/foo.uugrn.org/usr/ports/packages        (r/o) 
                                /data/jails/shared/distfiles (!)        /jails/bar.uugrn.org/usr/ports/packages        (r/o) 
rpool/shared/packages          /data/jails/shared/packages    ...    /jails/<jailname>/usr/ports/packages            (r/o)
                                /data/jails/shared/packages (!)        /jails/foo.uugrn.org/usr/ports/packages        (r/o)
                                /data/jails/shared/packages (!)        /jails/bar.uugrn.org/usr/ports/packages        (r/o) 
</pre>
Die Zeilen, die mit rpool/ beginnen sind ZFS Mountpoints. Die dazwischen liegenden Zeilen sind Beispiele, wie Unterverzeichnisse auf den ZFS Mounts per NullMount in die jeweiligen Jails gemountet wird.


Im Folgenden noch einmal nur die Nullmounts für das Beispieljail example.uugrn.org. Die jeweiligen ZFS Mountpoints sind von darin enthaltenen Unterverzeichnissen durch /./ abgegrenzt (Veranschaulichung):
<pre>
/data/jails/root/./example.uugrn.org    /jails/example.uugrn.org                # Jail-Root
/data/jails/var/./example.uugrn.org    /jails/example.uugrn.org/var            # Jail-/var
/data/jails/data/./example.uugrn.org    /jails/example.uugrn.org/data          # Jail-/data
/data/jails/tmp/./example.uugrn.org    /jails/example.uugrn.org/tmp            # Jail-/tmp
/data/jails/etc/./example.uugrn.org    /jails/example.uugrn.org/etc            # Jail-/etc
/data/jails/ports/./example.uugrn.org  /jails/example.uugrn.org/var/ports      # lokale Ports unter /var/ports (r/w!!)
/data/jails/packages/./example.uugrn.org /jails/example.uugrn.org/var/ports/packages/
                                                                                # Packages, die in diesem Jail gebaut wurden
/data/jails/distfiles/./example.uugrn.org /jails/example.uugrn.org/var/ports/distfiles/
                                                                                # Distfiles, die in diesem Jail heruntergeladen wurden
/data/jails/shared/ports                /jails/example.uugrn.org/usr/ports      # gemeinsames /usr/ports, wird zentral gepflegt!, read-only
/data/jails/shared/packages/8.2-release /jails/example.uugrn.org/usr/ports/packages # ... mit vorkompilierten UUGRN-Packages, read-only
/data/jails/shared/distfiles            /jails/example.uugrn.org/usr/ports/distfiles    # ... die hierzu verwendeten Distfiles, read-only
</pre>
</pre>

Version vom 14. März 2011, 22:02 Uhr

ZFS

ZFS soll (mindestens) in der Version 28 zum Einsatz kommen.

Datasets

Pro Dataset lassen sich zahlreiche Parameter einstellen, die die Datensicherheit, die Geschwindigkeit, Kompression, Deduplikation etc beinhalten. Dazu gehören auch sicherheitsrelevante Properties, etwa noexec.

Layout 1

Alle Jails bestehen aus mehreren ZFS Datasets, die jeweils zu kompletten Jails zusammen gemountet werden:

Dataset                         Mountpoint              Properties
rpool/ROOT/top3-current         /                       ...
rpool/ROOT/top3-previous        /                       ...
rpool/usr                       /usr                    ...
rpool/var                       /var                    ...
rpool/var/crash                 /var/crash              ...
rpool/usr/ports                 /usr/ports              ...
rpool/jails                     /jails                  ...
rpool/jails/root                /jails                  ...
rpool/jails/root/foo.uugrn.org  /jails/foo.uugrn.org    ...
rpool/jails/root/bar.uugrn.org  /jails/bar.uugrn.org    ...
...
rpool/jails/var/foo.uugrn.org   /jails/foo.uugrn.org/var        ...
...
rpool/jails/log/foo.uugrn.org   /jails/foo.uugrn.org/var/log    ...
...
rpool/jails/tmp/foo.uugrn.org   /jails/foo.uugrn.org/tmp        ...
...
rpool/jails/local/foo.uugrn.org /jails/foo.uugrn.org/usr/local  ...
...
rpool/jails/etc/foo.uugrn.org   /jails/foo.uugrn.org/etc        ...
...
rpool/jails/data/foo.uugrn.org  /jails/foo.uugrn.org/data       ...
...
rpool/jails/distfiles/foo.uugrn.org     /jails/foo.uugrn.org/var/ports/distfiles        ...
...
rpool/jails/packages/foo.uugrn.org      /jails/foo.uugrn.org/var/ports/packages         ...
...
rpool/shared/ports              /shared/usr/ports               ...
rpool/shared/ports/distfiles    /shared/usr/ports/distfiles     ...
rpool/shared/ports/packages-8.2-release /shared/usr/ports/packages ...


Layout 2

Ähnlich wie Layout 1 bestehen Jails aus mehrere ZFS-Volumens, allerdings werden die Jails beim Starten erst durch Nullmounts tatsächlich in die Zielstruktur gemountet. Das bedeutet weniger ZFS-Datasets, dafür aber pro Jail eine eigene /etc/fstab. Außerdem können gemeinsam genutzte Verzeichnisse read-only in allen jails reingemountet werden, insbesondere /usr/ports/* innerhalb aller Jails.

ZFS Dataset                     ZFS Mountpoint          Properties      Jail-Mount
rpool/ROOT/top3-current         /                       ...             -
rpool/ROOT/top3-old             /                       ...             -
rpool/usr                       /usr                    ...             -
rpool/var                       /var                    ...             -
rpool/var/crash                 /var/crash              ...             -
rpool/usr/ports                 /usr/ports              ...             -
rpool/jails/root                /data/jails/root        ...             /jails/<jailname>
        +-- foo.uugrn.org       /data/jails/root/foo.uugrn.org          /jails/foo.uugrn.org/
        +-- bar.uugrn.org       /data/jails/root/bar.uugrn.org          /jails/bar.uugrn.org/
rpool/jails/var                 /data/jails/var         ...             /jails/<jailname>/var
        +-- foo.uugrn.org       /data/jails/var/foo.uugrn.org           /jails/foo.uugrn.org/var
        +-- bar.uugrn.org       /data/jails/var/bar.uugrn.org           /jails/bar.uugrn.org/var
rpool/jails/local               /data/jails/usr/local   ...             /jails/<jailname>/usr/local
rpool/jails/data                /data/jails/data        ...             /jails/<jailname>/data
rpool/jails/tmp                 /data/jails/tmp         ...             /jails/<jailname>/tmp
rpool/jails/etc                 /data/jails/etc         ...             /jails/<jailname>/etc
rpool/jails/ports               /data/jails/distfiles   ...             /jails/<jailname>/var/ports
rpool/jails/ports/distfiles     /data/jails/distfiles   ...             /jails/<jailname>/var/ports/distfiles
rpool/jails/ports/packages      /data/jails/packages    ...             /jails/<jailname>/var/ports/packages
rpool/shared                    /data/jails/shared              ...     -
rpool/shared/ports              /data/jails/shared/ports (!)    ...     /jails/<jailname>/usr/ports             (r/o)
                                /data/jails/shared/ports (!)            /jails/foo.uugrn.org/usr/ports          (r/o)
                                /data/jails/shared/ports (!)            /jails/bar.uugrn.org/usr/ports          (r/o)   
rpool/shared/distfiles          /data/jails/shared/distfiles    ...     /jails/<jailname>/usr/ports/distfiles   (r/o)
                                /data/jails/shared/distfiles (!)        /jails/foo.uugrn.org/usr/ports/packages         (r/o)   
                                /data/jails/shared/distfiles (!)        /jails/bar.uugrn.org/usr/ports/packages         (r/o)   
rpool/shared/packages           /data/jails/shared/packages     ...     /jails/<jailname>/usr/ports/packages            (r/o)
                                /data/jails/shared/packages (!)         /jails/foo.uugrn.org/usr/ports/packages         (r/o)
                                /data/jails/shared/packages (!)         /jails/bar.uugrn.org/usr/ports/packages         (r/o)   

Die Zeilen, die mit rpool/ beginnen sind ZFS Mountpoints. Die dazwischen liegenden Zeilen sind Beispiele, wie Unterverzeichnisse auf den ZFS Mounts per NullMount in die jeweiligen Jails gemountet wird.


Im Folgenden noch einmal nur die Nullmounts für das Beispieljail example.uugrn.org. Die jeweiligen ZFS Mountpoints sind von darin enthaltenen Unterverzeichnissen durch /./ abgegrenzt (Veranschaulichung):

/data/jails/root/./example.uugrn.org    /jails/example.uugrn.org                # Jail-Root
/data/jails/var/./example.uugrn.org     /jails/example.uugrn.org/var            # Jail-/var
/data/jails/data/./example.uugrn.org    /jails/example.uugrn.org/data           # Jail-/data
/data/jails/tmp/./example.uugrn.org     /jails/example.uugrn.org/tmp            # Jail-/tmp
/data/jails/etc/./example.uugrn.org     /jails/example.uugrn.org/etc            # Jail-/etc
/data/jails/ports/./example.uugrn.org   /jails/example.uugrn.org/var/ports      # lokale Ports unter /var/ports (r/w!!)
/data/jails/packages/./example.uugrn.org /jails/example.uugrn.org/var/ports/packages/
                                                                                # Packages, die in diesem Jail gebaut wurden
/data/jails/distfiles/./example.uugrn.org /jails/example.uugrn.org/var/ports/distfiles/
                                                                                # Distfiles, die in diesem Jail heruntergeladen wurden
/data/jails/shared/ports                /jails/example.uugrn.org/usr/ports      # gemeinsames /usr/ports, wird zentral gepflegt!, read-only
/data/jails/shared/packages/8.2-release /jails/example.uugrn.org/usr/ports/packages # ... mit vorkompilierten UUGRN-Packages, read-only
/data/jails/shared/distfiles            /jails/example.uugrn.org/usr/ports/distfiles    # ... die hierzu verwendeten Distfiles, read-only