Coda ist entwickelt worden um auch über sehr schmale Internetanbindungen auf einem entfernten Laufwerk arbeiten zu können. Erreicht wird das dadurch, dass hier von allen benötigten Dateien (an die man arbeitet) eine lokale Kopie vorgehalten wird und sobald eine Verbindung zum Server besteht, werden sie synchronisiert.
Dieses Dateisystem eignet sich auch dafür, eine Dateisystemsynchronisation über eine Internetanbindung zwischen verschiedenen Rechnern zu realisieren. Man muss dazu in der Konfiguration nur angeben, dass von allen Daten eine lokale Kopie vorgehalten werden soll.
In diesem Beispiel heißt der Coda-Server "codaserver" und der Coda-Client "codaclient".
# ssh root@codaserver.domain.de
# echo "deb http://www.coda.cs.cmu.edu/debian stable/" >> /etc/apt/sources.list # aptitude update && aptitude -y install coda-server
# /usr/sbin/vice-setup 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] What is the root directory for your coda server(s)? [/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 : qwertzuiop The following token must be identical on all servers. Enter a random token for auth2 authentication : asdfghjkl The following token must be identical on all servers. Enter a random token for volutil authentication : yxcvbnm,. tokens done! Setting up the file list for update client Filelist for update ready. Now installing files specific to the SCM... Setting up servers file. Enter an id for the SCM server. (hostname codaserver.domain.de) The serverid is a unique number between 0 and 255. You should avoid 0, 127, and 255. serverid: 1 done! Setting up users and groups for Coda You need to give me a uid (not 0 or 1) and username (not root) for a Coda System:Administrator member on this server, (sort of a Coda super user) I will create the initial administrative user with Coda password "changeme". This user/password is only for authenticating with Coda and not for logging into your system (i.e. we don't use /etc/passwd authentication for Coda) Enter the uid of this user: 10000 Enter the username of this user: realmadmin A server needs a small log file or disk partition, preferrably on a disk by itself. It also needs a metadata file or partition of approx 4% of your filespace. Raw partitions have advantages because we can write to the disk faster, but we have to load a copy of the complete RVM data partition into memory. With files we can use a private mmap, which reduces memory pressure and speeds up server startup by several orders of magnitude. Servers with a smaller dataset but heavy write activity will probably benefit from partitions. Mostly read-only servers with a large dataset will definitely benefit from an RVM data file. Nobody has really measured where the breakeven point is, so I cannot really give any hard numbers. ------------------------------------------------------- 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 will be your log file (or partition)? /vice/log The log size must be smaller than the available space in the log partition. A smaller log will be quicker to commit, but the log needs to be large enough to handle the largest transaction. A larger log also allows for better optimizations. We recommend to keep the log under 30M log size, many people have successfully used as little as 2M, and 20M has worked well with our servers. What is your log size? (enter as e.g. '20M') 20M Where is your data file (or partition)? /vice/metadata The log size must be smaller than the available space in the log partition. A smaller log will be quicker to commit, but the log needs to be large enough to handle the largest transaction. A larger log also allows for better optimizations. We recommend to keep the log under 30M log size, many people have successfully used as little as 2M, and 20M has worked well with our servers. What is your log size? (enter as e.g. '20M') 20M Where is your data file (or partition)? /vice/data The amount of RVM we need to store the metadata for a given amount file space can vary enormously. If your typical data set consists of many small files, you definitely need more RVM, but if you tend to store large files (mp3s, videos or image data) we don't need all that much RVM. Here are some random samples, mp3 files ~0.08MB RVM per GB. jpeg images ~0.50MB RVM per GB. email folders ~37.8MB RVM per GB (maildir, 1 file per message) netbsd-pkgsrc ~180MB RVM per GB (large tree but not much data) To get a more precize number for your dataset there is a small tool (rvmsizer) which can reasonably predict the amount of RVM data we need for a file tree. Remember that RVM data will have to be mmapped or loaded into memory, so if anything fails with an error like RVM_EINTERNAL you might have to add more swap space. What is the size of you data file (or partition) [32M, 64M, 128M, 256M, 512M, 768M, 1G]: 1G !!!!!!!!!!!!!! Your size is an experimental size. Be warned! You may want to run with private mapping for RVM. -------------------------------------------------------- WARNING: DATA and LOG partitions are about to be wiped. -------------------------------------------------------- --- log area: /vice/metadata, size 20M. --- data area: /vice/data, size 1024 MB. 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. done. rds_zap_heap completed successfully. rvm_terminate succeeded. RVM setup is done! Directories on the server will be used to store container files that hold the actual data of files stored in Coda. Directory contents as well as metadata will be stored in the RVM segment that we already configured earlier. You should only have one container file hierarchy for each disk partition, otherwise the server will generate incorrect estimates about the actual amount of exportable disk space. Where shall we store your file data [/vicepa]? /home/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 /home/vicepa is set up! Congratulations: your configuration is ready... Shall I try to get things started? (y/n) y - Coda authentication server (auth2 &) - Coda update server (updatesrv) - Coda update client (updateclnt -h codaserver.domain.de) Creating /vice/spool - Coda file server (startserver) Nice, it looks like everything went ok Now I'll try to create an initial root volume - createvol_rep / codaserver.domain.de/home/vicepa Replicated volumeid is 7f000000 creating volume /.0 on codaserver.domain.de (partition /home/vicepa) V_BindToServer: binding to host codaserver.domain.de V_BindToServer: binding to host codaserver.domain.de Set Log parameters Fetching volume lists from servers: V_BindToServer: binding to host codaserver.domain.de GetVolumeList finished successfully codaserver.domain.de - success V_BindToServer: binding to host codaserver VLDB completed. <echo / 7f000000 1 01000001 0 0 0 0 0 0 0 >> /vice/db/VRList.new> V_BindToServer: binding to host codaserver VRDB completed. Do you wish this volume to be Backed Up (y/n)? [n] y Day to take full dumps: [Mon] echoing IFIIIII / >>/vice/db/dumplist That seems to have worked... If you have a working Coda client you should now be able to access the new Coda realm - cfs lv /coda/server.domain.de/ enjoy Coda. for more information see http://www.coda.cs.cmu.edu.
# createvol_rep /vicepb/ codaserver.domain.de
Replicated volumeid is 7f000001
creating volume /vicepb/.0 on codaserver.domain.de (partition /vicepb)
V_BindToServer: binding to host codaserver.domain.de
V_BindToServer: binding to host codaserver.domain.de
Set Log parameters
Fetching volume lists from servers:
V_BindToServer: binding to host codaserver.domain.de
GetVolumeList finished successfully
codaserver.domain.de - success
V_BindToServer: binding to host codaserver
VLDB completed.
<echo /vicepb/ 7f000001 1 01000001 0 0 0 0 0 0 0 >> /vice/db/VRList.new>
V_BindToServer: binding to host codaserver
VRDB completed.
Do you wish this volume to be Backed Up (y/n)? [n] y
Day to take full dumps: [Mon]
echoing IFIIIII /vicepb/ >>/vice/db/dumplist
# volutil purge 7f000000 /
# echo list | pdbtool # echo "n fritz" | pdbtool # echo list | pdbtool # cpasswd -h 192.168.3.72 fritz
# cp /etc/coda/server.conf.ex /etc/coda/server.conf
# vi /etc/coda/server.conf
vicedir=/vice
# mkdir /vice/srv
# /etc/init.d/auth2.init start # /etc/init.d/codasrv.init start
# ssh root@codaclient.domain.de
# echo "deb http://www.coda.cs.cmu.edu/debian stable/" >> /etc/apt/sources.list # aptitude update && aptitude -y install coda-client # modprobe coda # echo coda >> /etc/modules
# mkdir -p /usr/coda/venus.cache/ /coda /usr/coda/etc
Unter "/usr/coda" werden die daten gecached, also muss dort genug Platz auf der Partition sein.
# vi /etc/coda/venus.conf
#cacheblocks="100000" # entspricht ca. 390 MB
cacheblocks="1000000" # entspricht ca. 3,9 GB
# touch /usr/coda/venus.cache/INIT
# /etc/init.d/coda-client restart .... 17:15:57 Coda Venus, version 6.9.4 17:15:57 /usr/coda/LOG size is 26766093 bytes 17:15:58 /usr/coda/DATA size is 107064372 bytes 17:15:58 Initializing RVM data... ....
# df -h coda 3,9G 0 3,6G 0% /coda
# venus-setup
fritz@codaserver.domain.de
100000
Starting Coda client components: kernel
Failed to get a valid pid from /usr/coda/venus.cache/pid
venus
Date: Mon 01/11/2010
10:34:47 Coda Venus, version 6.9.4
10:34:47 LogInit failed
.
# venus -init -d 10
# /etc/init.d/coda-client stop
# /etc/init.d/coda-client start
Starting Coda client components: kernel venus
Date: Mon 01/11/2010
11:02:18 Coda Venus, version 6.9.4
11:02:18 /usr/coda/LOG size is 3038720 bytes
11:02:18 /usr/coda/DATA size is 12144688 bytes
11:02:18 Loading RVM data
11:02:18 Last init was Mon Jan 11 11:00:15 2010
11:02:18 Last shutdown was clean
11:02:18 Starting RealmDB scan
11:02:18 Found 1 realms
11:02:18 starting VDB scan
11:02:18 2 volume replicas
11:02:18 0 replicated volumes
11:02:18 0 CML entries allocated
11:02:18 0 CML entries on free-list
11:02:18 starting FSDB scan (4166, 100000) (25, 75, 4)
11:02:18 1 cache files in table (0 blocks)
11:02:18 4165 cache files on free-list
11:02:18 starting HDB scan
11:02:18 0 hdb entries in table
11:02:18 0 hdb entries on free-list
11:02:18 Kernel version ioctl failed.
11:02:18 Mounting root volume...
11:02:18 Venus starting...
11:02:18 /coda now mounted.
.
# vi /etc/krb5.conf
[libdefaults]
default_realm = codaserver.domain.de
[realms]
codaserver.domain.de = {
kdc = 192.168.3.72
admin_server = 192.168.3.72
}
[domain_realm]
.codaserver.domain.de = codaserver.domain.de
codaserver.domain.de = codaserver.domain.de
# vi /etc/coda/venus.conf
realm="fritz@codaserver.domain.de"
cacheblocks="100000"
# /etc/init.d/coda-client stop # /etc/init.d/coda-client start
# clog realmadmin@codaserver.domain.de # cfs sa /coda/codaserver.domain.de fritz all # cfs listacl /coda/codaserver.domain.de # clog fritz@codaserver.domain.de # ctokens fritz@codaserver.domain.de # cfs lv /coda/codaserver.domain.de # ls -la /coda/codaserver.domain.de/
# echo "Test 01" > /coda/codaserver.domain.de/Test.txt -bash: /coda/codaserver.domain.de/Test.txt: Permission denied
# clog realmadmin@codaserver.domain.de username: realmadmin@codaserver.domain.de Password:
# ctokens
Tokens held by the Cache Manager for root:
@codaserver.domain.de
Coda user id: 10000
Expiration time: Sat Jan 16 16:47:56 2010
# echo "Test 01" > /coda/codaserver.domain.de/Test.txt
# cat /coda/codaserver.domain.de/Test.txt Test 01
# cpasswd realmadmin@codaserver.domain.de Changing password for realmadmin@codaserver.domain.de Old password: New password: Retype new password: Password changed
# cfs sa /coda/codaserver.domain.de fritz all /coda/codaserver.domain.de: Permission denied
# cfs la /coda/codaserver.domain.de
System:AnyUser rl
System:Administrators rlidwka
# clog realmadmin@codaserver.domain.de username: realmadmin@codaserver.domain.de Password:
# cfs sa /coda/codaserver.domain.de fritz all
# cfs la /coda/codaserver.domain.de
System:AnyUser rl
System:Administrators rlidwka
fritz rlidwka
# clog fritz@codaserver.domain.de username: fritz@codaserver.domain.de Password:
# cfs lv /coda/codaserver.domain.de Status of volume 7f000000 (2130706432) named "/" Volume type is ReadWrite Connection State is Reachable Reintegration age: 0 sec, time 15.000 sec Minimum quota is 0, maximum quota is unlimited Current blocks used are 2 The partition has 2400412 blocks available out of 7784424
# ls -l /coda/codaserver.domain.de/ total 0
hiermit wird dem Coda-Client gesagt, das er den gesamten Serverinhalt mit höchster Priorität auch lokal vorhalten soll sonst würden die Daten nur bei Zugriff auch lokal gespeichert werden. Durch das "walk"-Kommando wird die Replikation gestartet. Der lokale Cache muss groß genug sein, sonst führt es zur Meldung "permission denied".
# hoard add /coda/codaserver.domain.de 1000:d+ # hoard walk
# cfs purgeml /coda/codaserver.domain.de/
DANGER: will destroy all changes made while disconnected
Do you really want to do this? [n] y
Fools rush in where angels fear to tread ........
# /etc/init.d/coda-client stop
# createvol_rep / codaserver.domain.de/vicepa
Volume / already exists in /vice/db/VRList
# volutil create_rep /home/coda/ daten 1000
# cunlog fritz@codaserver.domain.de # vutil --shutdown # umount /coda
# ssh root@codaserver.domain.de
# wget -c http://www.coda.cs.cmu.edu/pub/coda/src/coda-6.9.4.tar.gz # tar -xzf coda-6.9.4.tar.gz
# wget -c http://www.coda.cs.cmu.edu/pub/coda/src/lwp-2.5.tar.gz # wget -c http://www.coda.cs.cmu.edu/pub/coda/src/rpc2-2.8.tar.gz # wget -c http://www.coda.cs.cmu.edu/pub/coda/src/rvm-1.16.tar.gz # tar -xzf lwp-2.5.tar.gz ; mv lwp-2.5 coda-6.9.4/lib-src/lwp # tar -xzf rpc2-2.8.tar.gz ; mv rpc2-2.8 coda-6.9.4/lib-src/rpc2 # tar -xzf rvm-1.16.tar.gz ; mv rvm-1.16 coda-6.9.4/lib-src/rvm
# aptitude install liblwp-dev librpc2-dev librvm-dev
# aptitude install flex bison pkg-config libreadline-dev g++
# cd coda-6.9.4/ # ./configure --prefix=/opt/coda # make