(Illustration by Gaich Muramatsu)
Hi Achim, Personally, I'd just shitcan the whole thing and start over from scratch. I completely redid my Coda setup a few times (rm -r /vice; /usr/local/sbin/vice-setup) before I got it working sort of like how I wanted it. And even if you were to get it to work now, would you really trust it after hacking around so much? Here are my personal notes for setting up a 3-server replicated Coda cell -- perhaps they will be of use to you. You might want to change some of the parameters. Not guaranteeing this will be perfect for you, but this is a series of steps that at least one person has followed to end up with a working setup. Before you start, make sure you delete the RVM log/data files (or wipe them if you chose seperate partitions), rm -rf /vice to get rid of your old configuration cruft, and clear out any Coda partitions (cd /vicepa ; rm -r * ; cd /vicepb ; rm -r * ....) so we should have a nice clean system, as if Coda were never installed. So, server 1. This'll be our SCM. You'll need to pick the update authorization token, auth2 token, and volutil auth tokens first; these will be shared secrets among your Coda servers. Write em down in a safe place. Run /usr/local/sbin/vice-setup on Server 1 Use these answers to the questions it asks (maybe out of order here) -- Yes, this will be the SCM Give it the auth tokens you chose earlier. Set RVM log at /rvm_log , size 20 MBytes Set RVM data at /rvm_data, size 315 MBytes Set maximum number of files to 2M Tell it to use /vicepa to store data (if you need the directory created, vice-setup will do it automatically) Let vice-setup add the requisite lines to /etc/rc.local s.t. the Coda servers are started at boot. I think it prompts you here for an admin username and UID. I suggest using something neutral like "admin" for the admin username -- avoid using your personal username. I picked 100 as the starting UID; you can do whatever you want.. The admin account should have a default password of "changeme" which you can fix with "cpasswd" once we get a nice client system set up. So this should get you through vice-setup on the SCM. I would just at this point reboot Server 1. When it comes back up fully, make sure that the Coda daemons are running -- codasrv, etc. Now take up Server 2. Make sure its nice and clean, like Server 1 was before we started. Now run vice-setup on that system. I used the same settings as for Server 1, except specify No, this is not the SCM, and set the SCM to the FQDN of Server 1. If you see some nonsense about updateclnt authorization failed or something like that, ignore it (it doesn'tactually seem to matter). Start auth2 and updateclnt on Server 2 (invoke them manually) Now go to Server 1 and make sure that the file /vice/db/servers looks like this (assuming Server 1 has ID 1, and Server 2 has ID 2) server1.mydomain.net 1 server2.mydomain.net 2 also make sure that /vice/db/servers looks like that on Server 2 as well (you'll have to do this manually). Basically, the /vice/db/servers on *each server* - not just the SCM - should contain a list of all servers in the Coda cell and their ID numbers. You would think updateclnt would track this, but it doesn't (though maybe you can make it). Once /vice/db/servers is good on both systems, stop then restart Coda on Server 1 (rc.coda stop ; rc.coda start), then once it comes back up, stop then restart Coda (or just start it up if it wasn't previously running) on Server 2 . For Server 3 -- same thing. Set it up with vice-setup same as before, invoke auth2 and updateclnt on Server 3 like you did for Server 2 when first bringing it up... Then make sure that the /vice/db/servers on all three servers looks like this -- server1.mydomain.net 1 server2.mydomain.net 2 server3.mydomain.net 3 Then do the same procedure to get them in synch -- On Server 1, rc.coda stop ; rc.coda start .... wait until back up On Server 2, rc.coda stop ; rc.coda start .... wait until back up On server 3, rc.coda stop ; rc.coda start (or just rc.coda start if not already running) This should give you a mostly working 3-server Coda cell. We should then do a few things to tie up lose ends -- 1. Edit the /etc/hosts file on each server. Make sure that the three servers are all in each other's hosts file with proper addresses. Its good to put them in hosts, because if you happen to bring up your servers when DNS is unavailable for some reason, Coda will choke if it cannot resolve a "neighbor" server in the same cell. Also, check that the addresses are right. I spent ages trying to debug some bizarro behaviour from Coda only to find that I had made a typo in my hosts file so that one of the Coda servers was resolving an incorrect IP for another. 2. You need to edit /vice/db/vicetab on each server such that it shows *all* partitions on *all* servers. Again, something you think updateclnt would watch, but it doesn't for some reason. That is to say, on Server 1 you have a vicetab that looks like server1.mydomain.net /vicepa ftree width=128,depth=3 and on Server 2, say you have one that looks like server2.mydomain.net /vicepa ftree width=128,depth=3 server2.mydomain.net /vicepb ftree width=128,depth=3 and so forth. You want to manually edit these so that you have one vicetab file on all servers that contains all the information. That is, vicetab should look like server1.mydomain.net /vicepa ftree width=128,depth=3 server2.mydomain.net /vicepa ftree width=128,depth=3 server2.mydomain.net /vicepb ftree width=128,depth=3 ... and so on on Server 1, Server 2, and Server 3. (3) A root mount-point is already made for you. All you need to do in order to get your servers up is to run vice-setup on them and manually edit a few files as I mention above. Don't do anything funky with volutil or createvol_rep trying to make a root volume -- that will fuck your shit up and you will probably have to start fresh!! (I know about all these mistakes because I've made em all) (4) Your servers should be fine. Now, to get the nice presentation, we'll have to do some work on the clients. On the clients, set up Venus using venus-setup. I do it pretty much by the book. A cache of like 50 MByte works fine for me. Once Venus is installed, you want to configure it to recognise your realm so it looks pretty for the users. Edit venus.conf (typically /usr/local/etc/coda/venus.conf). Be sure to specify -- realm="myrealm.net" This specifies the default realm for things like "clog" when invoked with no args. So you can just type "clog" to get tokens instead of "clog myusername_at_myrealm.net" -- very nice! Also make sure that the line, realmtab=/usr/local/etc/coda/realms is not commented out, and points to a valid realms file. Now edit the realms file and configure for your realm -- myrealm.net server1.mydomain.net server2.mydomain.net server3.mydomain.net Traditionally myrealm.net == mydomain.net ; that is, we choose our domain name as our realm name (though you don't have to). This is what allows you to do the nice cd /coda/myrealm.net/blahblahblah and see your 3 seperate servers as one contiguous "realm". That should get you going on the workstation side and server side. Addenda -- To make volumes, log into the SCM, become root, and use the command -- createvol_rep volumename server1.mydomain.net/vicepa server2.mydomain.net/vicepb basically, the syntax is -- createvol_rep [volumename] [replicaserver1/replicapart1] [replicaserver2/replicapart2] ... you can specify as many replicaserver/replicapart as you want though I wouldn't recommend trying to do something funky like putting two copies of the same volume on the same server and partition. Then we mount them up -- log into your client and "clog admin" then attach the mount -- cfs mkm /coda/myrealm.net/directory volumename So for example, I might type something like -- createvol_rep diablonet.tmp server1.diablonet.net/vicepa server2.diablonet.net/vicepb (on the SCM) and cfs mkm /coda/diablonet.net/tmp diablonet.tmp (on some client system while clogged as admin) To make users, do this -- 1. Run "pdbtool" on the SCM (Server1) as root. 2. Type: "nui <username> <userid>" in pdbtool. 3. Run "au" on the SCM (Server1) as root. Type: "au -h server1.mydomain.net nu" 4. When prompted for Your Vice Name, enter your Coda username (e.g. "admin") 5. When prompted for your password, enter the corresponding password to the account in step (4) 6. When prompted for vice user, enter the username of the account you just made. 7. When prompted for vice password, enter them a temporary new password. Use of Coda If you've got a Coda account and a sufficiently configured client, log into the client. Then "clog" Enter your password. Then cd /coda/mydomain.net and go to town! Type "ctokens" to view your credentials. Type "cpasswd" to change your Coda password. That should be all you need to know to use Coda. Here's one for the list archives :) Regards, SeanReceived on 2007-01-11 00:02:40