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:
An ECS instance. See Create an instance.
OSS-HDFS enabled for the target bucket. See Enable OSS-HDFS.
An Alibaba Cloud account or a RAM user with the required permissions:
Alibaba Cloud account: Has permission to connect non-EMR clusters to OSS-HDFS by default.
RAM user: Must be granted the required permissions before use. See Grant a RAM user permissions to connect non-EMR clusters to OSS-HDFS.
Steps:
Connect to the ECS instance. See Connect to an instance.
Download the JindoSDK installation package (version 6.2.5).
Configure your AccessKey pair and environment variables.
Go to the
bindirectory of the installed JindoSDK package. Replacex.x.xwith your actual version number.cd jindofs-sdk-x.x.x-linux/bin/Create a configuration file named
jindofs.cfgin thebindirectory and add your AccessKey pair.[client] fs.oss.accessKeyId = <key> fs.oss.accessKeySecret = <secret>Set the
JINDOSDK_CONF_DIRenvironment variable to the absolute path of thejindofs.cfgfile.export JINDOSDK_CONF_DIR=<JINDOSDK_CONF_DIR>Note<JINDOSDK_CONF_DIR>must be the absolute path tojindofs.cfg.
Enable CallerContext for your bucket. The following example enables CallerContext for a bucket named
examplebucketin 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=trueVerify that CallerContext is enabled. Run the following command to confirm that
namespace.caller.context.enabledis set totrue../jindofs admin -getConfig -dlsUri oss://examplebucket.cn-shanghai.oss-dls.aliyuncs.com/ -name namespace.caller.context.enabledAfter 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.