Interconnecting Hive with OBS

Interconnecting with OBS

MRS clusters allow Hive to connect to OBS through Metastore.

Interconnecting Hive with OBS through Metastore

  1. You have configured storage and compute decoupling by referring to Interconnecting the Guardian Service with OBS.
  2. Log in to FusionInsight Manager and choose Cluster > Services > Hive, and click Configurations.
  3. Search for hive.metastore.warehouse.dir in the search box and change the parameter value to an OBS path, for example, obs://hivetest/user/hive/warehouse/. hivetest indicates the OBS file system name.

    Figure 1 hive.metastore.warehouse.dir configuration

  4. Save the configuration, choose Cluster > Services, and restart the Hive service in the service list.
  5. Update the client configuration file.

    1. Log in to the node where the Hive client is located and run the following command to modify hivemetastore-site.xml in the Hive client configuration file directory:

      vi Client installation directory/Hive/config/hivemetastore-site.xml

    2. Change the value of hive.metastore.warehouse.dir to the corresponding OBS path, for example, obs://hivetest/user/hive/warehouse/.

    3. Change the value of hive.metastore.warehouse.dir of hivemetastore-site.xml in the HCatalog client configuration file directory to the corresponding OBS path, for example, obs://hivetest/user/hive/warehouse/.

      vi Client installation directory/Hive/HCatalog/conf/hivemetastore-site.xml

  6. Go to the Hive Beeline CLI, create a database, and ensure that the location is an OBS path.

    cd Client installation directory

    kinit Component operation user

    beeline

    create database testdb1;

    show create database testdb1;

Configuring Ranger Permissions

  • To authorize a view chart, you need to grant the view chart permission and the physical table path permission corresponding to the view chart.
  • Cascading authorization can be performed only on databases and tables, and cannot be on partitions. If a partition path is not in the table path, you need to manually authorize the partition path.
  • Cascading authorization for Deny Conditions in the Hive Ranger policy is not supported. That is, the Deny Conditions permission only restricts the table permission and cannot generate the permission of the HDFS/OBS storage source.
  • The permission of the HDFS Ranger policy is prior to that of the HDFS/OBS storage source generated by cascading authorization. If the HDFS Ranger permission has been set for the HDFS storage source of the table, the cascading permission does not take effect.
  • alter operations cannot be performed on tables whose storage source is OBS after cascading authorization. To perform the alter operation, you need to grant the Read and Write permissions of the parent directory of the OBS table path to the corresponding user group.