wiki:CodaHOWTO/Using
close Warning:

Exploring Coda's features

Restarting a server

On the server the command volutil shutdown will stop the server. If it is really toasted, you might need to kill the codasrv process.

To restart the server issue the command startserver. This shell script invokes codasrv with the correct arguments. If it complains about a server already running do the following: first check with ps auxww | grep codasrv if this is the case. If not, remove the file /vice/srv/pid and reissue the startserver command.

Getting more volumes

It is a good idea to create a few extra volumes on your server and mount these in the coda directory tree. In particular if you want to explore reintegration, conflict resolution and replication servers we recommend that you do that in new volumes and not in the volume mounted on the root of the Coda file system.

To make a new volume:

  1. make sure your codasrv, updateclnt and updatesrv daemons are running.
  2. type createvol_rep volname servername[/partitionname]. Typically you determine your own volume name, and the partition name will default to /vicepa if it is not specified.
  3. mount the volume using cfs makemount path volumename. This creates the mount point, and mounts the volume.

To explore volumes you can use other cfs commands, such as cfs whereis path and cfs listvolume path . To see the FID of a file type cfs getfid path.

Adding a user

As of release 5.2 we have a tool to manage the user database. It is basic, but can handle things like hierarchical groups and is a major improvement over the old tools.

  1. Run pdbtool on the SCM. Type help to see commands, and type the command without arguments to get more help. There is also a manpage for pdbtool which you may want consult.
  2. Add the user and her user id with the nui command.
  3. Add the user to any groups you want.
  4. Give the new user a password by running au nu from either a client or a server.

The user should now be able to login to Coda just like the first user set up at installation time.

Exploring ACL's

You can set and list Access Control Lists on directories using cfs setacl dir user rights [user rights...]. To show the ACLs type cfs listacl directory.

Monitoring Coda

Use codacon to see many RPC's and a few other actions taken by the client. The files in /usr/coda/etc/ or /var/log/coda/ also contain interesting information.

To see how a server is doing use cmon or check the logs in /vice/srv/.

Using Coda disconnected and reintegrating

First create a new volume, not equal to your root volume, to explore this. Should you get conflicts in your root volume then they will be hard to repair. See below how to add a volume.

  1. change directory into this volume. Get tokens using clog. Do ls -l on the directory where you want to start work while disconnected.
  2. type cfs disconnect or disconnect your network. After 30 seconds you can see that codacon (which you should always run) displays that your server is not reachable anymore.
  3. do some work disconnected, create some files, edit them etc.
  4. type cfs reconnect. Venus will discover that the net is up, but you can speed that up by typing cfs checkservers. Monitoring codacon, you will see that your changes are being reintegrated.

To start Coda while disconnected, you may need the ip addresses and host names of your servers in /etc/hosts .

Repairing conflicts

Files and directories can get into conflict due to disconnections of clients or servers from the net, as well as through overlapping open/write/close sequences on two clients. A object that is in conflict is represented as a dangling symbolic link with a contents that looks like @00000000.0000000000.00000000.

How do we get rid of this conflict?

  1. type cfs beginrepair X. This changes X from a symlink into a directory. By doing ls X you will see either local global or server1 server2 server3 . In the first case we have a local-global conflict and in the second case a server-server conflict.
  2. If the objects in the directory X are files, you have a file conflict, they can also be directories, in which case you can find the content underneath.
  3. If you are nervous, this is a good moment to make copy of your files. They can be found under the directory X while the repair session is in progress.
  4. cfs endrepair X closes up the repair session.
  5. All local global conflicts are repaired with repair. Type repair and follow its cryptic instructions.
  6. Server-server conflicts on files are fixed with either filerepair or removed with removeinc. Server-server conflicts on directories are fixed with repair.

Exploring replication

First you will have to add a second server to your Coda cluster. Install the software and use vice-setup again. This time your server is not going to be the SCM. Proceed answering the questions until done.

On the SCM add the following:

  1. Your server needs a server number, to be added to the /vice/db/servers file ON THE SCM
  2. Start updatesrv and updateclnt on the second server
  3. Start codasrv on the second server
  4. Make a new volume from the SCM using createvol_rep but this time specifying one or more servers createvol_rep volumename server1[/partition] server2[/partition]
  5. Mount the volume as above

You can now use this volume and your files will automatically be stored on multiple servers. To temporarily disable a server, and see that things continue to function normally, either shut the server down with volutil shutdown or disconnect its network.

Modifications made to coda files during the server outage will be resolved when the files are first accessed. You see message of the form Resolve path in the codacon output. By typing cfs checkservers you can see if the server is available again.

Last modified 11 years ago Last modified on Feb 8, 2007, 1:35:37 PM