Quick Use
Verify File System Mounting
Create a Volume
Note
If you have deployed the erasure coding module to create an erasure coding volume, please refer to the Volume Creation section.
cfs-cli
reads config file ~/.cfs-cli.json
. Example cfs-cli.json
:
{
"masterAddr": [
"127.0.0.1:17010",
"127.0.0.2:17010",
"127.0.0.3:17010"
],
"timeout": 60
}
./build/bin/cfs-cli volume create ltptest ltptest
# View volume information
./build/bin/cfs-cli volume info ltptest
Start the Client
- Prepare client config file. Example
client.conf
:
{
"mountPoint": "/home/cfs/client/mnt",
"volName": "ltptest",
"owner": "ltptest",
"masterAddr": "127.0.0.1:17010,127.0.0.2:17010,127.0.0.3:17010",
"logDir": "/cfs/client/log",
"logLevel": "info",
"profPort": "27510"
}
Note that volName
and owner
must match with the volume created by cfs-cli
.
- Start the client
./build/bin/cfs-client -c /home/data/conf/client.conf
- Check if the mount is successful
/home/cfs/client/mnt
is the mount point. If the output of the commanddf -h
is similar to the following, the mount is successful.
df -h
Filesystem Size Used Avail Use% Mounted on
udev 3.9G 0 3.9G 0% /dev
tmpfs 796M 82M 714M 11% /run
/dev/sda1 98G 48G 45G 52% /
tmpfs 3.9G 11M 3.9G 1% /dev/shm
cubefs-ltptest 10G 0 10G 0% /home/cfs/client/mnt
...
Verify the Erasure Coding Subsystem
Note
The erasure coding subsystem (Blobstore) provides a separate interactive command-line management tool. Currently, this tool is not integrated into cfs-cli, and it will be integrated later.
The Blobstore CLI can easily manage the erasure coding subsystem. Use help
to view the help information. Here, we only introduce how to verify the correctness of the erasure coding system itself.
Start the CLI
Based on the default configuration, start the command-line tool cli
. For detailed usage, please refer to CLI Tool User Guide.
- Physical machine environment
$> cd ./cubefs
$>./build/bin/blobstore/blobstore-cli -c blobstore/cli/cli/cli.conf # Start the command line with the default configuration
- Docker environment
$> ./bin/blobstore-cli -c conf/blobstore-cli.conf
Verification
# Upload a file, and a location will be returned after success (-d parameter is the actual content of the file)
$> access put -v -d "test -data-"
# Return result
#"code_mode":11 is the encoding mode specified in the clustermgr configuration file, and 11 is the EC3P3 encoding mode.
{"cluster_id":1,"code_mode":10,"size":11,"blob_size":8388608,"crc":2359314771,"blobs":[{"min_bid":1844899,"vid":158458,"count":1}]}
# Download the file, use the location obtained above as the parameter (-l), and you can download the file content
$> access get -v -l '{"cluster_id":1,"code_mode":10,"size":11,"blob_size":8388608,"crc":2359314771,"blobs":[{"min_bid":1844899,"vid":158458,"count":1}]}'
# Delete the file, use the location obtained above as the parameter (-l); deleting the file requires manual confirmation
$> access del -v -l '{"cluster_id":1,"code_mode":10,"size":11,"blob_size":8388608,"crc":2359314771,"blobs":[{"min_bid":1844899,"vid":158458,"count":1}]}'