CallerContext

更新时间:
复制 MD 格式

CallerContext records the initiator of each operation on an OSS-HDFS bucket in audit logs. After you enable the feature, audit logs identify which MapReduce jobs, Spark jobs, or Hadoop commands triggered each operation — letting you trace unexpected access, support compliance audits, and attribute storage activity to specific workloads.

Enable CallerContext

This procedure installs JindoSDK on an Elastic Compute Service (ECS) instance and enables CallerContext for a target bucket.

Before you begin, make sure you have:

Steps:

  1. Connect to the ECS instance. See Connect to an instance.

  2. Download the JindoSDK installation package (version 6.2.5).

  3. Configure your AccessKey pair and environment variables.

    1. Go to the bin directory of the installed JindoSDK package. Replace x.x.x with your actual version number.

      cd jindofs-sdk-x.x.x-linux/bin/
    2. Create a configuration file named jindofs.cfg in the bin directory and add your AccessKey pair.

      [client]
      fs.oss.accessKeyId = <key>
      fs.oss.accessKeySecret = <secret>
    3. Set the JINDOSDK_CONF_DIR environment variable to the absolute path of the jindofs.cfg file.

      export JINDOSDK_CONF_DIR=<JINDOSDK_CONF_DIR>
      Note

      <JINDOSDK_CONF_DIR> must be the absolute path to jindofs.cfg.

  4. Enable CallerContext for your bucket. The following example enables CallerContext for a bucket named examplebucket in the China (Shanghai) region. For buckets in other regions, replace the endpoint with the endpoint for that region.

    ./jindofs admin -putConfig -dlsUri oss://examplebucket.cn-shanghai.oss-dls.aliyuncs.com/ -conf namespace.caller.context.enabled=true
  5. Verify that CallerContext is enabled. Run the following command to confirm that namespace.caller.context.enabled is set to true.

    ./jindofs admin -getConfig -dlsUri oss://examplebucket.cn-shanghai.oss-dls.aliyuncs.com/ -name namespace.caller.context.enabled

    After CallerContext is enabled, your OSS-HDFS audit logs include the caller context for each operation, identifying the MapReduce job, Spark job, or Hadoop command that initiated it.