cd Client installation directory
source bigdata_env
kinit User performing HDFS operations
yarn jar Client installation directory/HDFS/hadoop/share/hadoop/mapreduce/hadoop-mapreduce-examples-*.jar pi -Dmapreduce.job.hdfs-servers=NAMESERVICE -fs obs://OBS parallel file system name 1 1
NAMESERVICE indicates the NameService in HDFS. The default value is hdfs://hacluster. If there are multiple NameServices, separate them with ,.
The following command is an example:
yarn jar /opt/hadoopclient/HDFS/hadoop/share/hadoop/mapreduce/hadoop-mapreduce-examples-*.jar pi -Dmapreduce.job.hdfs-servers=hdfs://hacluster -fs obs://bucketname 1 1
yarn jar Client installation directory/HDFS/hadoop/share/hadoop/mapreduce/hadoop-mapreduce-examples-*.jar teragen 100 obs://OBS parallel file system name/hadoop1/teragen1
hadoop distcp obs://OBS parallel file system name/hadoop1/teragen1 /tmp
If a large number of logs are printed in the OBS file system, the read and write performance may be affected. You can adjust the log level of the OBS client as follows:
cd Client installation directory/Yarn/config
vi log4j.properties
Add the OBS log level configuration to the file. (If an application uses the built-in log4j.properties file, add the same configuration.)
log4j.logger.org.apache.hadoop.fs.obs=WARN
log4j.logger.com.obs=WARN
The following figure shows the configurations needed for adding the Read and Write permissions on obs://OBS parallel file system name/hadoop1 to user group obs_hadoop1.