使用PostgreSQL作为JuiceFS元数据引擎,各表的含义和字段做一个简单归纳
juicefs数据库用于存储juicefs文件信息
postgres=# \l
List of databases
Name | Owner | Encoding | Locale Provider | Collate | Ctype | ICU Locale | ICU Rules | Access privileges
-----------+----------+----------+-----------------+------------+------------+------------+-----------+-----------------------
juicefs | juicefs | UTF8 | libc | en_US.utf8 | en_US.utf8 | | |
可以看到数据库包含了很多张表
juicefs=# \dt
List of relations
Schema | Name | Type | Owner
--------+-------------------+-------+---------
public | jfs_acl | table | juicefs
public | jfs_chunk | table | juicefs
public | jfs_chunk_ref | table | juicefs
public | jfs_counter | table | juicefs
public | jfs_delfile | table | juicefs
public | jfs_delslices | table | juicefs
public | jfs_detached_node | table | juicefs
public | jfs_dir_quota | table | juicefs
public | jfs_dir_stats | table | juicefs
public | jfs_edge | table | juicefs
public | jfs_flock | table | juicefs
public | jfs_node | table | juicefs
public | jfs_plock | table | juicefs
public | jfs_session2 | table | juicefs
public | jfs_setting | table | juicefs
public | jfs_sustained | table | juicefs
public | jfs_symlink | table | juicefs
public | jfs_xattr | table | juicefs
(18 rows)
- jfs_setting 存储文件系统格式化信息
name | value
--------+--------------------------------------------------------------------------------------------------------------
format | { +
| "Name": "juicefs", +
| "UUID": "6b1aaa0a-e3da-43db-ab4e-252a92f722bd", +
| "Storage": "s3", +
| "Bucket": "http://192.168.247.143:9000/bucket1", +
| "AccessKey": "jAzkO6aquJlH8daWJ0vC", +
| "SecretKey": "UclQZeuePQcp9HmMd9Q0EUkL0QIb70ty9kPbbWRcpaYI0JjAUUsE6x8dZ4QxU3hLsK1EbesYB4DfJHeJzPzHUL+ch5A=",+
| "BlockSize": 4096, +
| "Compression": "none", +
| "EncryptAlgo": "aes256gcm-rsa", +
| "KeyEncrypted": true, +
| "TrashDays": 1, +
| "MetaVersion": 1, +
| "MinClientVersion": "1.1.0-A", +
| "DirStats": true, +
| "EnableACL": false +
| }
(1 row)
- jfs_edge 存储文件名、inode号及父目录inode号信息
id | parent | name | inode | type
----+--------+--------------+-------+------
1 | 1 | \x64697231 | 2 | 2
2 | 1 | \x66696c6531 | 3 | 1
3 | 2 | \x66696c6531 | 4 | 1
4 | 2 | \x66696c6532 | 5 | 1
(4 rows)
- jfs_node 存储文件系统的基本元数据
inode | type | flags | mode | uid | gid | atime | mtime | ctime | atimensec | mtimensec | ctimensec | nlink | length | rdev | parent | access_acl_id | default_acl_id
---------------------+------+-------+------+-----+-----+------------------+------------------+------------------+-----------+-----------+-----------+-------+--------+------+--------+---------------+----------------
9223372032828243968 | 2 | 0 | 365 | 0 | 0 | 1720746821874411 | 1720746821874411 | 1720746821874411 | 855 | 855 | 855 | 2 | 4096 | 0 | 1 | 0 | 0
1 | 2 | 0 | 511 | 0 | 0 | 1720746821874411 | 1720751372873926 | 1720751372873926 | 855 | 855 | 855 | 3 | 4096 | 0 | 1 | 0 | 0
3 | 1 | 0 | 420 | 0 | 0 | 1720751372873926 | 1720751372878651 | 1720751372885031 | 42 | 11 | 201 | 1 | 4 | 0 | 1 | 0 | 0
4 | 1 | 0 | 420 | 0 | 0 | 1720751407595564 | 1720751407598082 | 1720751407603477 | 450 | 178 | 346 | 1 | 9 | 0 | 2 | 0 | 0
2 | 2 | 0 | 493 | 0 | 0 | 1720750221908578 | 1720751416940112 | 1720751416940112 | 916 | 916 | 916 | 2 | 4096 | 0 | 1 | 0 | 0
5 | 1 | 0 | 420 | 0 | 0 | 1720751416940112 | 1720751416942616 | 1720751416946878 | 475 | 471 | 682 | 1 | 13 | 0 | 2 | 0 | 0
(6 rows)
- jfs_chunk 存储文件的块信息,slices分段记录着信息
id | inode | indx | slices
----+-------+------+----------------------------------------------------
1 | 3 | 0 | \x000000000000000000000001000000040000000000000004
2 | 4 | 0 | \x000000000000000000000003000000090000000000000009
3 | 5 | 0 | \x0000000000000000000000040000000d000000000000000d
(3 rows)
- jfs_chunk_ref chunkid与size可组成对象名
chunkid | size | refs
---------+------+------
1 | 4 | 1
3 | 9 | 1
4 | 13 | 1
(3 rows)
- jfs_counter 存储文件系统汇总计数信息
name | value
---------------------+------------
nextSession | 5
nextChunk | 4097
usedSpace | 16384
totalInodes | 4
lastCleanupFiles | 1722842479
lastCleanupSessions | 1722842515
nextCleanupSlices | 1722840923
lastCleanupTrash | 1722840440
nextInode | 1026
(9 rows)
- jfs_dir_stats 存储着各目录状态信息
inode | data_length | used_space | used_inodes
-------+-------------+------------+-------------
1 | 4 | 8192 | 2
2 | 22 | 8192 | 2
(2 rows)
- jfs_symlink 存储符号链接的信息
inode | target
-------+--------
(0 rows)
- jfs_xattr 存储扩展属性
id | inode | name | value
----+-------+------------+--------------------------------------------
1 | 1 | lastBackup | \x323032342d30382d30355430363a30383a34335a
(1 row)
- jfs_session2 存储客户端会话信息
sid | expire | info
-----+------------+-------------------------------------------------------------
5 | 1722841562 | \x7b2256657273696f6e223a22312e322e302b323032342d
- jfs_plock 存储文件锁的信息
id | inode | sid | owner | records
----+-------+-----+-------+---------
(0 rows)
- jfs_delfile 存储删除文件信息
inode | length | expire
-------+--------+--------
(0 rows)
- jfs_dir_quota 存储配额信息
inode | max_space | max_inodes | used_space | used_inodes
-------+-----------+------------+------------+-------------
(0 rows)
标签:rows,PostgreSQL,public,引擎,jfs,table,JuiceFS,inode,juicefs
From: https://www.cnblogs.com/itsfei/p/18382182