CurveFs 用户权限系统调研
2589230 0 13:47 pts/156 00:00:00 ./bazel-bin/curvefs/src/client/fuse_client -f -o volume=/fs -o user=test -o conf=./curvefs/conf/curvefs_client.conf /tmp/fsmount 问题1:root用户无法访问挂载目录 测试发现client moun fsmount/ wanghai01@pubbeta1-nostest2:/tmp/fsmount$ ls wanghai01@pubbeta1-nostest2:/tmp/fsmount$ # nbs user nbs@pubbeta1-nostest2:/tmp$ ls -l | grep fsmount ls: cannot access 'fsmount': Permission denied d ? fsmount nbs@pubbeta1-nostest2:/tmp$ cd fsmount -bash: cd: fsmount: Permission denied # root user root@pubbeta1-nostest2:/tmp# ls -l | grep fsmount ls: cannot access 'fsmount': Permission denied d0 码力 | 33 页 | 732.13 KB | 5 月前3CurveBS IO Processing Flow
seconds. CurveBS IO processing flow Overall process The flow of user's read and write request to curve: 1. The user initiates a request (fd=1, offset=0, length=4096). 2. The Client queries request and notifies the client that the request is completed. 6. At last, the Client notifies the user that the request is completed.Chunkserver processing flow CopysetNode is essentially a wrapper implements the user state machine of BRaft. Take a write request as an example 1. The Client sends the request to the ChunkServer where the replication group Leader resides 2. When the user request arrives0 码力 | 13 页 | 2.03 MB | 5 月前3Curve核心组件之snapshotclone
datastore metastore http service clone Task user 快照元数据 2.创建内部快照 5.删除内部快照 快照数据 1.发起快照 SnapshotCloneServer 6.删除内部快照数据快照的元数据和数据组织 字段 类型 说明 uuid string 快照唯一Id user string 所属用户 fileName string 快照目标卷名 snapshotName Snap Task etcd MDS client 2.创建克隆卷 3.分配卷空间 7.拷贝数据 datastore metastore http service clone Task user 快照、克隆元数据 SnapshotCloneServer 1.发起克隆 5.8.9.更新元数据克隆卷状态变化 • 初始状态; • 正在安装元数据或拷贝数据中; • 用户不可见。 Cloning:0 码力 | 23 页 | 1.32 MB | 5 月前3Curve文件系统元数据管理
mtime; /* modify time */ uint32_t atime; /* access time */ uint32_t uid; /* user id * uint32_t gid; /* group id */ uint32_t mode; /* file mode */ int nlink; uint64_t volumeSize; // 4KB uint64_t minAllocSize; // std::string volumeName; // user© XXX Page 22 of 24 std::string user; // passworduserroot std::string password; }; // proto enum FSErrorNum { FS_OK0 码力 | 24 页 | 204.67 KB | 5 月前3Curve核心组件之mds – 网易数帆
可以存放各种类型的file。当然由于curve支持 多个pool,可以选择一个logicalPool独享一个pool。 通过结合curve的用户系统,LogicalPool可以通过配置限定特定user使用的方式,实现多个租户数据物理 隔离(待开发)。TOPOLOGY Topology的实际例子,右侧是topo配置文件: 集群有一个物理pool,由3个zone组成,每个zone有1台server。 copyset-4: (cs6, cs9, cs12)COPYSET client MDS leader Chunk server 1、发起请求 2、查询元数据 5、返回结果 5、返回结果 user 3、查询leader节点 4、向leader cs发起请求 1. 用户发起请求(fd, offset, length) ; 2. Client 向 mds 查询请求的元数据, 并缓存到本地,请求转换为对0 码力 | 23 页 | 1.74 MB | 5 月前3Curve设计要点
物理机:server • 故障域:zone • 物理池:poolIO流程 client MDS leader Chunk server 1、发起请求 2、查询元数据 5、返回结果 5、返回结果 user 3、查询leader节点 4、向leader cs发起请求 1. 用户发起请求; 2. Client 向 mds 查询请求的元数据, 并缓存到本地,请求转换为对 chunk 的请求 30 码力 | 35 页 | 2.03 MB | 5 月前3Curve文件系统元数据Proto(接口定义)
volumeSize = 1; required uint64 blockSize = 2; required string volumeName = 3; required string user = 4; optional string password = 5; } message FsInfo { required uint32 fsId = 1;© XXX Page0 码力 | 15 页 | 80.33 KB | 5 月前3Open Flags 调研
O_DIRECTORY : 。 O_NOFOLLOW 如果pathname是一个符号链接,则会打开失败(ELOOP) : 不更新Inode中的last access time(进程uid=文件uid或者进程在它的user namespace有CAP_FOWNER, 而文件的uid在这个namespace中有一个映射)。 O_NOATIME : 在进程执行exec系统调用时关闭此打开的文件描述符,防止父进程泄露打开的文件给子进程。0 码力 | 23 页 | 524.47 KB | 5 月前3
共 8 条
- 1