HADOOP_CONF_DIR
.CREATE CATALOG hive PROPERTIES ('type'='hms','hive.metastore.uris' = 'thrift://172.21.0.1:7004','hadoop.username' = 'hive','dfs.nameservices'='your-nameservice','dfs.ha.namenodes.your-nameservice'='nn1,nn2','dfs.namenode.rpc-address.your-nameservice.nn1'='172.21.0.2:4007','dfs.namenode.rpc-address.your-nameservice.nn2'='172.21.0.3:4007','dfs.client.failover.proxy.provider.your-nameservice'='org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider');
type
and hive.metastore.uris
, more parameters can be used to send the information required for the connection.CREATE CATALOG hive PROPERTIES ('type'='hms','hive.metastore.uris' = 'thrift://172.21.0.1:7004','hadoop.username' = 'hive','dfs.nameservices'='your-nameservice','dfs.ha.namenodes.your-nameservice'='nn1,nn2','dfs.namenode.rpc-address.your-nameservice.nn1'='172.21.0.2:4007','dfs.namenode.rpc-address.your-nameservice.nn2'='172.21.0.3:4007','dfs.client.failover.proxy.provider.your-nameservice'='org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider');
CREATE CATALOG hive PROPERTIES ('type'='hms','hive.metastore.uris' = 'thrift://172.21.0.1:7004','hive.metastore.sasl.enabled' = 'true','hive.metastore.kerberos.principal' = 'your-hms-principal','dfs.nameservices'='your-nameservice','dfs.namenode.rpc-address.your-nameservice.nn1'='172.21.0.2:4007','dfs.namenode.rpc-address.your-nameservice.nn2'='172.21.0.3:4007','dfs.client.failover.proxy.provider.your-nameservice'='org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider','hadoop.security.authentication' = 'kerberos','hadoop.kerberos.keytab' = '/your-keytab-filepath/your.keytab','hadoop.kerberos.principal' = 'your-principal@YOUR.COM','yarn.resourcemanager.principal' = 'your-rm-principal');
krb5.conf
and keytab
authentication files in all BE
and FE
nodes. Keep the path of the keytab
authentication file consistent with the configuration. The krb5.conf
file is placed in the path /etc/krb5.conf
by default.
The value ofhive.metastore.kerberos.principal
must be consistent with the same property name in the connected hive metastore, which can be obtained from hive-site.xml
.CREATE CATALOG hive PROPERTIES ('type'='hms','hive.metastore.uris' = 'thrift://172.21.0.1:7004','dfs.encryption.key.provider.uri' = 'kms://http@kms_host:kms_port/kms');
CREATE CATALOG hive PROPERTIES ('type'='hms','hive.metastore.uris' = 'thrift://172.21.0.1:7004','hadoop.username' = 'root','fs.jfs.impl' = 'io.juicefs.JuiceFileSystem','fs.AbstractFileSystem.jfs.impl' = 'io.juicefs.JuiceFS','juicefs.meta' = 'xxx');
# 1. Creating ResourceCREATE RESOURCE hms_resource PROPERTIES ('type'='hms','hive.metastore.uris' = 'thrift://172.21.0.1:7004','hadoop.username' = 'hive','dfs.nameservices'='your-nameservice','dfs.ha.namenodes.your-nameservice'='nn1,nn2','dfs.namenode.rpc-address.your-nameservice.nn1'='172.21.0.2:4007','dfs.namenode.rpc-address.your-nameservice.nn2'='172.21.0.3:4007','dfs.client.failover.proxy.provider.your-nameservice'='org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider');# 2. Create Catalog and use the Resource, where the Key Value information will override the information in the Resource.CREATE CATALOG hive WITH RESOURCE hms_resource PROPERTIES('key' = 'value');
file.meta.cache.ttl-second
to set the automatic expiration time of the File Cache, or you can set this value to 0 to disable the File Cache. The unit of time is seconds. Here is an example:CREATE CATALOG hive PROPERTIES ('type'='hms','hive.metastore.uris' = 'thrift://172.21.0.1:7004','hadoop.username' = 'hive','dfs.nameservices'='your-nameservice','dfs.ha.namenodes.your-nameservice'='nn1,nn2','dfs.namenode.rpc-address.your-nameservice.nn1'='172.21.0.2:4007','dfs.namenode.rpc-address.your-nameservice.nn2'='172.21.0.3:4007','dfs.client.failover.proxy.provider.your-nameservice'='org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider','file.meta.cache.ttl-second' = '60');
CREATE CATALOG hive PROPERTIES ('type'='hms','hive.metastore.uris' = 'thrift://172.21.0.1:7004','hive.version' = '1.1.0');
HMS Type | Doris Type | Comment |
boolean | boolean | - |
tinyint | tinyint | - |
smallint | smallint | - |
int | int | - |
bigint | bigint | - |
date | date | - |
timestamp | datetime | - |
float | float | - |
double | double | - |
char | char | - |
varchar | varchar | - |
decimal | decimal | - |
array<type> | array<type> | Support nested arrays, as in array<array<int>> |
map<KeyType, ValueType> | map<KeyType, ValueType> | Nested structure is not supported; KeyType and ValueType must be basic types. |
struct<col1: Type1, col2: Type2, ...> | struct<col1: Type1, col2: Type2, ...> | Nested structure is not supported, Type1, Type2,... need to be basic types |
other | unsupported | - |
"access_controller.properties.ranger.service.name" = "hive","access_controller.class" = "org.apache.doris.catalog.authorizer.RangerHiveAccessControllerFactory",
<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="configuration.xsl"?><configuration>#The directory for caching permission data, needs to be writable<property><name>ranger.plugin.hive.policy.cache.dir</name><value>/mnt/datadisk0/zhangdong/rangerdata</value></property>#The time interval for periodically pulling permission data<property><name>ranger.plugin.hive.policy.pollIntervalMs</name><value>30000</value></property><property><name>ranger.plugin.hive.policy.rest.client.connection.timeoutMs</name><value>60000</value></property><property><name>ranger.plugin.hive.policy.rest.client.read.timeoutMs</name><value>60000</value></property><property><name>ranger.plugin.hive.policy.rest.ssl.config.file</name><value></value></property><property><name>ranger.plugin.hive.policy.rest.url</name><value>http://172.21.0.32:6080</value></property><property><name>ranger.plugin.hive.policy.source.impl</name><value>org.apache.ranger.admin.client.RangerAdminRESTClient</value></property><property><name>ranger.plugin.hive.service.name</name><value>hive</value></property><property><name>xasecure.hive.update.xapolicies.on.grant.revoke</name><value>true</value></property></configuration>
Was this page helpful?