AFS 配置(三)

本文详细记录了Linux服务器的启动、AFS文件系统的配置过程,包括服务器组件的启动、分区创建、文件系统初始化及权限设置,以及解决过程中遇到的问题。最终实现了Linux服务器与Windows客户端的AFS连接。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

接上回。。。

 

今天终于成功的将linux端服务器启动,并且于windows客户端成功连接,实现了AFS的基本存储、备份、帐户管理等基本功能。

期间发现了之前的许多问题。为了保证思路的完整性,这里还是继续沿用之前的叙述。后面再把完整的步骤整理出来。在这里

要感谢中科院高能物理研究所计算中心的许工!!因为有了他的几次指点才让后面的一些问题有了思路。

 

 

重启完服务器之后。

 

启动fs程序,主要包括:fileserve、volserver、salvager服务器。

# bos create <server name> fs fs /usr/afs/bin/fileserver  /usr/afs/bin/volserver /usr/afs/bin/salvager  -cell <cell name> -noauth

用命令看看详细的执行情况:
[root@jncc work]# bos status jncc.edu.cn -long -noauth
Instance kaserver, (type is simple) currently running normally.
Process last started at Thu Mar 4 20:52:34 2010 (2 proc starts)
Last exit at Thu Mar 4 20:52:34 2010
Command 1 is '/usr/afs/bin/kaserver'
Instance buserver, (type is simple) currently running normally.
Process last started at Thu Mar 4 20:52:34 2010 (2 proc starts)
Last exit at Thu Mar 4 20:52:34 2010
Command 1 is '/usr/afs/bin/buserver'

Instance ptserver, (type is simple) currently running normally.
Process last started at Thu Mar 4 20:52:34 2010 (2 proc starts)
Last exit at Thu Mar 4 20:52:34 2010
Command 1 is '/usr/afs/bin/ptserver'
Instance vlserver, (type is simple) currently running normally.
Process last started at Thu Mar 4 20:52:34 2010 (2 proc starts)
Last exit at Thu Mar 4 20:52:34 2010
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 Thu Mar 4 20:53:04 2010 (2 proc starts)
Command 1 is '/usr/afs/bin/fileserver'
Command 2 is '/usr/afs/bin/volserver'
Command 3 is '/usr/afs/bin/salvager'
好像没有什么问题。
到这里服务器应该算是启动了。
下面开始配置文件系统了
先建立根分区,root.afs这是对应目录中/afs目录的分区。
[root@jncc work]# vos create jncc.edu.cn /vicepa root.afs -cell afs.server -noauth
Volume 536870912 created on partition /vicepa of jncc.edu.cn
然后启动更新服务器
[root@jncc work]# bos create jncc.edu.cn upserver simple "/usr/afs/bin/upserver -crypt /usr/afs/etc -clear /usr/afs/bin" -cell afs.server.edu -noauth
设定文件顶层,/afs目录的权限
[root@jncc work]# fs setacl /afs system:anyuser rl
fs:'/afs': Function not implemented
无法完成!(冷汗。。。)

到网上去搜,有人遇到过这个问题,但是解决方法是。。。。没有!!!
算了,先放弃权限,继续。。。。
建立root.cell分区,并且将它挂载到/afs/<cell name>并把读写挂到/afs/.<cell name> [root@jncc work]# vos create jncc.edu.cn /vicepa root.cell
vsu_ClientInit: Could not get afs tokens, running unauthenticated.
Volume 536870915 created on partition /vicepa of jncc.edu.cn
[root@jncc work]# fs mkmount /afs/afs.server.edu root.cell
[root@jncc work]# fs setacl /afs/afs.server.edu system:anyuser rl
fs:'/afs/afs.server.edu': Function not implemented
[root@jncc work]# fs mkmount /afs/.afs.server.edu root.cell -rw
[root@jncc work]#
貌似问题不少,首先是我没有取得权限,然后是fs setacl仍然不能用。
不管,查看一下结果
[root@jncc etc]# vos listvol jncc.edu.cn
vsu_ClientInit: Could not get afs tokens, running unauthenticated.
Total number of volumes on server jncc.edu.cn partition /vicepa: 2
root.afs 536870912 RW 2 K On-line
root.cell 536870915 RW 2 K On-line
居然成功创建了分区。
服务器端难道就可以了吗??
事实是,不行,windows客户端无法连接上。
整个成功或失败的操作,以及系统反馈如下
export PATH:$PATH:/usr/afs/bin
[root@jncc work]# bosserver -noauth &
[1] 3653
[root@jncc work]# bos setcellname jncc.edu.cn afs.server.edu -noauth
[1]+ Done bosserver -noauth
[root@jncc work]# bos create jncc.edu.cn kaserver simple /usr/afs/bin/kaserver -cell afs.server.edu -noauth
[root@jncc work]# bos create jncc.edu.cn buserver simple /usr/afs/bin/buserver -cell afs.server.edu -noauth
[root@jncc work]# bos create jncc.edu.cn ptserver simple /usr/afs/bin/ptserver -cell afs.server.edu -noauth
[root@jncc work]# bos create jncc.edu.cn vlserver simple /usr/afs/bin/vlserver -cell afs.server.edu -noauth
[root@jncc work]# bos status jncc.edu.cn -noauth
Instance kaserver, currently running normally.
Instance buserver, currently running normally.
Instance ptserver, currently running normally.
Instance vlserver, currently running normally.
[root@jncc work]# kas -cell afs.server.edu -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 2450523212, last cpw: Thu Mar 4 20:47:07 2010
password will never expire.
An unlimited number of unsuccessful authentications is permitted.
entry never expires. Max ticket lifetime 100.00 hours.
last mod on Thu Mar 4 20:47:07 2010 by <none>
permit password reuse
ka> setfields admin -flags admin
ka> examine admin
User data for admin (ADMIN)
key (0) cksum is 1361154845, last cpw: Thu Mar 4 20:47:22 2010
password will never expire.
An unlimited number of unsuccessful authentications is permitted.
entry never expires. Max ticket lifetime 25.00 hours.
last mod on Thu Mar 4 20:48:04 2010 by <none>
permit password reuse

ka> quit
[root@jncc work]# bos adduser jncc.edu.cn admin -cell afs.server.edu -noauth
[root@jncc work]# bos addkey jncc.edu.cn -kvno 0 -cell afs.server.edu -noauth
input key:
Retype input key:
[root@jncc work]# pts createuser -name admin -cell afs.server.edu -noauth
User admin has id 1
[root@jncc work]# pts adduser admin system:administrators -cell afs.server.edu -noauth
[root@jncc work]# pts membership admin -cell afs.server.edu -noauth
Groups admin (id: 1) is a member of:
system:administrators
[root@jncc work]# bos restart jncc.edu.cn -all -cell afs.server.edu -noauth
[root@jncc work]# bos create jncc.edu.cn fs fs /usr/afs/bin/fileserver /usr/afs/bin/volserver /usr/afs/bin/salvager -cell afs.server.edu -noauth
[root@jncc work]# bos status jncc.edu.cn -long -noauth
Instance kaserver, (type is simple) currently running normally.
Process last started at Thu Mar 4 20:52:34 2010 (2 proc starts)
Last exit at Thu Mar 4 20:52:34 2010
Command 1 is '/usr/afs/bin/kaserver'
Instance buserver, (type is simple) currently running normally.
Process last started at Thu Mar 4 20:52:34 2010 (2 proc starts)
Last exit at Thu Mar 4 20:52:34 2010
Command 1 is '/usr/afs/bin/buserver'

Instance ptserver, (type is simple) currently running normally.

Process last started at Thu Mar 4 20:52:34 2010 (2 proc starts)

Last exit at Thu Mar 4 20:52:34 2010

Command 1 is '/usr/afs/bin/ptserver'



Instance vlserver, (type is simple) currently running normally.

Process last started at Thu Mar 4 20:52:34 2010 (2 proc starts)

Last exit at Thu Mar 4 20:52:34 2010

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 Thu Mar 4 20:53:04 2010 (2 proc starts)
Command 1 is '/usr/afs/bin/fileserver'
Command 2 is '/usr/afs/bin/volserver'
Command 3 is '/usr/afs/bin/salvager'
[root@jncc work]# vos create jncc.edu.cn /vicepa root.afs -cell afs.server -noauth
Volume 536870912 created on partition /vicepa of jncc.edu.cn
[root@jncc work]# bos create jncc.edu.cn upserver simple "/usr/afs/bin/upserver -crypt /usr/afs/etc -clear /usr/afs/bin" -cell afs.server.edu -noauth
[root@jncc work]# fs setacl /afs system:anyuser rl
fs:'/afs': Function not implemented
[root@jncc work]# vos create jncc.edu.cn /vicepa root.cell
vsu_ClientInit: Could not get afs tokens, running unauthenticated.
Volume 536870915 created on partition /vicepa of jncc.edu.cn
[root@jncc work]# fs mkmount /afs/afs.server.edu root.cell
[root@jncc work]# fs setacl /afs/afs.server.edu system:anyuser rl
fs:'/afs/afs.server.edu': Function not implemented
[root@jncc work]# fs mkmount /afs/.afs.server.edu root.cell -rw
[root@jncc work]#
[root@jncc etc]# vos listvol jncc.edu.cn
vsu_ClientInit: Could not get afs tokens, running unauthenticated.
Total number of volumes on server jncc.edu.cn partition /vicepa: 2
root.afs 536870912 RW 2 K On-line
root.cell 536870915 RW 2 K On-line
Total volumes onLine 2 ; Total volumes offLine 0 ; Total busy 0
到此,有一下几个问题:
1、fs 指令中大部分不能执行[现在已经解决]
2、系统重启后CellServDB内容还原而导致系统无法正常使用[现在已解决]
3、无法获取令牌[现在已经解决]
4、用klog登陆检测客户机,显示错误[现在已经解决]
5、系统启动时,提示没有加载openafs-client 模块[现在已经解决]
下面一篇将把问题如何解决的记录一下。并且整理一下整个系统搭建的思路。













 

 

 

 

 

### AFS 系统概述 AFS(Andrew File System)是一种分布式文件系统,最初由 Carnegie Mellon University 开发并广泛应用于企业环境中的大规模数据共享需求。它通过提供高效的缓存机制和安全性保障,使得用户能够在跨地域的网络环境中访问集中存储的数据资源。 #### 工作原理 AFS 的核心设计理念在于其能够支持高可用性和高性能的数据访问能力。为了实现这一目标,AFS 使用了一种称为 **cell** 的逻辑单元结构来组织服务器群组[^1]。每个 cell 可以独立运行,并与其他 cells 形成联邦关系以便扩展容量和服务范围。此外,AFS 利用了 Kerberos 认证协议确保客户端与服务端之间的安全连接,而无需直接依赖 KDC(Key Distribution Center),这简化了部署流程[^3]。 #### 部署复杂度 尽管 AFS 提供了许多优势,但由于其配置过程较为繁琐以及对管理员技术水平的要求较高,因此即使是有经验的技术人员也需要花费较长时间完成新系统的初始化设置[^2]。这种较高的学习曲线可能是阻碍 AFS 更加普及的原因之一。 #### 应用领域 除了作为传统的企业级文件管理系统外,AFS 还被集成到了其他更复杂的解决方案当中。例如,在 SAP 环境下可以通过特定的功能包启用基于 ESOA 架构的支持[^4];而在汽车行业,则出现了利用 Matlab Simulink 对采用轮毂电机驱动方式的电动车实施主动前轮转向控制的研究案例[^5]。 ```python # 示例 Python 脚本展示如何模拟简单的 AFS 客户端行为 import os def afs_cache(file_name, server_address): cache_dir = "/afs/cache" full_path = f"{cache_dir}/{file_name}" if not os.path.exists(full_path): # 如果本地不存在则从远程获取 download_from_server(server_address, file_name) def download_from_server(server, filename): print(f"Downloading {filename} from {server}") ```
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值