How to connect to Hive metastore using external catalog

I am trying to connect to hive tables from StraRocks using external catalog.

StartRocks version
version info
Version: 3.1.5
Git: 5d8438a
Build Info: StarRocks@localhost
Build Time: 2023-11-24 03:58:58

Note: our hadoop infrastructure using kerberos authentication and we are using a service ID to connect to the database/tables in Hive.
We are successfully generated kerberos ticket on bottn fe and be nodes.

Steps performed: Ran below queries from MySQL client after connecting the DB using admin ID

CREATE EXTERNAL CATALOG OPRHQA PROPERTIES
( “type”=“hive”,
“hive.metastore.uris”=“thrift://XXXX:9083,thrift://$$$$$$:9083” );

post this i am unable to create any database under this catalog (OPRHQA).

But able create databases on “default_catalog”. So tried using “default_catalog” instead of “OPRHQA”.
executed below command before creating the external tables.

SET CATALOG default_catalog;

USE default_catalog.starrocks_test;

After this we trued to create external tables by executing below query, but it fails.

CREATE EXTERNAL TABLE hive_external_table (
ctry_cd int,
ctry_nm string,
sregn_cd string,
sregn_nm string,
regn_cd string,
regn_nm string,
ctry_cd_alpha_cd string,
zone_cd int,
actv_ind string,
insrt_ts string,
upd_ts string
)
ENGINE=HIVE
PROPERTIES (
“resource” = “hive”,
“database” = “opcode”,
“table” = “tedc_ctry”,
“hive.metastore.uris” = “thrift://XXXXXX:10000”
);

Error:-

[Code: 1064, SQL State: 42000] Unexpected exception: HIVE resource [hive] not exists

Could you please guide me what i am doing wrong ?

Thanks !
Vineeth

Hive catalog | StarRocks You can refer this link. The catalog framework is default now.

Thank you for the reply Allen. I tried what you suggested but getting below message

“Can not find hive <db_name>.<table_name> from the resource hive0”
am I missing some configuration ?

Thanks !
Vineeth

Did few changes in configuration like changing the port number for metastore uri. Now i am seeing the below error

2024-04-10 11:53:08,883 ERROR (starrocks-mysql-nio-pool-0|150) [HiveMetadata.getTable():115] Failed to get hive table [resource_mapping_inside_catalog_hive_hive_zk.opcode.tedc_ctry]
com.starrocks.connector.exception.StarRocksConnectorException: Failed to get table [opcode.tedc_ctry], msg: Could not read password file: /etc/security/cert/ldaptruststorepwd.txt

I am trying to connect to a Kerberos enabled Hive cluster

There is not file in my system like “/etc/security/cert/ldaptruststorepwd.txt”

Am i missing some configuration ??

Below are the entries in the fe.conf file
JAVA_OPTS = “-Djava.security.krb5.conf:/etc/krb5.conf -Dlog4j2.formatMsgNoLookups=true -Xmx8192m -XX:+UseMembar -XX:SurvivorRatio=8 -XX:MaxTenuringThreshold=7 -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSClassUnloadingEnabled -XX:-CMSParallelRemarkEnabled -XX:CMSInitiatingOccupancyFraction=80 -XX:SoftRefLRUPolicyMSPerMB=0 -Xloggc:${LOG_DIR}/fe.gc.log.$DATE -XX:+PrintConcurrentLocks”

JAVA_OPTS=“-Djava.security.krb5.conf=/etc/krb5.conf -Djavax.security.auth.useSubjectCredsOnly=false -Djava.security.auth.login.config=/usr/mware/mstr/StarRocks-3.1.5/fe/conf/jaas.conf $JAVA_OPTS”

#JAVA_OPTS = “-Djava.security.krb5.conf=/etc/krb5.conf”
hive_meta_store_uris = “thrift://XXXXX:10000,thrift://XXXXX:10000,thrift://XXXX:9083,thrift:/.XXXX:9083,thrift://XXXXX:9083,thrift://XXXXX:9083,thrift://XXXX:9083”

Please advise.

Thanks !
Vineeth