Complete the Greek translation of Handbook's 'dtrace' and 'filesystems' chapters.
Obtained from: FreeBSD Greek Documentation Project
This commit is contained in:
parent
19886d4dd3
commit
bcdafddd16
Notes:
svn2git
2020-12-08 03:00:23 +00:00
svn path=/head/; revision=33054
2 changed files with 398 additions and 353 deletions
el_GR.ISO8859-7/books/handbook
|
@ -7,7 +7,7 @@
|
|||
$FreeBSD$
|
||||
|
||||
%SOURCE% en_US.ISO8859-1/books/handbook/dtrace/chapter.sgml
|
||||
%SRCID% 1.2
|
||||
%SRCID% 1.3
|
||||
|
||||
-->
|
||||
|
||||
|
@ -108,173 +108,186 @@
|
|||
</sect1>
|
||||
|
||||
<sect1 id="dtrace-implementation">
|
||||
<title>Implementation Differences</title>
|
||||
<title>Διαφορές στην Υλοποίηση</title>
|
||||
|
||||
<para>While the DTrace in &os; is very similar to that found
|
||||
in &solaris;, differences exist that should be explained before
|
||||
continuing. The primary difference users will notice is that
|
||||
on &os;, DTrace needs to be specifically enabled. There are
|
||||
kernel options and modules which must be enabled for DTrace to
|
||||
work properly. These will be explained later.</para>
|
||||
<para>Αν και το DTrace στο &os; είναι αρκετά όμοιο με αυτό του &solaris;,
|
||||
υπάρχουν κάποιες διαφορές που θα πρέπει να τις εξηγήσουμε πριν
|
||||
συνεχίσουμε. Η μεγαλύτερη διαφορά που θα παρατηρήσουν οι χρήστες,
|
||||
είναι ότι στο &os; το DTrace πρέπει να ενεργοποιηθεί χειροκίνητα.
|
||||
Υπάρχουν διάφορες επιλογές και αρθρώματα για τον πυρήνα που πρέπει να
|
||||
ενεργοποιηθούν ώστε το DTrace να λειτουργεί σωστά. Θα εξηγήσουμε
|
||||
αργότερα αυτές τις ρυθμίσεις.</para>
|
||||
|
||||
<para>There is a <literal>DDB_CTF</literal> kernel option which
|
||||
is used to enable support for loading the <acronym>CTF</acronym>
|
||||
data from kernel modules and the kernel itself.
|
||||
<acronym>CTF</acronym> is the &solaris; Compressed C Type format
|
||||
which encapsulates a reduced form of debugging information
|
||||
similar to <acronym>DWARF</acronym> and the venerable stabs.
|
||||
This <acronym>CTF</acronym> data is added to the binaries by the
|
||||
<command>ctfconvert</command> and <command>ctfmerge</command>
|
||||
build tools. The <command>ctfconvert</command> utility parses
|
||||
<acronym>DWARF</acronym> debug <acronym>ELF</acronym> sections
|
||||
created by the compiler and <command>ctfmerge</command> merges
|
||||
<acronym>CTF</acronym> <acronym>ELF</acronym> sections from
|
||||
objects into either executables or shared libraries. More on
|
||||
how to enable this for the kernel and &os; build is
|
||||
forthcoming.</para>
|
||||
<para>Η επιλογή <literal>DDB_CTF</literal> του πυρήνα χρησιμοποιείται για
|
||||
να ενεργοποιήσει την υποστήριξη φορτώματος των δεδομένων
|
||||
<acronym>CTF</acronym> από τον πυρήνα και τα αρθρώματα του. Το
|
||||
<acronym>CTF</acronym> είναι το Compact C Type format του &solaris;,
|
||||
το οποίο ενθυλακώνει μια ελαττωμένη μορφή πληροφοριών αποσφαλμάτωσης
|
||||
(debugging), όμοια με το <acronym>DWARF</acronym> και τα
|
||||
stabs. Αυτά τα δεδομένα <acronym>CTF</acronym> προστίθενται στα
|
||||
εκτελέσιμα μέσω των εργαλείων <command>ctfconvert</command> και
|
||||
<command>ctfmerge</command>. Το βοηθητικό πρόγραμμα
|
||||
<command>ctfconvert</command> ερμηνεύει τα τμήματα debug
|
||||
<acronym>DWARF</acronym> τύπου <acronym>ELF</acronym> που δημιουργούνται
|
||||
από το μεταγλωττιστή, και το <command>ctfmerge</command> συγχωνεύει τα
|
||||
τμήματα <acronym>CTF</acronym> και <acronym>ELF</acronym> από τα
|
||||
αντικείμενα σε άλλα εκτελέσιμα ή κοινόχρηστες βιβλιοθήκες.
|
||||
Περισσότερες πληροφορίες για την ενεργοποίηση των παραπάνω στη
|
||||
μεταγλώττιση του πυρήνα και του συστήματος του &os;, θα δούμε
|
||||
παρακάτω.</para>
|
||||
|
||||
<para>Some different providers exist for &os; than for &solaris;.
|
||||
Most notable is the <literal>dtmalloc</literal> provider, which
|
||||
allows tracing <function>malloc()</function> by type in the
|
||||
&os; kernel.</para>
|
||||
<para>Στο &os; κάποιοι παροχείς είναι διαφορετικοί σε σχέση με το
|
||||
&solaris;. Ο πιο αξιοσημείωτος είναι ο παροχέας
|
||||
<literal>dtmalloc</literal> ο οποίος επιτρέπει το tracing του
|
||||
<function>malloc()</function> ανάλογα με τον τύπο του, στον πυρήνα του
|
||||
&os;.</para>
|
||||
|
||||
<para>Only <username>root</username> may use DTrace on &os;.
|
||||
This is related to security differences, &solaris; has a few
|
||||
low level security checks which do not yet exist in &os;. As
|
||||
such, the <devicename>/dev/dtrace/dtrace</devicename> is strictly
|
||||
limited to <username>root</username> users only.</para>
|
||||
<para>Μόνο ο <username>root</username> μπορεί να χρησιμοποιήσει το
|
||||
DTrace στο &os;. Αυτό σχετίζεται με διαφορές στην ασφάλεια, καθώς το
|
||||
&solaris; διαθέτει κάποιους ελέγχους ασφάλειας χαμηλού επιπέδου, οι
|
||||
οποίοι δεν υπάρχουν ακόμα στο &os;. Για το λόγο αυτό, η χρήση της
|
||||
συσκευής <devicename>/dev/dtrace/dtrace</devicename> απαγορεύεται
|
||||
αυστηρά για όλους τους χρήστες εκτός από τον
|
||||
<username>root</username>.</para>
|
||||
|
||||
<para>Finally, the DTrace software falls under &sun;'s
|
||||
<acronym>CDDL</acronym> license. The <literal>Common Development
|
||||
and Distribution License</literal> comes with &os;, see the
|
||||
<para>Τέλος, το λογισμικό DTrace βρίσκεται υπό την άδεια
|
||||
<acronym>CDDL</acronym> της &sun;. Μπορείτε να διαβάσετε το κείμενο
|
||||
της άδειας <literal>Common Development and Distribution
|
||||
License</literal> στο &os;, στο αρχείο
|
||||
<filename>/usr/src/cddl/contrib/opensolaris/OPENSOLARIS.LICENSE</filename>
|
||||
or view it online at
|
||||
<ulink url="http://www.opensolaris.org/os/licensing">
|
||||
http://www.opensolaris.org/os/licensing</ulink>.</para>
|
||||
ή να το διαβάσετε online στη διεύθυνση
|
||||
<ulink url="http://www.opensolaris.org/os/licensing">http://www.opensolaris.org/os/licensing</ulink>.</para>
|
||||
|
||||
<para>This license means that a &os; kernel with the DTrace options
|
||||
is still <acronym>BSD</acronym> licensed; however the
|
||||
<acronym>CDDL</acronym> kicks in when the modules are distributed
|
||||
in binary form, or the binaries are loaded.</para>
|
||||
<para>Η άδεια ουσιαστικά σημαίνει ότι ένας πυρήνας &os; με τις επιλογές
|
||||
του DTrace, εξακολουθεί να βρίσκεται υπό την άδεια
|
||||
<acronym>BSD</acronym>. Ωστόσο το <acronym>CDDL</acronym> εμπλέκεται
|
||||
τη στιγμή που γίνεται διανομή των αρθρωμάτων σε δυαδική μορφή, ή τη
|
||||
στιγμή που φορτώνονται.</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="dtrace-enable">
|
||||
<title>Enabling DTrace Support</title>
|
||||
<title>Ενεργοποίηση της Υποστήριξης DTrace</title>
|
||||
|
||||
<para>To enable support for DTrace, add the following lines to
|
||||
the kernel configuration file:</para>
|
||||
<para>Για να ενεργοποιήσετε την υποστήριξη για το DTrace, προσθέστε τις
|
||||
ακόλουθες γραμμές στο αρχείο ρυθμίσεων του πυρήνα:</para>
|
||||
|
||||
<programlisting>options KDTRACE_HOOKS
|
||||
options DDB_CTF</programlisting>
|
||||
|
||||
<note>
|
||||
<para>Users of the AMD64 architecture will want to add the
|
||||
following line to their kernel configuration file:</para>
|
||||
<para>Οι χρήστες της αρχιτεκτονικής AMD64 θα θέλουν να προσθέσουν την
|
||||
ακόλουθη γραμμή στο αρχείο ρυθμίσεων του πυρήνα τους:</para>
|
||||
|
||||
<programlisting>options KDTRACE_FRAME</programlisting>
|
||||
|
||||
<para>This option provides support for the <acronym>FBT</acronym>
|
||||
feature. DTrace will work without this option; however, there
|
||||
will be limited support for function boundary tracing.</para>
|
||||
</note>
|
||||
<para>Η επιλογή αυτή παρέχει υποστήριξη για τη λειτουργία
|
||||
<acronym>FBT</acronym>. Το DTrace μπορεί να λειτουργήσει και χωρίς
|
||||
αυτήν. Ωστόσο, θα παρέχει περιορισμένη υποστήριξη για
|
||||
function boundary tracing.</para>
|
||||
</note>
|
||||
|
||||
<para>All sources must be rebuilt and installed with CTF options.
|
||||
To accomplish this task, rebuild the &os; sources using:</para>
|
||||
<para>Όλος ο πηγαίος κώδικας θα πρέπει να μεταγλωττιστεί ξανά με τις
|
||||
επιλογές <acronym>CTF</acronym>. Για να γίνει αυτό, μεταγλωττίστε
|
||||
ξανά το &os; χρησιμοποιώντας:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>cd /usr/src</userinput>
|
||||
&prompt.root; <userinput>make WITH_CTF=1 buildworld</userinput>
|
||||
&prompt.root; <userinput>make WITH_CFT=1 kernel</userinput>
|
||||
&prompt.root; <userinput>make WITH_CFT=1 installworld</userinput>
|
||||
&prompt.root; <userinput>mergemaster -Ui</userinput></screen>
|
||||
&prompt.root; <userinput>make WITH_CTF=1 buildworld</userinput>
|
||||
&prompt.root; <userinput>make WITH_CFT=1 kernel</userinput>
|
||||
&prompt.root; <userinput>make WITH_CFT=1 installworld</userinput>
|
||||
&prompt.root; <userinput>mergemaster -Ui</userinput></screen>
|
||||
|
||||
<para>The system will need to be restarted.</para>
|
||||
<para>Θα χρειαστεί να επανεκκινήσετε το σύστημα.</para>
|
||||
|
||||
<para>After rebooting and allowing the new kernel to be loaded
|
||||
into memory, support for the Korn shell should be added. This
|
||||
is needed as the DTrace toolkit has several utilities written
|
||||
in <command>ksh</command>. Install the
|
||||
<filename role="package">shells/ksh93</filename>. It is also
|
||||
possible to run these tools under
|
||||
<filename role="package">shells/pdksh</filename> or
|
||||
<para>Μετά την επανεκκίνηση, και με τον νέο πυρήνα φορτωμένο πλέον στη
|
||||
μνήμη, θα πρέπει να προσθέσετε υποστήριξη για το κέλυφος Korn. Αυτό
|
||||
απαιτείται, καθώς τα εργαλεία DTrace περιλαμβάνουν διάφορα βοηθητικά
|
||||
προγράμματα τα οποία είναι γραμμένα σε
|
||||
<command>ksh</command>. Εγκαταστήστε το port
|
||||
<filename role="package">shells/ksh93</filename>. Μπορείτε επίσης να
|
||||
εκτελέσετε αυτά τα εργαλεία και μέσω του
|
||||
<filename role="package">shells/pdksh</filename> ή του
|
||||
<filename role="package">shells/mksh</filename>.</para>
|
||||
|
||||
<para>Finally, obtain the current DTrace toolkit. The current
|
||||
version is available at
|
||||
<ulink url="http://www.opensolaris.org/os/community/dtrace/dtracetoolkit/">
|
||||
http://www.opensolaris.org/os/community/dtrace/dtracetoolkit/</ulink>.
|
||||
There is an install mechanism included; however, installation
|
||||
is not required to make use of the bundled utilities.</para>
|
||||
<para>Τέλος, ανακτήστε την τρέχουσα σειρά εργαλείων DTrace. Η τελευταία
|
||||
έκδοση διατίθεται στην τοποθεσία
|
||||
<ulink url="http://www.opensolaris.org/os/community/dtrace/dtracetoolkit/"></ulink>.
|
||||
Διατίθεται και πρόγραμμα εγκατάστασης, το οποίο δεν είναι ωστόσο
|
||||
απαραίτητο να εκτελέσετε προκειμένου να χρησιμοποιήσετε τα
|
||||
εργαλεία.</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="dtrace-using">
|
||||
<title>Using DTrace</title>
|
||||
<title>Χρησιμοποιώντας το DTrace</title>
|
||||
|
||||
<para>Before making use of DTrace functionality, the DTrace device
|
||||
must exist. To load the device, issue the following
|
||||
command:</para>
|
||||
<para>Πριν χρησιμοποιήσετε τις λειτουργίες του DTrace, θα πρέπει να
|
||||
υπάρχει η αντίστοιχη συσκευή. Για να φορτώσετε τη συσκευή, θα πρέπει
|
||||
να δώσετε την παρακάτω εντολή:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>kldload dtraceall</userinput></screen>
|
||||
|
||||
<para>DTrace support should now be available. To view all probes
|
||||
the administrator may now execute the following command:</para>
|
||||
<para>Θα πρέπει να έχετε πλέον υποστήριξη DTrace. Για να δείτε όλα τα
|
||||
probes, θα πρέπει να εκτελέσετε ως διαχειριστής την παρακάτω
|
||||
εντολή:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>dtrace -l | more</userinput></screen>
|
||||
|
||||
<para>All output is passed to the <command>more</command>
|
||||
utility as it will quickly overflow the screen buffer. At
|
||||
this point, DTrace should be considered working. It is now
|
||||
time to review the toolkit.</para>
|
||||
<para>Όλη η έξοδος περνάει μέσω του βοηθητικού προγράμματος
|
||||
<command>more</command>, διαφορετικά γρήγορα θα υπερχείλιζε την
|
||||
προσωρινή μνήμη της οθόνης. Στο σημείο αυτό, θα πρέπει να θεωρηθεί ότι
|
||||
το DTrace λειτουργεί. Είναι πλέον ώρα να εξετάσουμε αυτή τη σειρά
|
||||
εργαλείων.</para>
|
||||
|
||||
<para>The toolkit is a collection of ready-made scripts to run
|
||||
with DTrace to collect system information. There are scripts
|
||||
to check open files, memory, <acronym>CPU</acronym> usage and
|
||||
a lot more. Extract the scripts with the following
|
||||
command:</para>
|
||||
<para>Η σειρά των εργαλείων είναι μια συλλογή από έτοιμα scripts που
|
||||
εκτελούνται με το DTrace ώστε να συλλέξουν πληροφορίες σχετικά με το
|
||||
σύστημα. Υπάρχουν scripts που ελέγχουν για ανοικτά αρχεία, τη μνήμη,
|
||||
τη χρήση της <acronym>CPU</acronym> και πολλά ακόμα. Κάντε εξαγωγή των
|
||||
scripts με την ακόλουθη εντολή:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>gunzip -c DTraceToolkit* | tar xvf -</userinput></screen>
|
||||
|
||||
<para>Change into that directory with the <command>cd</command>
|
||||
and change the execution permissions on all files, designated
|
||||
as those files with lower case names, to
|
||||
<para>Μετακινηθείτε στον κατάλογο που τα αποσυμπιέσατε με την εντολή
|
||||
<command>cd</command> και αλλάξτε τα δικαιώματα εκτέλεσης σε όλα τα
|
||||
αρχεία, όπως στα αρχεία με τα μικρά γράμματα, σε
|
||||
<literal>755</literal>.</para>
|
||||
|
||||
<para>All of these scripts will need modifications to their
|
||||
contents. The ones which refer to
|
||||
<filename>/usr/bin/ksh</filename> need that changed to
|
||||
<filename>/usr/local/bin/ksh</filename>, the others which
|
||||
use <filename>/usr/bin/sh</filename> need to be altered to use
|
||||
<filename>/bin/sh</filename>, and finally the ones which
|
||||
use <filename>/usr/bin/perl</filename> will need altered to
|
||||
use <filename>/usr/local/bin/perl</filename>.</para>
|
||||
<para>Θα χρειαστεί να γίνουν αλλαγές στο περιεχόμενο σε όλα τα scripts.
|
||||
Όσα περιέχουν το
|
||||
<filename>/usr/bin/ksh</filename> θα πρέπει να αλλαχθούν σε
|
||||
<filename>/usr/local/bin/ksh</filename>, τα άλλα που περιέχουν το
|
||||
<filename>/usr/bin/sh</filename> θα πρέπει να αλλαχθούν σε
|
||||
<filename>/bin/sh</filename>, και τέλος αυτά που περιέχουν το
|
||||
<filename>/usr/bin/perl</filename> θα πρέπει να αλλαχθούν σε
|
||||
<filename>/usr/local/bin/perl</filename>.</para>
|
||||
|
||||
<important>
|
||||
<para>At this point it is prudent to remind the reader that
|
||||
DTrace support in &os; is <emphasis>incomplete</emphasis>
|
||||
and <emphasis>experimental</emphasis>. Many of these scripts
|
||||
will not work as they are either too &solaris;-specific or
|
||||
use probes which are unsupported at this time.</para>
|
||||
<para>Στο σημείο αυτό είναι σημαντικό να υπενθυμίσουμε στον αναγνώστη
|
||||
ότι η υποστήριξη DTrace στο &os; είναι <emphasis>ατελής</emphasis>
|
||||
και πειραματική. Πολλά από αυτά τα scripts δεν θα λειτουργήσουν,
|
||||
καθώς είναι είτε πολύ προσανατολισμένα στο &solaris;, ή χρησιμοποιούν
|
||||
probes τα οποία δεν υποστηρίζονται τη δεδομένη στιγμή.</para>
|
||||
</important>
|
||||
|
||||
<para>At the time of this writing only two of the scripts of the
|
||||
DTrace Toolkit are fully supported in &os;:
|
||||
the <filename>hotkernel</filename>
|
||||
and <filename>procsystime</filename> scripts. These are the two
|
||||
we will explore in the following parts of this section.</para>
|
||||
<para>Τη στιγμή που γράφονται αυτές οι γραμμές, μόνο δύο scripts από τη
|
||||
σειρά εργαλείων του DTrace υποστηρίζονται πλήρως στο &os;: το
|
||||
<filename>hotkernel</filename> και το <filename>procsystime</filename>.
|
||||
Αυτά τα δύο θα εξερευνήσουμε στα επόμενα τμήματα αυτής της
|
||||
ενότητας.</para>
|
||||
|
||||
<para>The <filename>hotkernel</filename> is designed to identify
|
||||
which function is using the most kernel time. Run normally, it
|
||||
will produce output similar to the following:</para>
|
||||
<para>Το <filename>hotkernel</filename> έχει σχεδιαστεί να αναγνωρίζει
|
||||
ποια συνάρτηση καταναλώνει το μεγαλύτερο χρόνο στον πυρήνα. Εκτελώντας
|
||||
το υπό κανονικές συνθήκες, θα δείτε έξοδο παρόμοια με την
|
||||
παρακάτω:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>./hotkernel</userinput>
|
||||
localhost# ./hotkernel
|
||||
Sampling... Hit Ctrl-C to end.</screen>
|
||||
|
||||
<para>The system administrator must use the
|
||||
<keycombo action="simul"><keycap>Ctrl</keycap><keycap>C</keycap>
|
||||
</keycombo> key combination to stop the process. Upon
|
||||
termination, the script will display a list of kernel functions and
|
||||
timing information, sorting the output in increasing order of
|
||||
time:</para>
|
||||
<para>Ο διαχειριστής του συστήματος θα πρέπει να χρησιμοποιήσει το
|
||||
συνδυασμό πλήκτρων <keycombo
|
||||
action="simul"><keycap>Ctrl</keycap><keycap>C</keycap></keycombo> για
|
||||
να σταματήσει τη διεργασία. Με τον τερματισμό του, το script θα
|
||||
απεικονίσει μια σειρά από συναρτήσεις του πυρήνα και πληροφορίες σχετικά
|
||||
με το χρόνο τους, ταξινομώντας τις σε αύξουσα σειρά ανάλογα με το
|
||||
χρόνο:</para>
|
||||
|
||||
<screen>kernel`_thread_lock_flags 2 0.0%
|
||||
0xc1097063 2 0.0%
|
||||
|
@ -307,12 +320,11 @@ kernel`sched_idletd 137 0.3%
|
|||
to find 0xc10981a5, but to no avail. It would be nice to know
|
||||
how we should look that up. -->
|
||||
|
||||
<para>This script will also work with kernel modules. To use this
|
||||
feature, run the script with the <option>-m</option> flag:</para>
|
||||
<para>Το script αυτό λειτουργεί επίσης με αρθρώματα του πυρήνα. Για να
|
||||
χρησιμοποιήσετε αυτό το χαρακτηριστικό, εκτελέστε το με την επιλογή
|
||||
<option>-m</option>:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>./hotkernel -m</userinput></screen>
|
||||
|
||||
<screen>localhost# <userinput>./hotkernel -m</userinput>
|
||||
<screen>&prompt.root; <userinput>./hotkernel -m</userinput>
|
||||
Sampling... Hit Ctrl-C to end.
|
||||
^C
|
||||
MODULE COUNT PCNT
|
||||
|
@ -333,14 +345,13 @@ kernel 874 0.4%
|
|||
kldstat and kldstat -v and grep. Maybe I'm missing something
|
||||
seriously obvious. It is 5AM btw. -->
|
||||
|
||||
<para>The <filename>procsystime</filename> script captures and
|
||||
prints the system call time usage for a given
|
||||
<acronym>PID</acronym> or process name. In the following
|
||||
example, a new instance of <filename>/bin/csh</filename>
|
||||
was spawned. The <filename>procsystime</filename> was executed
|
||||
and remained waiting while a few commands were typed on the
|
||||
other incarnation of <command>csh</command>. These are the
|
||||
results of this test:</para>
|
||||
<para>Το <filename>procsystime</filename> script συλλαμβάνει και τυπώνει
|
||||
τον χρόνο των κλήσεων συστήματος για μια συγκεκριμένη διεργασία μέσω
|
||||
του <acronym>PID</acronym> ή του ονόματος της. Στο παρακάτω παράδειγμα
|
||||
έχουμε ξεκινήσει μια νέα διεργασία του <filename>/bin/csh</filename>.
|
||||
Εκτελέσαμε το <filename>procsystime</filename> και το αφήσαμε στην
|
||||
αναμονή καθώς γράφαμε μερικές εντολές στο <command>csh</command> που
|
||||
είχαμε ανοίξει. Αυτά είναι τα αποτελέσματα της δοκιμής μας:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>./procsystime -n csh</userinput>
|
||||
Tracing... Hit Ctrl-C to end...
|
||||
|
@ -368,20 +379,22 @@ Elapsed Times for processes csh,
|
|||
sigsuspend 6985124
|
||||
read 3988049784</screen>
|
||||
|
||||
<para>As shown, the read system call seems to use the
|
||||
most time in nanoseconds with the <function>getpid()</function>
|
||||
system call used the least amount of time.</para>
|
||||
<para>Όπως φαίνεται, η κλήση του συστήματος για ανάγνωση
|
||||
(<function>read()</function>) είναι αυτή που καταναλώνει τον
|
||||
περισσότερο χρόνο σε νανοδευτερόλεπτα, ενώ το λιγότερο τον καταναλώνει
|
||||
η κλήση συστήματος <function>getpid()</function>.</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="dtrace-language">
|
||||
<title>The D Language</title>
|
||||
<title>Η Γλώσσα D</title>
|
||||
|
||||
<para>The DTrace Toolkit includes many scripts in the special language of
|
||||
DTrace. This language is called <quote>the D language</quote> by &sun;
|
||||
documentation, and it is very similar to C++. An in depth
|
||||
discussion of the language is beyond the scope of this document. It is
|
||||
extensively discussed
|
||||
at <ulink url="http://wikis.sun.com/display/DTrace/Documentation"></ulink>.</para>
|
||||
<para>Η σειρά εργαλείων DTrace, περιλαμβάνει αρκετά scripts γραμμένα στην
|
||||
ειδική γλώσσα του DTrace. Η γλώσσα αυτή ονομάζεται
|
||||
<quote>η γλώσσα D</quote> στην τεκμηρίωση της &sun;, και είναι αρκετά
|
||||
όμοια με τη C++. Αναλυτική περιγραφή αυτής της γλώσσας είναι πέρα από
|
||||
τους σκοπούς αυτού του κειμένου. Υπάρχει ενεργή συζήτηση σχετικά με
|
||||
αυτή, στη διεύθυνση <ulink
|
||||
url="http://wikis.sun.com/display/DTrace/Documentation"></ulink>.</para>
|
||||
</sect1>
|
||||
</chapter>
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
Üëëá ëåéôïõñãéêÜ óõóôÞìáôá, ð.÷. äåäïìÝíá ðïõ âñßóêïíôáé óå ôïðéêÜ
|
||||
<acronym>USB</acronym> áðïèçêåõôéêÜ ìÝóá, ïäçãïýò flash, êáé óêëçñïýò
|
||||
äßóêïõò. ÕðÜñ÷åé åðßóçò õðïóôÞñéîç ãéá Üëëá, ìç-åããåíÞ óõóôÞìáôá
|
||||
áñ÷åßùí, üðùò ôï ôï Extended File System (<acronym>EXT</acronym>) ôïõ
|
||||
αρχείων, όπως το Extended File System (<acronym>EXT</acronym>) του
|
||||
&linux; êáèþò êáé ôï óýóôçìá Z File System (<acronym>ZFS</acronym>) ôçò
|
||||
&sun;.</para>
|
||||
|
||||
|
@ -119,113 +119,122 @@
|
|||
</sect1>
|
||||
|
||||
<sect1 id="filesystems-zfs">
|
||||
<title>The Z File System</title>
|
||||
<title>Το Σύστημα Αρχείων Z</title>
|
||||
|
||||
<para>The Z file system, developed by &sun;, is a new
|
||||
technology designed to use a pooled storage method. This means
|
||||
that space is only used as it is needed for data storage. It
|
||||
has also been designed for maximum data integrity, supporting
|
||||
data snapshots, multiple copies, and data checksums. A new
|
||||
data replication model, known as <acronym>RAID</acronym>-Z has
|
||||
been added. The <acronym>RAID</acronym>-Z model is similar
|
||||
to <acronym>RAID</acronym>5 but is designed to prevent data
|
||||
write corruption.</para>
|
||||
<para>Το σύστημα αρχείων Z, αναπτύχθηκε από την &sun;, και είναι μια νέα
|
||||
τεχνολογία που σχεδιάστηκε για να παρέχει αποθήκευση μέσω της μεθόδου
|
||||
pool. Αυτό σημαίνει ότι όλος ο ελεύθερος χώρος διατίθεται ως
|
||||
απόθεμα, και διανέμεται δυναμικά σε κάθε σύστημα αρχείων ανάλογα με τις
|
||||
ανάγκες αποθήκευσης δεδομένων. Έχει επίσης σχεδιαστεί για τη μέγιστη
|
||||
ακεραιότητα δεδομένων και υποστηρίζει στιγμιότυπα (snapshots) δεδομένων,
|
||||
πολλαπλά αντίγραφα και αθροίσματα ελέγχου δεδομένων (checksums). Έχει
|
||||
ακόμα προστεθεί ένα νέο μοντέλο για τη διατήρηση αντιγράφων των
|
||||
δεδομένων, γνωστό ως <acronym>RAID</acronym>-Z. Το μοντέλο
|
||||
<acronym>RAID</acronym>-Z είναι παρόμοιο με το
|
||||
<acronym>RAID</acronym>5 αλλά είναι σχεδιασμένο να παρέχει προστασία
|
||||
των δεδομένων κατά την εγγραφή τους.</para>
|
||||
|
||||
<sect2>
|
||||
<title>ZFS Tuning</title>
|
||||
<title>Βελτιστοποίηση του ZFS</title>
|
||||
|
||||
<para>The <acronym>ZFS</acronym> subsystem utilizes much of
|
||||
the system resources, so some tuning may be required to provide
|
||||
maximum efficiency during every-day use. As an experimental
|
||||
feature in &os; this may change in the near future; however,
|
||||
at this time, the following steps are recommended.</para>
|
||||
<para>Το υποσύστημα <acronym>ZFS</acronym> χρησιμοποιεί αρκετούς πόρους
|
||||
του συστήματος. Βελτιστοποιώντας τις ρυθμίσεις του συστήματος σας, θα
|
||||
επιτύχετε τη μέγιστη απόδοση στην καθημερινή χρήση. Καθώς το
|
||||
<acronym>ZFS</acronym> είναι ακόμα σε πειραματικό στάδιο στο &os;,
|
||||
αυτό ίσως αλλάξει μελλοντικά. Ωστόσο, για την ώρα, συνίσταται να
|
||||
ακολουθήσετε τα παρακάτω βήματα:</para>
|
||||
|
||||
<sect3>
|
||||
<title>Memory</title>
|
||||
<title>Μνήμη</title>
|
||||
|
||||
<para>The total system memory should be at least one gigabyte,
|
||||
with two gigabytes or more recommended. In all of the
|
||||
examples here, the system has one gigabyte of memory with
|
||||
several other tuning mechanisms in place.</para>
|
||||
<para>Το συνολικό μέγεθος μνήμης του συστήματος πρέπει να είναι
|
||||
τουλάχιστον ένα gigabyte, ενώ το συνιστώμενο μέγεθος είναι δύο
|
||||
gigabytes ή και περισσότερο. Σε όλα τα παραδείγματα που φαίνονται
|
||||
εδώ, το σύστημα έχει ένα gigabyte μνήμης και έχουμε επίσης
|
||||
βελτιστοποιήσει τις ρυθμίσεις του.</para>
|
||||
|
||||
<para>Some people have had luck using fewer than one gigabyte
|
||||
of memory, but with such a limited amount of physical memory,
|
||||
when the system is under heavy load, it is very plausible
|
||||
that &os; will panic due to memory exhaustion.</para>
|
||||
<para>Ορισμένοι χρήστες φαίνεται να τα καταφέρνουν και με λιγότερο
|
||||
από ένα gigabyte μνήμης, αλλά με τέτοιους περιορισμούς φυσικής
|
||||
μνήμης, είναι αρκετά πιθανό να δημιουργηθεί panic κάτω από βαρύ
|
||||
φορτίο εργασίας, εξαιτίας εξάντλησης της.</para>
|
||||
</sect3>
|
||||
|
||||
<sect3>
|
||||
<title>Kernel Configuration</title>
|
||||
<title>Ρύθμιση του Πυρήνα</title>
|
||||
|
||||
<para>It is recommended that unused drivers and options
|
||||
be removed from the kernel configuration file. Since most
|
||||
devices are available as modules, they may simply be loaded
|
||||
using the <filename>/boot/loader.conf</filename> file.</para>
|
||||
<para>Συνίσταται να αφαιρέσετε τα προγράμματα οδήγησης και τις
|
||||
επιλογές που δεν χρησιμοποιείτε από το αρχείο ρυθμίσεων του
|
||||
πυρήνα. Καθώς οι περισσότεροι οδηγοί συσκευών διατίθενται επίσης
|
||||
και σε μορφή αρθρωμάτων, μπορείτε απλά να τους φορτώσετε
|
||||
χρησιμοποιώντας το αρχείο
|
||||
<filename>/boot/loader.conf</filename>.</para>
|
||||
|
||||
<para>Users of the i386 architecture should add the following
|
||||
option to their kernel configuration file, rebuild their
|
||||
kernel, and reboot:</para>
|
||||
<para>Οι χρήστες της αρχιτεκτονικής i386 θα πρέπει να προσθέσουν την
|
||||
παρακάτω επιλογή στο αρχείο ρυθμίσεων του πυρήνα τους, να τον
|
||||
επαναμεταγλωττίσουν και να επανεκκινήσουν το σύστημα τους:</para>
|
||||
|
||||
<programlisting>options KVA_PAGES=512</programlisting>
|
||||
|
||||
<para>This option will expand the kernel address space, thus
|
||||
allowing the <varname>vm.kvm_size</varname> tunable to be
|
||||
pushed beyond the currently imposed limit of 1 GB
|
||||
(2 GB for <acronym>PAE</acronym>). To find the most
|
||||
suitable value for this option, divide the desired address
|
||||
space in megabytes by four (4). In this case, it is
|
||||
<literal>512</literal> for 2 GB.</para>
|
||||
<para>Η επιλογή αυτή θα διευρύνει την περιοχή διευθύνσεων του πυρήνα,
|
||||
επιτρέποντας έτσι την αύξηση τιμής της ρυθμιστικής μεταβλητής
|
||||
<varname>vm.kvm_size</varname> πέρα από το τρέχον όριο του
|
||||
1 GB (2 GB για πυρήνες <acronym>PAE</acronym>). Για να
|
||||
βρείτε την καταλληλότερη τιμή για αυτή την επιλογή, διαιρέστε το
|
||||
επιθυμητό μέγεθος της περιοχής διευθύνσεων με το τέσσερα (4). Στην
|
||||
περίπτωση αυτή, έχουμε <literal>512</literal> για μέγεθος
|
||||
2 GB.</para>
|
||||
</sect3>
|
||||
|
||||
<sect3>
|
||||
<title>Loader Tunables</title>
|
||||
<title>Ρυθμίσεις στις Μεταβλητές του Loader</title>
|
||||
|
||||
<para>The <devicename>kmem</devicename> address space should be
|
||||
increased on all &os; architectures. On the test system with
|
||||
one gigabyte of physical memory, success was achieved with the
|
||||
following options which should be placed in
|
||||
the <filename>/boot/loader.conf</filename> file and the system
|
||||
restarted:</para>
|
||||
<para>Θα πρέπει να αυξηθεί η περιοχή διευθύνσεων
|
||||
<devicename>kmem</devicename> σε όλες τις αρχιτεκτονικές του &os;.
|
||||
Στο δοκιμαστικό μας σύστημα, με ένα gigabyte φυσικής μνήμης,
|
||||
είχαμε επιτυχημένο αποτέλεσμα χρησιμοποιώντας τις ακόλουθες
|
||||
επιλογές στο αρχείο <filename>/boot/loader.conf</filename> και
|
||||
επανεκκινώντας το σύστημα μας:</para>
|
||||
|
||||
<programlisting>vm.kmem_slze="330M"
|
||||
vm.kmem_size_max="330M"
|
||||
vfs.zfs.arc_max="40M"
|
||||
vfs.zfs.vdev.cache.size="5M"</programlisting>
|
||||
|
||||
<para>For a more detailed list of recommendations for ZFS-related
|
||||
tuning, see
|
||||
<ulink url="http://wiki.freebsd.org/ZFSTuningGuide"></ulink>.</para>
|
||||
<para>Για αναλυτικότερες ρυθμίσεις σχετικά με την βελτιστοποίηση του
|
||||
ZFS, δείτε το <ulink
|
||||
url="http://wiki.freebsd.org/ZFSTuningGuide"></ulink>.</para>
|
||||
</sect3>
|
||||
</sect2>
|
||||
|
||||
<sect2>
|
||||
<title>Using <acronym>ZFS</acronym></title>
|
||||
<title>Χρησιμοποιώντας το <acronym>ZFS</acronym></title>
|
||||
|
||||
<para>There is a start up mechanism that allows &os; to
|
||||
mount <acronym>ZFS</acronym> pools during system
|
||||
initialization. To set it, issue the following
|
||||
commands:</para>
|
||||
<para>Υπάρχει ένας μηχανισμός εκκίνησης που επιτρέπει στο &os; να
|
||||
προσαρτήσει <acronym>ZFS</acronym> pools κατά τη διάρκεια της
|
||||
εκκίνησης του συστήματος. Για να τον ρυθμίσετε, εκτελέστε τις
|
||||
ακόλουθες εντολές:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>echo 'zfs_enable="YES"' >> /etc/rc.conf</userinput>
|
||||
<screen>&prompt.root; <userinput>echo 'zfs_enable="YES"' >> /etc/rc.conf</userinput>
|
||||
&prompt.root; <userinput>/etc/rc.d/zfs start</userinput></screen>
|
||||
|
||||
<para>The remainder of this document assumes two
|
||||
<acronym>SCSI</acronym> disks are available, and their device names
|
||||
are <devicename><replaceable>da0</replaceable></devicename>
|
||||
and <devicename><replaceable>da1</replaceable></devicename>
|
||||
respectively. Users of <acronym>IDE</acronym> hardware may
|
||||
use the <devicename><replaceable>ad</replaceable></devicename>
|
||||
devices in place of <acronym>SCSI</acronym> hardware.</para>
|
||||
<para>Το υπόλοιπο αυτού του κειμένου υποθέτει ότι έχετε διαθέσιμους
|
||||
δύο <acronym>SCSI</acronym> δίσκους, και ότι τα ονόματα συσκευών
|
||||
τους είναι <devicename><replaceable>da0</replaceable></devicename>
|
||||
και <devicename><replaceable>da1</replaceable></devicename>
|
||||
αντίστοιχα. Όσοι χρησιμοποιούν δίσκους <acronym>IDE</acronym> θα
|
||||
πρέπει να χρησιμοποιήσουν συσκευές του τύπου
|
||||
<devicename><replaceable>ad</replaceable></devicename>
|
||||
αντί για τις αντίστοιχες <acronym>SCSI</acronym>.</para>
|
||||
|
||||
<sect3>
|
||||
<title>Single Disk Pool</title>
|
||||
<title>Pool με Ένα Μόνο Δίσκο</title>
|
||||
|
||||
<para>To create a <acronym>ZFS</acronym> over a single disk
|
||||
device, use the <command>zpool</command> command:</para>
|
||||
<para>Για την δημιουργία <acronym>ZFS</acronym> σε ένα μόνο δίσκο,
|
||||
χρησιμοποιήστε την εντολή <command>zpool</command>:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>zpool create example /dev/da0</userinput></screen>
|
||||
|
||||
<para>To view the new pool, review the output of the
|
||||
<para>Για να δείτε το νέο pool, εξετάστε την έξοδο της εντολής
|
||||
<command>df</command>:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>df</userinput>
|
||||
|
@ -235,12 +244,12 @@ devfs 1 1 0 100% /dev
|
|||
/dev/ad0s1d 54098308 1032846 48737598 2% /usr
|
||||
example 17547136 0 17547136 0% /example</screen>
|
||||
|
||||
<para>This output clearly shows the <literal>example</literal>
|
||||
pool has not only been created but
|
||||
<emphasis>mounted</emphasis> as well. It is also accessible
|
||||
just like a normal file system, files may be created on it
|
||||
and users are able to browse it as in the
|
||||
following example:</para>
|
||||
<para>Η έξοδος αυτή δείχνει καθαρά ότι το <literal>example</literal>
|
||||
pool όχι μόνο έχει δημιουργηθεί, αλλά έχει επίσης
|
||||
<emphasis>προσαρτηθεί</emphasis> κιόλας. Είναι επίσης διαθέσιμο ως
|
||||
κανονικό σύστημα αρχείων, μπορείτε να δημιουργήσετε αρχεία σε αυτό,
|
||||
και άλλοι χρήστες μπορούν επίσης να το δουν, όπως φαίνεται στο
|
||||
παρακάτω παράδειγμα:</para>
|
||||
|
||||
<screen>&prompt.root <userinput>cd /example</userinput>
|
||||
&prompt.root; <userinput>ls</userinput>
|
||||
|
@ -251,25 +260,27 @@ drwxr-xr-x 2 root wheel 3 Aug 29 23:15 .
|
|||
drwxr-xr-x 21 root wheel 512 Aug 29 23:12 ..
|
||||
-rw-r--r-- 1 root wheel 0 Aug 29 23:15 testfile</screen>
|
||||
|
||||
<para>Unfortunately this pool is not taking advantage of
|
||||
any <acronym>ZFS</acronym> features. Create a file system
|
||||
on this pool, and enable compression on it:</para>
|
||||
<para>Δυστυχώς αυτό το pool δεν χρησιμοποιεί κάποιο από τα
|
||||
πλεονεκτήματα του <acronym>ZFS</acronym>. Δημιουργήστε ένα σύστημα
|
||||
αρχείων σε αυτό το pool και ενεργοποιήστε σε αυτό τη
|
||||
συμπίεση:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>zfs create example/compressed</userinput>
|
||||
&prompt.root; <userinput>zfs set compression=gzip example/compressed</userinput></screen>
|
||||
|
||||
<para>The <literal>example/compressed</literal> is now a
|
||||
<acronym>ZFS</acronym> compressed file system. Try copying
|
||||
some large files to it by copying them to
|
||||
<para>Το σύστημα αρχείων <literal>example/compressed</literal>
|
||||
είναι πλέον ένα συμπιεσμένο <acronym>ZFS</acronym> σύστημα.
|
||||
Δοκιμάστε να αντιγράψετε μερικά μεγάλα αρχεία σε αυτό, απευθείας
|
||||
στον κατάλογο
|
||||
<filename class="directory">/example/compressed</filename>.</para>
|
||||
|
||||
<para>The compression may now be disabled with:</para>
|
||||
<para>Μπορείτε τώρα να απενεργοποιήσετε τη συμπίεση γράφοντας:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>zfs set compression=off example/compressed</userinput></screen>
|
||||
|
||||
<para>To unmount the file system, issue the following command
|
||||
and then verify by using the <command>df</command>
|
||||
utility:</para>
|
||||
<para>Για να αποπροσαρτήσετε το σύστημα αρχείων, εκτελέστε την
|
||||
ακόλουθη εντολή και επαληθεύστε το αποτέλεσμα μέσω του βοηθητικού
|
||||
προγράμματος <command>df</command>:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>zfs umount example/compressed</userinput>
|
||||
&prompt.root; <userinput>df</userinput>
|
||||
|
@ -279,8 +290,9 @@ devfs 1 1 0 100% /dev
|
|||
/dev/ad0s1d 54098308 1032864 48737580 2% /usr
|
||||
example 17547008 0 17547008 0% /example</screen>
|
||||
|
||||
<para>Re-mount the file system to make it accessible
|
||||
again, and verify with <command>df</command>:</para>
|
||||
<para>Προσαρτήστε ξανά το σύστημα αρχείων, ώστε να είναι και πάλι
|
||||
προσβάσιμο, και επαληθεύστε το χρησιμοποιώντας όπως και πριν, την
|
||||
εντολή <command>df</command>:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>zfs mount example/compressed</userinput>
|
||||
&prompt.root; <userinput>df</userinput>
|
||||
|
@ -291,8 +303,8 @@ devfs 1 1 0 100% /dev
|
|||
example 17547008 0 17547008 0% /example
|
||||
example/compressed 17547008 0 17547008 0% /example/compressed</screen>
|
||||
|
||||
<para>The pool and file system may also be observed by viewing
|
||||
the output from <command>mount</command>:</para>
|
||||
<para>Μπορείτε επίσης να δείτε το pool και το σύστημα αρχείων
|
||||
εξετάζοντας την έξοδο της εντολής <command>mount</command>:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>mount</userinput>
|
||||
/dev/ad0s1a on / (ufs, local)
|
||||
|
@ -302,18 +314,19 @@ example on /example (zfs, local)
|
|||
example/data on /example/data (zfs, local)
|
||||
example/compressed on /example/compressed (zfs, local)</screen>
|
||||
|
||||
<para>As observed, <acronym>ZFS</acronym> file systems, after
|
||||
creation, may be used like ordinary file systems; however,
|
||||
many other features are also available. In the following
|
||||
example, a new file system, <literal>data</literal> is
|
||||
created. Important files will be stored here, so the file
|
||||
system is set to keep two copies of each data block:</para>
|
||||
<para>Όπως παρατηρούμε, το σύστημα αρχείων <acronym>ZFS</acronym>
|
||||
μπορεί να χρησιμοποιηθεί ως κοινό σύστημα αρχείων μετά τη
|
||||
δημιουργία του. Ωστόσο, διαθέτει πολλές ακόμα λειτουργίες. Στο
|
||||
παρακάτω παράδειγμα δημιουργούμε ένα νέο σύστημα αρχείων, το
|
||||
<literal>data</literal>. θα αποθηκεύσουμε σημαντικά δεδομένα σε
|
||||
αυτό, και έτσι το ρυθμίζουμε ώστε να κρατάει δύο αντίγραφα από
|
||||
κάθε μπλοκ δεδομένων:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>zfs create example/data</userinput>
|
||||
&prompt.root; <userinput>zfs set copies=2 example/data</userinput></screen>
|
||||
|
||||
<para>It is now possible to see the data and space utilization
|
||||
by issuing the <command>df</command> again:</para>
|
||||
<para>Μπορούμε τώρα να δούμε τα δεδομένα και την κατανάλωση χώρου
|
||||
δίνοντας ξανά την εντολή <command>df</command>:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>df</userinput>
|
||||
Filesystem 1K-blocks Used Avail Capacity Mounted on
|
||||
|
@ -324,112 +337,116 @@ example 17547008 0 17547008 0% /example
|
|||
example/compressed 17547008 0 17547008 0% /example/compressed
|
||||
example/data 17547008 0 17547008 0% /example/data</screen>
|
||||
|
||||
<para>Notice that each file system on the pool has the same
|
||||
amount of available space. This is the reason for using
|
||||
the <command>df</command> through these examples, to show
|
||||
that the file systems are using only the amount of space
|
||||
they need and will all draw from the same pool.
|
||||
The <acronym>ZFS</acronym> file system does away with concepts
|
||||
such as volumes and partitions, and allows for several file
|
||||
systems to occupy the same pool. Destroy the file systems,
|
||||
and then destroy the pool as they are no longer
|
||||
needed:</para>
|
||||
<para>Παρατηρήστε ότι κάθε σύστημα αρχείων στο pool δείχνει το ίδιο
|
||||
μέγεθος διαθέσιμου χώρου. Αυτός είναι και ο λόγος που
|
||||
χρησιμοποιούμε την εντολή <command>df</command> σε όλα τα
|
||||
παραδείγματα, για να δείξουμε ότι τα συστήματα αρχείων
|
||||
χρησιμοποιούν μόνο το χώρο που χρειάζονται και ότι όλα μοιράζονται
|
||||
τον ίδιο χώρο (το κοινόχρηστο απόθεμα — pool). Στο σύστημα
|
||||
αρχείων <acronym>ZFS</acronym> έννοιες όπως οι τόμοι (volumes) και
|
||||
οι κατατμήσεις (partitions) δεν έχουν νόημα. Αντίθετα, πολλά
|
||||
συστήματα αρχείων μοιράζονται τον ίδιο χώρο, το pool. Μπορείτε να
|
||||
καταργήσετε το σύστημα αρχείων και κατόπιν το ίδιο το pool όταν
|
||||
δεν τα χρειάζεστε πλέον:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>zfs destroy example/compressed</userinput>
|
||||
&prompt.root; <userinput>zfs destroy example/data</userinput>
|
||||
&prompt.root; <userinput>zpool destroy example</userinput></screen>
|
||||
|
||||
<para>Disks go bad and fail, an unavoidable trait. When
|
||||
this disk goes bad, the data will be lost. One method of
|
||||
avoiding data loss due to a failed hard disk is to implement
|
||||
a <acronym>RAID</acronym>. <acronym>ZFS</acronym> supports
|
||||
this feature in its pool design which is covered in
|
||||
the next section.</para>
|
||||
<para>Οι σκληροί δίσκοι με τον καιρό χαλάνε, είναι αναπόφευκτο.
|
||||
Όταν ένας δίσκος χαλάσει, τα δεδομένα του χάνονται. Μια μέθοδος
|
||||
για να αποφύγουμε την απώλεια δεδομένων εξαιτίας ενός χαλασμένου
|
||||
δίσκου είναι να δημιουργήσουμε μια συστοιχία
|
||||
<acronym>RAID</acronym>. Τα pools του <acronym>ZFS</acronym> έχουν
|
||||
σχεδιασθεί ώστε να υποστηρίζουν αυτό το χαρακτηριστικό.
|
||||
Η λειτουργία αυτή αναλύεται στην επόμενη ενότητα.</para>
|
||||
</sect3>
|
||||
|
||||
<sect3>
|
||||
<title><acronym>ZFS</acronym> RAID-Z</title>
|
||||
|
||||
<para>As previously noted, this section will assume that
|
||||
two <acronym>SCSI</acronym> exists as devices
|
||||
<devicename>da0</devicename> and
|
||||
<devicename>da1</devicename>. To create a
|
||||
<acronym>RAID</acronym>-Z pool, issue the following
|
||||
command:</para>
|
||||
<para>Όπως αναφέραμε προηγουμένως, η ενότητα αυτή προϋποθέτει ότι
|
||||
χρησιμοποιούμε δύο συσκευές
|
||||
<acronym>SCSI</acronym> με ονόματα συσκευών
|
||||
<devicename>da0</devicename> και
|
||||
<devicename>da1</devicename>. Για να δημιουργήσουμε ένα pool τύπου
|
||||
<acronym>RAID</acronym>-Z, εκτελούμε την ακόλουθη εντολή:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>zpool create storage raidz da0 da1</userinput></screen>
|
||||
|
||||
<para>The <literal>storage</literal> zpool should have been
|
||||
created. This may be verified by using the &man.mount.8; and
|
||||
&man.df.1; commands as before. More disk devices may have
|
||||
been allocated by adding them to the end of the list above.
|
||||
Make a new file system in the pool, called
|
||||
<literal>home</literal> where user files will eventually be
|
||||
placed:</para>
|
||||
<para>Θα δημιουργηθεί το <literal>storage</literal> zpool. Μπορείτε
|
||||
να επαληθεύσετε το αποτέλεσμα χρησιμοποιώντας, όπως και
|
||||
προηγουμένως, τις εντολές &man.mount.8; και &man.df.1;. Θα
|
||||
μπορούσαμε να χρησιμοποιήσουμε περισσότερους δίσκους, προσθέτοντας
|
||||
τα ονόματα συσκευών τους στο τέλος της παραπάνω λίστας.
|
||||
Δημιουργήστε ένα νέο σύστημα αρχείων στο pool, το οποίο θα
|
||||
ονομάζεται <literal>home</literal> και όπου θα αποθηκεύονται τελικά
|
||||
τα αρχεία των χρηστών:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>zfs create storage/home</userinput></screen>
|
||||
|
||||
<para>It is now possible to enable compression and keep extra
|
||||
copies of the user's home directories and files. This may
|
||||
be accomplished just as before using the following
|
||||
commands:</para>
|
||||
<para>Μπορούμε τώρα να ενεργοποιήσουμε την συμπίεση και να κρατάμε
|
||||
επιπλέον αντίγραφα των καταλόγων και των δεδομένων των χρηστών.
|
||||
Όπως και προηγουμένως, μπορούμε να το επιτύχουμε χρησιμοποιώντας
|
||||
τις παρακάτω εντολές:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>zfs set copies=2 storage/home</userinput>
|
||||
&prompt.root; <userinput>zfs set compression=gzip storage/home</userinput></screen>
|
||||
|
||||
<para>To make this the new home directory for users, copy the
|
||||
user data to this directory, and create the appropriate
|
||||
symbolic links:</para>
|
||||
<para>Για να γίνει αυτός ο νέος κατάλογος των χρηστών, αντιγράψτε τα
|
||||
δεδομένα τους σε αυτόν και δημιουργήστε τους κατάλληλους
|
||||
συμβολικούς δεσμούς:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>cp -rp /home/* /storage/home</userinput>
|
||||
&prompt.root; <userinput>rm -rf /home /usr/home</userinput>
|
||||
&prompt.root; <userinput>ln -s /storage/home /home</userinput>
|
||||
&prompt.root; <userinput>ln -s /storage/home /usr/home</userinput></screen>
|
||||
|
||||
<para>Users should now have their data stored on the freshly
|
||||
created <filename class="directory">/storage/home</filename>
|
||||
file system. Test by adding a new user and logging in as
|
||||
that user.</para>
|
||||
<para>Τα δεδομένα των χρηστών θα αποθηκεύονται τώρα στο νέο σύστημα
|
||||
αρχείων <filename class="directory">/storage/home</filename>.
|
||||
Για να το επαληθεύσετε, δημιουργήστε ένα νέο χρήστη και εισέλθετε
|
||||
στο σύστημα με το νέο λογαριασμό.</para>
|
||||
|
||||
<para>Try creating a snapshot which may be rolled back
|
||||
later:</para>
|
||||
<para>Δοκιμάστε να δημιουργήσετε ένα στιγμιότυπο (snapshot) στο
|
||||
οποίο θα μπορείτε να επανέλθετε αργότερα:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>zfs snapshot storage/home@08-30-08</userinput></screen>
|
||||
|
||||
<para>Note that the snapshot option will only capture a real
|
||||
file system, not a home directory or a file. The
|
||||
<literal>@</literal> character is a delimiter used between
|
||||
the file system name or the volume name. When a user's
|
||||
home directory gets trashed, restore it with:</para>
|
||||
<para>Σημειώστε ότι η επιλογή δημιουργίας στιγμιότυπου λειτουργεί
|
||||
μόνο σε πραγματικό σύστημα αρχείων, και όχι σε κάποιο μεμονωμένο
|
||||
κατάλογο ή αρχείο. Ο χαρακτήρας <literal>@</literal>
|
||||
χρησιμοποιείται ως διαχωριστικό μεταξύ του συστήματος αρχείων και
|
||||
του ονόματος τόμου. Αν καταστραφεί ο κατάλογος δεδομένων κάποιου
|
||||
χρήστη αποκαταστήστε τον με την εντολή:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>zfs rollback storage/home@08-30-08</userinput></screen>
|
||||
|
||||
<para>To get a list of all available snapshots, run the
|
||||
<command>ls</command> in the file system's
|
||||
<filename class="directory">.zfs/snapshot</filename>
|
||||
directory. For example, to see the previously taken
|
||||
snapshot, perform the following command:</para>
|
||||
<para>Για να δείτε μια λίστα των διαθέσιμων στιγμιότυπων, εκτελέστε
|
||||
την εντολή <command>ls</command> στον κατάλογο
|
||||
<filename class="directory">.zfs/snapshot</filename> του συστήματος
|
||||
αρχείων. Για παράδειγμα, για να δείτε το στιγμιότυπο που
|
||||
δημιουργήσαμε προηγουμένως, εκτελέστε την παρακάτω εντολή:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>ls /storage/home/.zfs/snapshot</userinput></screen>
|
||||
|
||||
<para>It is possible to write a script to perform monthly
|
||||
snapshots on user data; however, over time, snapshots
|
||||
may consume a great deal of disk space. The previous
|
||||
snapshot may be removed using the following command:</para>
|
||||
<para>Είναι δυνατόν να γράψετε κάποιο script που να δημιουργεί
|
||||
μηνιαία στιγμιότυπα των δεδομένων των χρηστών. Ωστόσο, με την
|
||||
πάροδο του χρόνου, τα στιγμιότυπα θα καταναλώσουν μεγάλο ποσοστό
|
||||
του χώρου στο δίσκο. Μπορείτε να διαγράψετε το προηγούμενο
|
||||
στιγμιότυπο χρησιμοποιώντας την παρακάτω εντολή:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>zfs destroy storage/home@08-30-08</userinput></screen>
|
||||
|
||||
<para>There is no reason, after all of this testing, we should
|
||||
keep <filename class="directory">/storage/home</filename>
|
||||
around in its present state. Make it the real
|
||||
<filename class="directory">/home</filename> file
|
||||
system:</para>
|
||||
<para>Δεν υπάρχει λόγος, μετά από όλες αυτές τις δοκιμές, να
|
||||
κρατήσουμε το <filename class="directory">/storage/home</filename>
|
||||
στην παρούσα κατάσταση του. Μετατρέψτε το στο πραγματικό σύστημα
|
||||
αρχείων <filename class="directory">/home</filename>:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>zfs set mountpoint=/home storage/home</userinput></screen>
|
||||
|
||||
<para>Issuing the <command>df</command> and
|
||||
<command>mount</command> commands will show that the system
|
||||
now treats our file system as the real
|
||||
<para>Χρησιμοποιώντας τις εντολές <command>df</command> και
|
||||
<command>mount</command> θα δούμε ότι το σύστημα χειρίζεται πλέον
|
||||
αυτό το σύστημα αρχείων ως το πραγματικό
|
||||
<filename class="directory">/home</filename>:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>mount</userinput>
|
||||
|
@ -446,32 +463,33 @@ devfs 1 1 0 100% /dev
|
|||
storage 17547008 0 17547008 0% /storage
|
||||
storage/home 17547008 0 17547008 0% /home</screen>
|
||||
|
||||
<para>This completes the <acronym>RAID</acronym>-Z
|
||||
configuration. To get status updates about the file systems
|
||||
created during the nightly &man.periodic.8; runs, issue the
|
||||
following command:</para>
|
||||
<para>Εδώ ολοκληρώνεται η ρύθμιση του <acronym>RAID</acronym>-Z.
|
||||
Για να δέχεστε αναφορές κατάστασης σχετικά με τα συστήματα
|
||||
αρχείων κατά τη νυκτερινή εκτέλεση του &man.periodic.8;, δώστε την
|
||||
παρακάτω εντολή:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>echo 'daily_status_zfs_enable="YES"' >> /etc/periodic.conf</userinput></screen>
|
||||
</sect3>
|
||||
|
||||
<sect3>
|
||||
<title>Recovering <acronym>RAID</acronym>-Z</title>
|
||||
<title>Ανάκτηση του <acronym>RAID</acronym>-Z</title>
|
||||
|
||||
<para>Every software <acronym>RAID</acronym> has a method of
|
||||
monitoring their <literal>state</literal>.
|
||||
<acronym>ZFS</acronym> is no exception. The status of
|
||||
<acronym>RAID</acronym>-Z devices may be viewed with the
|
||||
following command:</para>
|
||||
<para>Κάθε λογισμικό <acronym>RAID</acronym> έχει μια μέθοδο για
|
||||
επίβλεψη της κατάστασής του, και το <acronym>ZFS</acronym> δεν
|
||||
αποτελεί εξαίρεση. Μπορείτε να δείτε την κατάσταση των συσκευών
|
||||
του <acronym>RAID</acronym>-Z χρησιμοποιώντας την ακόλουθη
|
||||
εντολή:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>zpool status -x</userinput></screen>
|
||||
|
||||
<para>If all pools are healthy and everything is normal, the
|
||||
following message will be returned:</para>
|
||||
<para>Αν όλα τα pools είναι σε υγιή κατάσταση, θα πάρετε το ακόλουθο
|
||||
μήνυμα:</para>
|
||||
|
||||
<screen>all pools are healthy</screen>
|
||||
|
||||
<para>If there is an issue, perhaps a disk has gone offline,
|
||||
the pool state will be returned and look similar to:</para>
|
||||
<para>Αν υπάρχει κάποιο πρόβλημα, π.χ. κάποιος δίσκος έχει βγει
|
||||
εκτός λειτουργίας, θα δείτε την περιγραφή της κατάστασης σε
|
||||
ένα μήνυμα όπως το παρακάτω:</para>
|
||||
|
||||
<screen> pool: storage
|
||||
state: DEGRADED
|
||||
|
@ -491,23 +509,23 @@ config:
|
|||
|
||||
errors: No known data errors</screen>
|
||||
|
||||
<para>This states that the device was taken offline by the
|
||||
administrator. This is true for this particular example.
|
||||
To take the disk offline, the following command was
|
||||
used:</para>
|
||||
<para>Το παραπάνω δείχνει ότι η συσκευή τέθηκε εκτός λειτουργίας
|
||||
από τον διαχειριστή. Αυτό είναι αλήθεια για το συγκεκριμένο
|
||||
παράδειγμα. Για να τεθεί ο δίσκος εκτός, χρησιμοποιήθηκε η
|
||||
παρακάτω εντολή:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>zpool offline storage da1</userinput></screen>
|
||||
|
||||
<para>It is now possible to replace the
|
||||
<devicename>da1</devicename> after the system has been
|
||||
powered down. When the system is back online, the following
|
||||
command may issued to replace the disk:</para>
|
||||
<para>Μπορούμε τώρα να αντικαταστήσουμε το δίσκο
|
||||
<devicename>da1</devicename> μετά την απενεργοποίηση του
|
||||
συστήματος. Όταν το σύστημα επανέλθει σε λειτουργία, μπορούμε να
|
||||
χρησιμοποιήσουμε την ακόλουθη εντολή για να ενημερώσουμε το
|
||||
σύστημα για την αντικατάσταση του δίσκου:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>zpool replace storage da1</userinput></screen>
|
||||
|
||||
<para>From here, the status may be checked again, this time
|
||||
without the <option>-x</option> flag to get state
|
||||
information:</para>
|
||||
<para>Από εδώ, μπορούμε να ελέγξουμε ξανά την κατάσταση, αυτή τη
|
||||
φορά χωρίς την επιλογή <option>-x</option>:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>zpool status storage</userinput>
|
||||
pool: storage
|
||||
|
@ -523,38 +541,42 @@ config:
|
|||
|
||||
errors: No known data errors</screen>
|
||||
|
||||
<para>As shown from this example, everything appears to be
|
||||
normal.</para>
|
||||
<para>Όπως φαίνεται στο παράδειγμα, τα πάντα φαίνεται να λειτουργούν
|
||||
φυσιολογικά.</para>
|
||||
</sect3>
|
||||
|
||||
<sect3>
|
||||
<title>Data Verification</title>
|
||||
<title>Επαλήθευση Δεδομένων</title>
|
||||
|
||||
<para>As previously mentioned, <acronym>ZFS</acronym> uses
|
||||
<literal>checksums</literal> to verify the integrity of
|
||||
stored data. They are enabled automatically upon creation
|
||||
of file systems and may be disabled using the following
|
||||
command:</para>
|
||||
<para>Όπως αναφέραμε προηγουμένως, το <acronym>ZFS</acronym>
|
||||
χρησιμοποιεί <literal>checksums</literal> (αθροίσματα ελέγχου) για
|
||||
να επαληθεύσει την ακεραιότητα των αποθηκευμένων δεδομένων.
|
||||
Τα αθροίσματα ελέγχου ενεργοποιούνται αυτόματα κατά την δημιουργία
|
||||
των συστημάτων αρχείων, και μπορούν να απενεργοποιηθούν μέσω της
|
||||
επόμενης εντολής:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>zfs set checksum=off storage/home</userinput></screen>
|
||||
|
||||
<para>This is not a wise idea; however, as checksums take
|
||||
very little storage space and are more useful enabled. There
|
||||
also appear to be no noticeable costs having them enabled.
|
||||
While enabled, it is possible to have <acronym>ZFS</acronym>
|
||||
check data integrity using checksum verification. This
|
||||
process is known as <quote>scrubing.</quote> To verify the
|
||||
data integrity of the <literal>storage</literal> pool, issue
|
||||
the following command:</para>
|
||||
<para>Αυτό δεν είναι γενικά καλή ιδέα, καθώς τα checksums
|
||||
καταλαμβάνουν ελάχιστο αποθηκευτικό χώρο, και είναι πολύ πιο
|
||||
χρήσιμο να τα έχουμε ενεργοποιημένα. Επίσης δεν φαίνεται να
|
||||
προκαλούν κάποια σημαντική καθυστέρηση ή επιβάρυνση. Με τα
|
||||
checksums ενεργοποιημένα, μπορούμε να ζητήσουμε από το
|
||||
<acronym>ZFS</acronym> να ελέγξει την ακεραιότητα των δεδομένων
|
||||
χρησιμοποιώντας τα για επαλήθευση. Η διαδικασία αυτή είναι
|
||||
γνωστή ως <quote>scrubing.</quote> Για να ελέγξετε την
|
||||
ακεραιότητα δεδομένων του pool <literal>storage</literal>,
|
||||
χρησιμοποιήστε την παρακάτω εντολή:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>zpool scrub storage</userinput></screen>
|
||||
|
||||
<para>This process may take considerable time depending on
|
||||
the amount of data stored. It is also very
|
||||
<acronym>I/O</acronym> intensive, so much that only one
|
||||
of these operations may be run at any given time. After
|
||||
the scrub has completed, the status is updated and may be
|
||||
viewed by issuing a status request:</para>
|
||||
<para>Η διαδικασία αυτή μπορεί να πάρει αρκετή ώρα, ανάλογα με την
|
||||
ποσότητα των αποθηκευμένων δεδομένων. Επίσης χρησιμοποιεί πάρα
|
||||
πολύ το δίσκο (<acronym>I/O</acronym>), τόσο ώστε σε κάθε
|
||||
δεδομένη στιγμή μπορεί να εκτελείται μόνο μια τέτοια διαδικασία.
|
||||
Μετά την ολοκλήρωση του scrub, θα ανανεωθεί και η αναφορά
|
||||
κατάστασης, την οποία μπορείτε να δείτε ζητώντας την με την
|
||||
παρακάτω εντολή:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>zpool status storage</userinput>
|
||||
pool: storage
|
||||
|
@ -570,13 +592,12 @@ config:
|
|||
|
||||
errors: No known data errors</screen>
|
||||
|
||||
<para>The completion time is in plain view in this example.
|
||||
This feature helps to ensure data integrity over a long
|
||||
period of time.</para>
|
||||
<para>Στο παράδειγμα μας εμφανίζεται και η χρονική στιγμή που
|
||||
ολοκληρώθηκε η εντολή scrub. Η δυνατότητα αυτή μας εξασφαλίζει
|
||||
ακεραιότητα δεδομένων σε μεγάλο βάθος χρόνου.</para>
|
||||
|
||||
<para>There are many more options for the Z file system,
|
||||
see the &man.zfs.8; and &man.zpool.8; manual
|
||||
pages.</para>
|
||||
<para>Υπάρχουν πολλές ακόμα επιλογές για το σύστημα αρχείων Ζ. Δείτε
|
||||
τις σελίδες manual &man.zfs.8; και &man.zpool.8;.</para>
|
||||
</sect3>
|
||||
</sect2>
|
||||
</sect1>
|
||||
|
@ -628,3 +649,14 @@ http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/usb-disks.html
|
|||
-->
|
||||
|
||||
</chapter>
|
||||
|
||||
<!--
|
||||
Local Variables:
|
||||
mode: sgml
|
||||
sgml-declaration: "../chapter.decl"
|
||||
sgml-indent-data: t
|
||||
sgml-omittag: nil
|
||||
sgml-always-quote-attributes: t
|
||||
sgml-parent-document: ("../book.sgml" "part" "chapter")
|
||||
End:
|
||||
-->
|
||||
|
|
Loading…
Reference in a new issue