April 16, 2014

The Coda Distributed Filesystem for Linux - page 5

Introduction to Coda

  • October 7, 2002
  • By Bill von Hagen

Configuring a Coda server is much simpler than configuring similar distributed filesystem servers, because the Coda server package includes a shell script that prompts you for all of the information required.

Before executing the script in this section, you should format and mount a disk partition that Coda can use for storing the data exported by your server. This should be a standard ext2 partition. The transactional nature of writes to journaling filesystems may cause synchronization problems, so you should not host Coda server data on a journaling filesystem partition (such as ext3). The standard Coda (and AFS) convention for distributed filesystem data partitions is to mount them at locations such as /vicepa (Vice partition A), /vicepb (Vice partition B), and so on. Vice is the original name of the distributed filesystem used by AFS, the original parent project of Coda.

In addition to a partition on which to store your Coda data, you will also need to specify two files or partitions to be used for logging. Coda stores log information in one of these and log metadata (summary information about log data) in the other. If you plan to run a Coda server for purposes other then experimentation, using partitions rather than files will provide higher performance. For simplicity's sake, the examples in this section use files, which I've stored in the /usr/coda/logs directory that I created for this purpose.

The following is a complete transcript of running Coda's vice-setup script. To make this more readable, responses to the script are red. The example provides explicit answers to all of the prompts, even where default values are available by pressing . Comments are interspersed in standard text format--the input and output to the script is displayed in verbatim text format.

Welcome to the Coda Server Setup script!

Setting up config files for a coda server.
Do you want the file /etc/coda/server.conf created? [yes] yes
What is the root directory for your coda server(s)? [/vice] /vice
Setting up /vice.
Directories under /vice are set up.

Is this the master server, aka the SCM machine? (y/n) y

Setting up tokens for authentication.
The following token must be identical on all servers.
Enter a random token for update authentication : foobar
The following token must be identical on all servers.
Enter a random token for auth2 authentication : foobar
The following token must be identical on all servers.
Enter a random token for volutil authentication : foobar
tokens done!

Your first (or only, in this case) Coda server is usually the master server. The master server provides volume location and other information to Coda clients. The text strings that you enter as random tokens for various types of authentication used by Coda ("foobar" in the previous examples) can be any sequence of characters.

Setting up the file list for update client
Filelist for update ready.
/etc/services already has new services registered! Good.
/etc/services ready for Coda
Now installing files specific to the SCM...

Setting up servers file.
Enter an id for the SCM server. (hostname distfs)
The serverid is a unique number between 0 and 255.
You should avoid 0, 127, and 255.
serverid: 1
Initializing the VSGDB to contain the SCM as E0000100
/vice/db/VSGDB set up

Setting up ROOTVOLUME file
Enter the name of the rootvolume (< 32 chars) : codaroot

The serverid number and rootvolume names can be anything that you want. Production Coda configurations typically use a standard numbering and naming convention.

Setting up users and groups for Coda

You need to give me a uid (not 0) and username (not root)
for a Coda System:Administrator member on this server,
(sort of a Coda super user)

Enter the uid of this user: 666
Enter the username of this user: codaroot
Going to rebuild the protection databases
moving /vice/db/prot_users.db to /vice/db/prot_users.db.old
moving /vice/db/prot_index.db to /vice/db/prot_index.db.old
An initial administrative user codaroot (id 666)
with Coda password changeme now exists.

The UID and username that you specify in this section do not have to be those of existing Linux users. They are internal to the authentication mechanism used by Coda. You'll need to remember the username that you specified as the Coda system administrator, since you will need to authenticate as this user whenever you perform any privileged Coda operation, such as creating accounts, setting ACLs in portions of the Coda filesystem owned by the system administrator, and so on.

A server needs a small log disk partition, preferably on a disk by
itself. It also needs a metadata partition of approx 4% of your filespace.

For trial purposes you may give ordinary files instead of raw
partitions. Keep all size small if you do this.
Production servers will want partitions for speed.

WARNING: you are going to play with your partitions now.
verify all answers you give.

WARNING: these choices are not easy to change once you are up and running.

Are you ready to set up RVM? [yes/no] yes

What is your log partition? /usr/coda/logs/log_disk_file.log

The log size must be smaller than you log partition.  We
recommend not more than 30M log size, and 2M is a good choice.
What is your log size? (enter as e.g. '2M') 2M

What is your data partition (or file)? /usr/coda/logs/data_disk_file.log

The data size must be approx 4% of you server file space.  We
have templates for servers of approx: 500M, 1G, 2.2G, 3.3G, 8G
(you can store less, but not more on such servers).
The corresponding data sizes are  22M, 44M, 90M, 130M, 315M.
Pick one of the defaults, otherwise I will bail out

What is the size of you data partition (or file)
[22M, 44M, 90M, 130M, 200M, 315M]: 22M

WARNING: DATA and LOG partitions are about to be wiped.

  log area: /usr/coda/logs/log_disk_file.log, size 2M.
  data area: /usr/coda/logs/data_disk_file.log, size 22M.

Proceed, and wipe out old data? [y/n] y

LOG file has been initialized!

Rdsinit will initialize data and log.
This takes a while.
rvm_initialize succeeded.
Going to initialize data file to zero, could take awhile.
rds_zap_heap completed successfully.
rvm_terminate succeeded.

RVM setup is done!

The previous section specifies where Coda should store internal status information. These can be either files or existing disk partitions. In production Coda environments, log data and Coda transaction metadata (internal recoverable virtual memory information about Coda data transfers, lookups, file status, and so on) should be stored in disk partitions to improve performance. When experimenting, using files instead of partitions is standard practice.

Your server directories will hold the files (not directories).
You can currently only have one directory per disk partition.

Where shall we store your file data [/vicepa]? /vicepa
Shall I set up a vicetab entry for /vicepa (y/n) y
Select the maximum number of files for the server.
[256K, 1M, 2M, 16M]: 16M

Server directory /vicepa is set up!

As explained at the beginning of this section, the partition you specify in this section should already exist and should have been mounted before running the Coda server's setup script.

Congratulations: your configuration is ready...and now
to get going do the following:

  start the auth2 server as: auth2
  start rpc2portmap as: rpc2portmap
  start updatesrv as: updatesrv
  start updateclnt as:  updateclnt -h distfs.vonhagen.org
  start the fileserver: startserver &
  wait until the server is up: tail -f /vice/srv/SrvLog
  create your root volume: createvol_rep codaroot E0000100 /vicepa
  setup a client: venus-setup distfs.vonhagen.org 20000
  start venus: venus
  enjoy Coda.
  for more information see http://www.coda.cs.cmu.edu.

The final messages from the Coda server setup script explain what you need to do in order to actually start the Coda server now that its configuration is complete. All of the applications referenced in this section were installed in the directory /usr/sbin as part of installing the Coda server package, so this directory must be located in the root user's path to refer to them by anything other than a full pathname.

The following is a transcript of starting the processes required by Coda:

/usr/sbin/updateclnt -h distfs.vonhagen.org
Creating /vice/spool
startserver &
v[2] 15112

The name of the host that you specify as an argument to the updateclnt command must be name of the host on which you're installing this Coda server. The updateclnt server synchronizes system binaries between file servers and control machines--in this case, since both are the same, it is conceptually extraneous, but is still required by the system.

The last step in bringing your Coda server to life is to actually create a replicated, read/write Coda volume on the partition you set aside for Coda data. The following example shows this command and its output. You should type the command exactly as it is specified in the final output of the Coda server setup script, since this uses the values you specified during the installation process.

createvol_rep codaroot E0000100 /vicepa
Getting initial version of /vice/vol/BigVolumeList.
V_BindToServer: binding to host distfs.vonhagen.org
GetVolumeList finished successfully
V_BindToServer: binding to host distfs.vonhagen.org
Servers are (distfs )
HexGroupId is 7f000000
creating volume codaroot.0 on distfs (partition /vicepa)
V_BindToServer: binding to host distfs.vonhagen.org
V_BindToServer: binding to host distfs.vonhagen.org
Set Log parameters
Fetching volume lists from servers:
V_BindToServer: binding to host distfs.vonhagen.org
GetVolumeList finished successfully
 distfs - success
V_BindToServer: binding to host distfs.vonhagen.org
VLDB completed.
>  /vice/db/VRList.new>
V_BindToServer: binding to host distfs.vonhagen.org
VRDB completed.
Do you wish this volume to be Backed Up (y/n)? [n] n

At this point, your Coda server is running, but no Coda client knows how to connect to it--Coda clients need to know which master server(s) controls the administrative domain that they're associated with. The next section explains how to modify a Coda client (whose installation was explained earlier in this article) so that it will talk to your Coda server.

Sitemap | Contact Us