Mapping Phoenix Schemas to HBase Namespaces

You can map a Phoenix schema to an HBase namespace to gain multitenancy features in Phoenix.

HBase, the underlying storage engine for Phoenix, has namespaces to support multi-tenancy features. Multitenancy helps an HBase user or administrator to perform access control and quota management tasks. Also, namespaces enable tighter control of where a particular data set is stored on RegionsServers.

Enabling Namespace Mapping

Minimum Required Role: Configurator (also provided by Cluster Administrator, Full Administrator)

You can enable namespace mapping by configuring a set of properties using Cloudera Manager.

If namespace mapping is enabled, then the tables created with the schema will be mapped to the namespace. The old clients will not work after this property is enabled. Test or carefully plan the Phoenix to HBase namespace mappings before implementing them.

To enable Phoenix schema mapping to a non-default HBase namespace:

  1. Go to the HBase service.
  2. Click the Configuration tab.
  3. Select Scope > (Service-Wide).
  4. Locate the HBase Service Advanced Configuration Snippet (Safety Valve) for hbase-site.xml property or search for it by typing its name in the Search box.
  5. Add the following property values:

    Name: phoenix.schema.isNamespaceMappingEnabled

    Description: Enables mapping of tables of a Phoenix schema to a non-default HBase namespace. To enable mapping of a schema to a non-default namespace, set the value of this property to true. The default setting for this property is false.

    Value: true

    Name: phoenix.schema.mapSystemTablesToNamespace

    Description: With true setting (default): After namespace mapping is enabled with the other property, all system tables, if any, are migrated to a namespace called system.With false setting: System tables are associated with the default namespace.

    Value: true.

  6. Select Scope > Gateway.
  7. Locate the HBase Client Advanced Configuration Snippet (Safety Valve) for hbase-site.xml property or search for it by typing its name in the Search box.
  8. Add the following property values:

    Name: phoenix.schema.isNamespaceMappingEnabled

    Description: Enables mapping of tables of a Phoenix schema to a non-default HBase namespace. To enable mapping of the schema to a non-default namespace, set the value of this property to true. The default setting for this property is false.

    Value: true

    Name: phoenix.schema.mapSystemTablesToNamespace

    Description: With true setting (default): After namespace mapping is enabled with the other property, all system tables, if any, are migrated to a namespace called system.With false setting: System tables are associated with the default namespace.

    Value: true.

  9. Enter a Reason for change, and then click Save Changes to commit the changes.
  10. Restart the role.
  11. Restart the service.