Updated on 2024-12-13 GMT+08:00

Configuring Fine-Grained Locks of HDFS

Scenario

In FusionInsight Manager historical versions, HDFS uses a global lock for read-write and write-write operations. However, not all read-write and write-write operations cause resource competition. Therefore, the fine-grained lock feature (FGL) is introduced in this version. FGL splits the global lock based on directories and operation types and only operations that compete for resources use the same lock, which greatly improves the read and write performance.

For example, if client 1 and client 2 write data to irrelevant directories A and B at the same time, they do not compete for resources and do not hold the same lock.

This function is available in MRS 3.5.0 and later versions.

Procedure

  1. Log in to Manager as an MRS cluster administrator, for example, admin.
  2. Choose Cluster > Services > HDFS and click the Configurations tab and then All Configurations.
  3. Search for and modify the dfs.namenode.fgl.enable parameter. For more information, see the following table.

    Parameter

    Description

    Remarks

    dfs.namenode.fgl.enable

    Specifies whether to enable the fine-grained lock. This parameter can improve the HDFS read and write performance once it is enabled.

    Default value: false

  4. Save the configuration.
  5. On the Instance page of HDFS, select the active and standby NameNode instances, choose More > Instance Rolling Restart, and wait until the rolling restart is complete.