这是我的原创如果转贴请说明来源(
rayter.cublog.cn
) 欢迎大家和我一起交流afs文件系统(
[email protected]
)
由于最近工作的原因 需要配置afs文件系统,发现afs相关的资料好少啊 特此写一篇我自己的配置心得希望对喜欢afs文件系统的人能有所帮助
--- rayter
安装主服务器
在磁盘上建立分区 /vicepa, /vicepb
启动bos服务
# /usr/afs/bin/bosserver -noauth &
确定BOS服务器建立了/usr/vice/etc/CellServDB 以及 /usr/vice/etc/ThisCell 两个文件
执行bos setcellname来创建一个Cell
# bos setcellname -noauth
启动资料库服务程序
#bos create kaserver simple /usr/afs/bin/kaserver -cell -noauth 创建认证服务器,启动kaserver 进程
#bos create buserver simple /usr/afs/bin/buserver -cell -noauth 创建备份服务器,启动buserver 进程
#bos create ptserver simple /usr/afs/bin/ptserver -cell -noauth 创建保护服务器,启动ptserver 进程
#bos create vlserver simple /usr/afs/bin/vlserver -cell -noauth 创建卷定位(VL)服务器,启动vlserver 进程
使用
bos status 這個指令來檢查是不是所有服务器都在執行中:
# /usr/afs/bin/bos status -noauth
Instance kaserver, currently running normally.
Instance buserver, currently running normally.
Instance ptserver, currently running normally.
Instance vlserver, currently running normally.
进入kas模式
# /usr/afs/bin/kas -cell -noauth
ka> create afs
initial_password:
Verifying, please re-enter initial_password:
ka> create admin
initial_password:
Verifying, please re-enter initial_password:
ka> examine afs
User data for afs
key (0) cksum is 2651715259, last cpw: Mon Jun 4 20:49:30 2001
password will never expire.
An unlimited number of unsuccessful authentications is permitted.
entry never expires. Max ticket lifetime 100.00 hours.
last mod on Mon Jun 4 20:49:30 2001 by
permit password reuse
ka> setfields admin -flags admin
ka> examine admin
User data for admin (ADMIN)
key (0) cksum is 2651715259, last cpw: Mon Jun 4 20:49:59 2001
password will never expire.
An unlimited number of unsuccessful authentications is permitted.
entry never expires. Max ticket lifetime 25.00 hours.
last mod on Mon Jun 4 20:51:10 2001 by $lt;none>
permit password reuse
ka>quit
執行 bos adduser 指令來將 admin 使用者加入至 /usr/afs/etc/UserList
# /usr/afs/bin/bos adduser admin -cell -noauth
通过 bos addkey 命令來定義 /usr/afs/etc/KeyFile 中的 AFS 服务器的Key
# /usr/afs/bin/bos addkey -kvno 0 -cell -noauth
input key:
Retype input key:
使用 pts createuser 指令來建立管理員的保護資料庫紀錄
# /usr/afs/bin/pts createuser -name admin -cell -noauth
执行pts adduser命令将admin用户加入system:administrators群組,然後使用 pts membership 來檢查成員
# /usr/afs/bin/pts adduser admin system:administrators -cell -noauth
# /usr/afs/bin/pts membership admin -cell -noauth
Groups admin (id: 1) is a member of:
system:administrators
重新啟動所有 AFS 伺服器程序
# /usr/afs/bin/bos restart -all -cell -noauth
使用 bos create 命令启动文件服务器组件(fs process)
# /usr/afs/bin/bos create fs fs /usr/afs/bin/fileserver /usr/afs/bin/volserver /usr/afs/bin/salvager
-cell afs.server -noauth
確定所有程序都在執行
# /usr/afs/bin/bos status -long -noauth
Instance kaserver, (type is simple) currently running normally.
Process last started at Mon Jun 4 21:07:17 2001 (2 proc starts)
Last exit at Mon Jun 4 21:07:17 2001
Command 1 is '/usr/afs/bin/kaserver'
Instance buserver, (type is simple) currently running normally.
Process last started at Mon Jun 4 21:07:17 2001 (2 proc starts)
Last exit at Mon Jun 4 21:07:17 2001
Command 1 is '/usr/afs/bin/buserver'
Instance ptserver, (type is simple) currently running normally.
Process last started at Mon Jun 4 21:07:17 2001 (2 proc starts)
Last exit at Mon Jun 4 21:07:17 2001
Command 1 is '/usr/afs/bin/ptserver'
Instance vlserver, (type is simple) currently running normally.
Process last started at Mon Jun 4 21:07:17 2001 (2 proc starts)
Last exit at Mon Jun 4 21:07:17 2001
Command 1 is '/usr/afs/bin/vlserver'
Instance fs, (type is fs) currently running normally.
Auxiliary status is: file server running.
Process last started at Mon Jun 4 21:09:30 2001 (2 proc starts)
Command 1 is '/usr/afs/bin/fileserver'
Command 2 is '/usr/afs/bin/volserver'
Command 3 is '/usr/afs/bin/salvager'
啟動更新伺服器的分配
/usr/afs/bin/bos create
upserver simple "/usr/afs/bin/upserver
-crypt /usr/afs/etc -clear /usr/afs/bin"
-cell -noauth
完成!!!
创建一个卷来看看吧
vos create root.cell
安装附加服务器
启动bos服务
# /usr/afs/bin/bosserver -noauth &
启动“更新服务器”客户机
#bos create upclientetc simple \
"/usr/afs/bin/upclient \
/usr/afs/etc" -cell -noauth
启动 fs 进程,该进程连接了文件服务器、卷服务器和挽救器
#bos create fs fs \
/usr/afs/bin/fileserver /usr/afs/bin/volserver \
/usr/afs/bin/salvager -cell -noauth
完成!!!
安装附客户机
安装客户机器非常简单了 需要的布步骤是 创建目录 /afs /usr/vice
#mkdir /afs #mkdir /usr/vice
创建cache目录 /usr/vice/cache
#mkdir /usr/vice/cache
将服务器上生成的两个配置文件 copy到 /usr/vice/etc 下
CellServDB ThisCell 这个文件就是了
创建一个cache的配置文件 cacheinfo同样也放到 /usr/vice/etc 下 内容如下
/afs:/usr/vice/cache:100000
/afs 就是我mount后的根了 /usr/vice/cache 就是客户端缓存的目录了 100000就是缓存的大小了
之后插入模块
insmod libafs-XX.XX.ko
然后mount到服务器上
afsd -dynroot -fakestat
大功告成
需要注意的是 这样mount后 他会寻找 服务器上的 root.cell这个卷 别忘了在服务器上创建这个卷哦