Sophie

Sophie

distrib > Mandriva > 8.2 > i586 > media > contrib > by-pkgid > 211238da6d926d1ca4390483bb29f586 > files > 7

coda-doc-5.2.0-4mdk.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
 <META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9">
 <TITLE>The Coda HOWTO: Configuring and starting Coda </TITLE>
 <LINK HREF="coda-howto-4.html" REL=next>
 <LINK HREF="coda-howto-2.html" REL=previous>
 <LINK HREF="coda-howto.html#toc3" REL=contents>
</HEAD>
<BODY>
<A HREF="coda-howto-4.html">Next</A>
<A HREF="coda-howto-2.html">Previous</A>
<A HREF="coda-howto.html#toc3">Contents</A>
<HR>
<H2><A NAME="s3">3. Configuring and starting Coda </A></H2>

<P>
<P><B>WARNING:</B>
<P>CODA IS BARELY READY FOR PRODUCTION USE. THIS RELEASE IS JUST FOR
THOSE INTERESTED IN EXPLORING THOSE FEATURES WHICH WORK. IT CONTAINS
KERNEL CODE, AND SERVERS RUNNING WITH ROOT PRIVILEGES, AND COULD LEAD
TO DATA LOSS.
<P>
<P>To get Coda running you will go through 3 steps:
<OL>
<LI> Get a Coda enabled kernel for the client. (The server does not
need a special kernel)</LI>
<LI> Configure and run the client cache manager Venus</LI>
<LI> Configure and run the file server, authentication server and
update servers</LI>
<LI> Connect a client to your new server. </LI>
</OL>
<P>
<H2><A NAME="ss3.1">3.1 Getting a Coda enabled kernel </A>
</H2>

<P>
<P>Before you can use a Coda client you need a new filesystem driver in
your kernel. For the most part this driver redirects requests to the
user level cache manager <B>venus</B>.  Precompiled modules exist
for commonly used kernels. If no module exists for you, you'll find
instructions below where to find it.
<P>
<H3>Linux </H3>

<P>
<P>Get a 
<A HREF="ftp://ftp.coda.cs.cmu.edu/pub/coda/linux">coda-fs-module-k2.?.?-c?.?.?.arch.rpm</A> rpm package and
install it.  <CODE>k2.?.?</CODE> should match your kernel version (use uname
-a) and <CODE>c?.?.?</CODE> should match you Coda version.
<P>Linux kernels change often and many people have custom kernels for their environment.  Our modules will generally only work on RedHat Linux kernels and you may have to build a module for your kernel. Look at the section 
<A HREF="coda-howto-6.html#Modules">building a kernel module.</A><P>
<H3>FreeBSD </H3>

<P>
<P>You may obtain a Coda lkm from your FreeBSD distribution:
<BLOCKQUOTE><CODE>
<PRE>
cd /lkm
</PRE>
</CODE></BLOCKQUOTE>

Check if <CODE>coda_mod.o</CODE> is there already.
Otherwise, you may obtain a Coda lkm from the Coda site:
<BLOCKQUOTE><CODE>
<PRE>
ftp://ftp.coda.cs.cmu.edu/pub/coda/freebsd/3.0-aout/i386/coda_mod.o
</PRE>
</CODE></BLOCKQUOTE>
<P>You then install the lkm with:
<BLOCKQUOTE><CODE>
<PRE>
modload -v -e coda_mod -o /var/run/lkm.coda /lkm/coda_mod.o
</PRE>
</CODE></BLOCKQUOTE>
<P>You can build support for the Coda VFS layer into your kernel.
This is discussed later in the <EM>Building FreeBSD</EM> section.
<P>
<P>
<H3>NetBSD </H3>

<P>
<P><B>NOTE:</B> The GENERIC NetBSD kernel should have Coda enabled.  Do
an:
<BLOCKQUOTE><CODE>
<PRE>
nm -o /netbsd | grep coda_open
</PRE>
</CODE></BLOCKQUOTE>

If this is present, you are done with this section.  <B>PROCEED NO
FURTHER</B>
<P>
<P>If you need to load an lkm it should be in the NetBSD distribution:
<BLOCKQUOTE><CODE>
<PRE>
cd /usr/lkm
</PRE>
</CODE></BLOCKQUOTE>
<P>Check if coda.o is there already.
Otherwise, you may obtain a Coda lkm from the Coda site:
<BLOCKQUOTE><CODE>
<PRE>
ftp://ftp.coda.cs.cmu.edu/pub/coda/netbsd/current/i386/coda-1_3H.o
</PRE>
</CODE></BLOCKQUOTE>
<P>You then install the lkm with:
<BLOCKQUOTE><CODE>
<PRE>
modload -v -e coda_lkmentry -o /var/run/lkm.coda /usr/lkm/coda-1_3H.o
</PRE>
</CODE></BLOCKQUOTE>
<P>You can build support for the Coda VFS layer into your kernel, though
this should be automatic.
This is discussed later in the <EM>Building NetBSD</EM> section.
<P>
<P>
<H3>Windows 95 &amp; NT </H3>

<P>
<P>The kernel module is part of the Coda client installer. 
<P>
<P>
<H2><A NAME="ss3.2">3.2 Linux and the BSD's: running Venus, the client cache manager</A>
</H2>

<P>
<P>These are partial instructions on how to setup and configure the Coda
filesystem.  Refinements to the setup created here are discussed in 
<A HREF="http://ftp.coda.cs.cmu.edu/doc/html/manual.html">http://ftp.coda.cs.cmu.edu/doc/html/manual.html</A>   You
will probably not need these refinements in the first instance.
<P>The <CODE>venus-setup</CODE> script does all the hard work, it will setup the coda
control files, create <CODE>/dev/cfs0</CODE> to communicate with the
kernel, ...  It also initializes a directory for cache files.  In your
first Coda run we recommend a small cache, say 20MB. The cache size
should be at least 10Meg, typically 60-200Meg is used.  Do not go
above 300Meg.  All the files created will be placed under
<CODE>/usr/coda</CODE>.  You should make sure that there is enough space
in the file system on which <CODE>/usr/coda</CODE> resides to hold a fully
populated cache.
<P>
<BLOCKQUOTE><CODE>
<PRE>
venus-setup &lt;comma_separated_host_list> &lt;cache_size_in_kb>
</PRE>
</CODE></BLOCKQUOTE>
<P>
<P><CODE>venus-setup</CODE> and <CODE>venus</CODE> (below) are in <CODE>/usr/sbin</CODE>.
Make sure that <CODE>/usr/sbin</CODE> is in your path or that you use
fully qualified pathnames.  We strongly recommend that you try
testserver.coda.cs.cmu.edu as the <CODE>comma_separated_host_list</CODE>
first, and keep the cache size to 20000.
<P><B>NOTE:</B> <CODE>venus-setup</CODE> will edit <CODE>/etc/services</CODE> to add some additional
services. 
<P>The following assumes you are running X-Windows.  However, you could
run these commands from virtual consoles as well, by omitting the
<CODE>xterm -e</CODE> in front of the commands below.
<P>Start Venus with:
<BLOCKQUOTE><CODE>
<PRE>
venus &amp;
</PRE>
</CODE></BLOCKQUOTE>
<P>An <CODE>-init</CODE> flag can be given when <CODE>venus</CODE> is started; it flushes the
local cache contents.  <CODE>venus-setup</CODE> forces an init to happen when
venus is first started.  The <CODE>-init</CODE> flag can be given if Coda
cannot recover it's cache after a crash, or after editing the
<CODE>vstab</CODE> file manually. 
<P>Observe the venus log with:
<BLOCKQUOTE><CODE>
<PRE>
xterm -e tail -f /usr/coda/etc/console
</PRE>
</CODE></BLOCKQUOTE>

It will tell you when venus has started and give status.
<P>Type:
<BLOCKQUOTE><CODE>
<PRE>
xterm -e codacon &amp;
</PRE>
</CODE></BLOCKQUOTE>

to see the communications between the Venus and Vice.
<P>It is possible to see the upcalls from the kernel to Venus by turning
up logging in Venus, but they are not very interesting.  (To turn on
minimal debugging, type:
<BLOCKQUOTE><CODE>
<PRE>
vutil -d 1
</PRE>
</CODE></BLOCKQUOTE>

and then <CODE>tail -f /usr/coda/coda.cache/venus.log</CODE>.)
<P>To halt venus, type:
<BLOCKQUOTE><CODE>
<PRE>
vutil shutdown
umount /coda  (Linux only)
</PRE>
</CODE></BLOCKQUOTE>

Or you can kill -9 venus, if you must.  
<P><B>NOTES for Linux users:</B>
<UL>
<LI> Before restarting Venus <CODE>/coda</CODE> must
be unmounted.  If umounting <CODE>/coda</CODE> gives trouble, make sure to
exit all process that hang on to Coda, e.g. by having files open or
being cd'd into /coda.  A utility like <CODE>lsof</CODE> and <CODE>fuser</CODE> can
help with this.</LI>
<LI> <CODE>/proc/fs/coda</CODE> has interesting Coda statistics. </LI>
<LI> You can enable kernel debugging  with <CODE>vutil
-kdebug 4095</CODE> and call tracing with <CODE>vutil ktrace 1</CODE>. The
messages appear in <CODE>/var/log/messages</CODE></LI>
</UL>
<P>
<H2><A NAME="sec-win95-start-conf"></A> <A NAME="ss3.3">3.3 Windows 95: Starting and Configuring a Coda client</A>
</H2>

<P> 
<P>During installation you will be prompted for the IP address of
your client and of your Coda server(s).  Enter this as indicated.
<P>All executables can be found in the directory <CODE>C:\usr\coda\bin</CODE>
<P>There are two ways to play with Coda:
<P>
<H3>CodaStart</H3>

<P>The CodaStart pogram is a Win32 windows-based application to control and
observe the Windows 95 Coda client. It will be enhanced in the future. For now
it provides a convenient way to start Venus.exe and to load the kernel module.
It also displays the kernel-venus communication for debugging purposes.
Printing the messages can be stopped by unticking the 'Monitor' check box. The
button 'Reset' clears the display.
<P>
<OL>
<LI>When you start Venus for the first time, or you want to reinitialize its
cache, tick the 'Init Venus' check box. This will start Venus with the '-init'
and '-cf 1500' flag set. To add or override flags use the 'Configure' button.
Start Venus by clicking the left 'Start' button. The 'Status' message will
tell you 'Running' when Venus starts. Note, Venus is still in the
initialization process. </LI>
<LI>Load the kernel module by clicking on the right 'Start' button. If everything
is all right you will see the 'Status' message 'Running'.</LI>
<LI>Click the 'Mount' button to mount, when you see the first messages. When you
disabled the 'Monitor', check the DOS box in which Venus runs. Venus must have
printed 'Venus starting...' before you can 'Mount'.</LI>
<LI>To unmount, press the 'Unmount' button (the 'Mount' button changed to the
'Unmount' button). This will unload the kernel module. If you are unable to
unmount Coda with CodaStart try the method described in 'Starting Coda by
hand'.</LI>
<LI>See 'Important Note' below, please.</LI>
</OL>
<P>You are now ready to browse through the Coda filesystem using the explorer!
<P>
<H3>Starting Coda by hand</H3>

<P>
<OL>
<LI> Type 
<BLOCKQUOTE><CODE>
<PRE>
relay.exe
</PRE>
</CODE></BLOCKQUOTE>

in a command Window.  This is a 32bit DOS application which you can
also start by double clicking on the file in explorer.  </LI>
<LI> Now start Venus. Type 
<BLOCKQUOTE><CODE>
<PRE>
venus.exe -cf 1500 -init
</PRE>
</CODE></BLOCKQUOTE>

in a command window. 
(this gives up to 1500 cache files, try with more if everythings works
fine. Initialization will take longer the more cache file you specifiy.)</LI>
<LI> When Venus prints  "Venus starting ..." run 
<BLOCKQUOTE><CODE>
<PRE>
mount.exe N:
</PRE>
</CODE></BLOCKQUOTE>

This maps the Coda filesystem to the <CODE>N:</CODE> drive.</LI>
</OL>
<P>You are now ready to browse through the Coda filesystem using the explorer!
<P>
<OL>
<LI> When you want to restart Venus without initializing the cache
just run  <CODE>venus.exe</CODE>.  If <CODE>venus</CODE> crashes restarting it is
normally all you need to do. </LI>
<LI> If relay crashes you will want to unmount the <CODE>N:</CODE> drive
run: 
<BLOCKQUOTE><CODE>
<PRE>
unmount.exe
</PRE>
</CODE></BLOCKQUOTE>

This will stop <CODE>relay.exe</CODE> (if it is still running)  and unload
<CODE>codadev.vxd</CODE> which was loaded by <CODE>relay.exe</CODE>.  </LI>
</OL>
 
<P>
<H3>Important Note</H3>

<P><B>NOTE:</B> In some installations the DPMI DOS Extender window suspends when 
it is not active. In this case untick the window property 'Properties->Misc->
Background->Always Suspend'. If it is unticked, ticking and unticking it again
might help. Also untick the 'Termination' flag, to allow Coda to automatically
shutdown, when the system shuts down. For your convenience tick the 'Close on
Exit' check box in the 'Program' tab.
<P>
<H2><A NAME="codasrv"></A> <A NAME="ss3.4">3.4 Codasrv -- the file server </A>
</H2>

<P>
<P>
<H3>Configuring your server</H3>

<P>
<P>To set up an SCM server, you will run a script <EM>vice-setup</EM>.  This
script creates configuration files under the <CODE> /vice </CODE>
directory and creates files and directories on your system for storage
of file data and metatdata.  To answer the questions <EM>vice-setup</EM>
is asking you need to have the following thought through:
<P>
<P>
<DL>
<P>
<DT><B>file space</B><DD><P>an empty directory (viz /vicepa) where the fileserver
will put files.  There must be as much free space on this filesystem
as the data you wish to store in Coda.
<P>
<DT><B>RVM metadata storage</B><DD><P>a file or raw partition for RVM metadata.
You can use a file but it will be quite slow on a larger server. This
partition must be around 4% of the total size of the files you wish to
store under /vicepa (e.g. on a 2GB server we use around 80M of rvm
data). For first installations we recommend the default 22M options,
and using <EM>files</EM> for RVM log and data.  (NOTE: Windows NT Setup
creates the file c:\coda\rvm\DATA. Use this for RVM metadata.)
<P>
<DT><B>virtual memory</B><DD><P>The metadata, held in the RVM data file, is
memory mapped.  You need that amount of space as virtual memory on
your system, in addition to virtual memory to run the server (&nbsp;6MB)
and other software.
<P>
<DT><B>RVM transaction log</B><DD><P>a LOG file, preferably a raw partition on a
disk by itself. This needs not be large, a few M's are fine.  (NOTE:
Windows NT Setup creates the file c:\coda\rvm\LOG. Use this for RVM
transaction log.)
<P>
<DT><B>A server number</B><DD><P>All servers in a coda cell need to have a unique number to identify
them. The servername to identifier mappings have to be defined by the
administrator in the file <CODE>/vice/db/servers</CODE> on the SCM.  The
format of this file is as follows:
<P>
<BLOCKQUOTE><CODE>
<PRE>
     servernameX.domain.name    1
     servernameY.domain.name    2
     ...
</PRE>
</CODE></BLOCKQUOTE>
<P>There are currently several limitations to which identifiers are
actually usable:
<UL>
<LI> all numbers must fit in a single byte.</LI>
<LI> 0 and -1 (255) are used in error conditions.</LI>
<LI> 127 is used to identify `replicated volumes'.</LI>
</UL>

This leaves us with a usable range of 1-126 and 128-245 for server identifiers.
<P>
<DT><B>secret tokens</B><DD><P>two secret tokens of _exactly_ 8 characters (eg
elephant).
</DL>
<P><B>NOTE:</B> you are now ready to run the setup script.  We
<B>strongly</B> recommend that you stick to default choices offered as
configuring a server differently is quite difficult. 
<P>Then run:
<BLOCKQUOTE><CODE>
<PRE>
vice-setup
</PRE>
</CODE></BLOCKQUOTE>

and answer its questions.  Note down the commands that vice-setup
prints out for you at the end.
<P><B>Note: </B> For Windows NT you will need the Cygwin B19 Shell which can
be started from the "Start" menu. The shell uses the c:\coda directory as the
root mountpoint "/".
<P>
<H3>Running Vice:</H3>

<P>
<P>Start the rpc2portmap server, update server, client and the auth
server, as well as the fileserver by typing:
<DL>
<DT><B>Linux</B><DD><P>
<BLOCKQUOTE><CODE>
<PRE>
/etc/rc.d/init.d/auth2.init start
/etc/rc.d/init.d/update.init start
/etc/rc.d/init.d/codasrv.init start
</PRE>
</CODE></BLOCKQUOTE>
<P>
<DT><B>BSDs</B><DD><P>
<BLOCKQUOTE><CODE>
<PRE>
/etc/rc.vice start
</PRE>
</CODE></BLOCKQUOTE>
<P>
<DT><B>Windows NT</B><DD><P>
<BLOCKQUOTE><CODE>
<PRE>
codastart
</PRE>
</CODE></BLOCKQUOTE>
</DL>
<P>Now observe the log:
<BLOCKQUOTE><CODE>
<PRE>
xterm -e tail -f  /vice/srv/SrvLog &amp; 
</PRE>
</CODE></BLOCKQUOTE>

The <CODE>SrvLog</CODE> should show <EM>File Server started</EM>.  If not,
you have a problem.
<P>Determine with <CODE>ps</CODE> that <CODE>codasrv</CODE>, <CODE>auth2</CODE>, <CODE>rpc2portmap</CODE>,
<CODE>updatesrv</CODE> and <CODE>updateclnt</CODE> are running.
<P>
<P>
<H3>Making your root volume</H3>

<P>
<P>During your configuration session, you commmunicated a name for the
root volume to the program.  This root volume now needs to be
craeted: the precise command to do this was printed out by the
vice-setup program, below we assume your file space is in
<CODE>/vicepa</CODE>, and your root volume is <CODE>coda:root</CODE>.
<P>
<BLOCKQUOTE><CODE>
<PRE>
createvol_rep coda:root E0000100 /vicepa
</PRE>
</CODE></BLOCKQUOTE>
<P><B>NOTE:</B>
E0000100 is the Volume Storage Group set up for you by
vice-setup. With more servers you can define other groups in
/vice/db/VSGDB -- see the Coda User Manual.
<P>
<P>
<H2><A NAME="ss3.5">3.5 Connecting your client to a new Coda server</A>
</H2>

<P>
<P>Now you are ready to point a Venus (client) at this server. You do
this by typing
<P>
<BLOCKQUOTE><CODE>
<PRE>
venus-setup  server-name cache-szie-in-kb
</PRE>
</CODE></BLOCKQUOTE>

<B>NOTE:</B> Windows 95 users should type the IP address and not the
hostname of the server.
<P>Start Venus as explained above.  From the coda client side, the root
volume will appear under /coda.  To use it you must now authenticate
to Coda, since it is write protected.
<P>The vice-setup program installed an administrative Coda user on the
server.  It has a uid you chose and has been assigned password
changeme.  You may clog into Coda with this uid:
<P>
<BLOCKQUOTE><CODE>
<PRE>
clog "adminuser"
</PRE>
</CODE></BLOCKQUOTE>

Validate that you have tokens with the <CODE>ctokens</CODE> utility. 
<P>You can now create files in <CODE>coda</CODE>, because the administrative user
is on the access control list (ACL) of the <CODE>/coda</CODE>
directory. Read the next section to find out how to do more with Coda.
<P>
<P>
<HR>
<A HREF="coda-howto-4.html">Next</A>
<A HREF="coda-howto-2.html">Previous</A>
<A HREF="coda-howto.html#toc3">Contents</A>
</BODY>
</HTML>