cosn://examplebucket-1250000000/data/warehouse/, the CosN-to-GooseFS path mapping will be as follows:cosn://examplebucket-1250000000/data/warehouse -> /warehouse/cosn://examplebucket-1250000000/data/warehouse/folder/test.txt ->/warehouse/folder/test.txt
/warehouse ->cosn://examplebucket-1250000000/data/warehouse//warehouse/ -> cosn://examplebucket-1250000000/data/warehouse//warehouse/folder/test.txt -> cosn://examplebucket-1250000000/data/warehouse/folder/test.txt
goosefs.user.client.namespace.refresh.interval in the GooseFS configuration file goosefs-site.properties.ml-100k in the root directory of the bucket.ml-100k dataset from Grouplens and upload the u.user file to <Bucket root directory>/ml-100k.goosefs-1.0.0-client.jar in the share/hadoop/common/lib/ directory.cp goosefs-1.0.0-client.jar hadoop/share/hadoop/common/lib/
etc/hadoop/core-site.xml to specify the GooseFS class implementation.<property><name>fs.AbstractFileSystem.gfs.impl</name><value>com.qcloud.cos.goosefs.hadoop.GooseFileSystem</value></property><property><name>fs.gfs.impl</name><value>com.qcloud.cos.goosefs.hadoop.FileSystem</value></property>
gfs:// schema, where <MASTER_IP> is the IP of the master.hadoop fs -ls gfs://<MASTER_IP>:9200/
hive/auxlib/ directory for Hive to load it.cp goosefs-1.0.0-client.jar hive/auxlib/
examplebucket-1250000000 with your actual COS bucket, and SecretId and SecretKey with your actual key information.goosefs ns create ml-100k cosn://examplebucket-1250000000/ml-100k --secret fs.cosn.userinfo.secretId=SecretId --secret fs.cosn.userinfo.secretKey=SecretKey--attribute fs.cosn.bucket.region=ap-guangzhou --attribute fs.cosn.credentials.provider=org.apache.hadoop.fs.auth.SimpleCredentialProvidergoosefs ns ls
instance-id with the actual ID of your CHDFS instance, and 1250000000 with your actual APPID:goosefs ns create ofs-test ofs://instance-id.chdfs.ap-guangzhou.myqcloud.com/ofs-test --attribute fs.ofs.userinfo.appid=1250000000goosefs ns ls
create database goosefs_test;use goosefs_test;CREATE TABLE u_user_gfs (userid INT,age INT,gender CHAR(1),occupation STRING,zipcode STRING)ROW FORMAT DELIMITEDFIELDS TERMINATED BY '|'STORED AS TEXTFILELOCATION 'gfs://<MASTER_IP>:<MASTER_PORT>/ml-100k';select sum(age) from u_user_gfs;
CREATE TABLE u_user_cosn (userid INT,age INT,gender CHAR(1),occupation STRING,zipcode STRING)ROW FORMAT DELIMITEDFIELDS TERMINATED BY '|'STORED AS TEXTFILELOCATION 'cosn://examplebucket-1250000000/ml-100k';select sum(age) from u_user_cosn;
hadoop/etc/hadoop/core-site.xml:<property><name>fs.AbstractFileSystem.cosn.impl</name><value>com.qcloud.cos.goosefs.hadoop.CosN</value></property><property><name>fs.cosn.impl</name><value>com.qcloud.cos.goosefs.hadoop.CosNFileSystem</value></property>
hadoop fs -ls cosn://examplebucket-1250000000/ml-100k/Found 1 items-rw-rw-rw- 0 hadoop hadoop 22628 2021-07-02 15:27 cosn://examplebucket-1250000000/ml-100k/u.userhadoop fs -ls cosn://examplebucket-1250000000/unknow-pathls: Failed to convert ufs path cosn://examplebucket-1250000000/unknow-path to GooseFs path, check if namespace mounted
select sum(age) from u_user_cosn;
CREATE TABLE u_user_ofs (userid INT,age INT,gender CHAR(1),occupation STRING,zipcode STRING)ROW FORMAT DELIMITEDFIELDS TERMINATED BY '|'STORED AS TEXTFILELOCATION 'ofs://instance-id.chdfs.ap-guangzhou.myqcloud.com/ofs-test/';select sum(age) from u_user_ofs;
hadoop/etc/hadoop/core-site.xml:<property><name>fs.AbstractFileSystem.ofs.impl</name><value>com.qcloud.cos.goosefs.hadoop.CHDFSDelegateFS</value></property><property><name>fs.ofs.impl</name><value>com.qcloud.cos.goosefs.hadoop.CHDFSHadoopFileSystem</value></property>
hadoop fs -ls ofs://instance-id.chdfs.ap-guangzhou.myqcloud.com/ofs-test/Found 1 items-rw-r--r-- 0 hadoop hadoop 22628 2021-07-15 15:56 ofs://instance-id.chdfs.ap-guangzhou.myqcloud.com/ofs-test/u.userhadoop fs -ls ofs://instance-id.chdfs.ap-guangzhou.myqcloud.com/unknown-pathls: Failed to convert ufs path ofs://instance-id.chdfs.ap-guangzhou.myqcloud.com/unknown-path to GooseFs path, check if namespace mounted
select sum(age) from u_user_ofs;
Feedback