Updated on 2025-08-11 GMT+08:00

Interconnecting HDFS with OBS Using an IAM Agency

After configuring decoupled storage and compute for a cluster by referring to Interconnecting an MRS Cluster with OBS Using an IAM Agency, you can view and create OBS file directories on the HDFS client.

Interconnecting HDFS with OBS

  1. Log in to the node where the HDFS client is installed as the client installation user.

    For details about how to download and install the cluster client, see Installing an MRS Cluster Client.

  2. Run the following command to switch to the client installation directory.

    cd Client installation directory

  3. Run the following command to configure environment variables:

    source bigdata_env

  4. Authenticate the user of the cluster with Kerberos authentication enabled. Skip this step for the user of the cluster with Kerberos authentication disabled.

    kinit Component service user

  5. Add the target OBS file system in the HDFS CLI.

    For example:

    • Run the following command to access the OBS file system:
      hdfs dfs -ls obs://OBS parallel file system name/path

      For example, run the following command to access the mrs-word001 parallel file system. If the file list is returned, OBS is successfully accessed.

      hadoop fs -ls obs://mrs-word001/
      Figure 1 Returned file list
    • Run the following command to upload the /opt/test.txt file from the client node to the OBS file system path:
      hdfs dfs -put /opt/test.txt obs://OBS parallel file system name/path

      View the uploaded file in the corresponding OBS file system path.

Changing the Log Level of OBS Client

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:

  1. Go to the hadoop directory.
    cd Client installation directory/HDFS/hadoop/etc/hadoop
  2. Edit the file log4j.properties.
    vi  log4j.properties

    Add the following OBS log level configuration to the file and save it.

    log4j.logger.org.apache.hadoop.fs.obs=WARN
    log4j.logger.com.obs=WARN
  3. Run the following command:
    tail -4 log4j.properties
    If the command output shown in Figure 2 is displayed, the log level is successfully changed.
    Figure 2 Viewing the log level