[ 
https://issues.apache.org/jira/browse/HIVE-29078?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18004005#comment-18004005
 ] 

Butao Zhang commented on HIVE-29078:
------------------------------------

Give some step to start standalone HMS:

* Set env
{code:java}
#set HADOOP_HOME env
export HADOOP_HOME=/data01/data/hadoop

#create hms log directory
mkdir /data01/data/apache-hive-metastore-4.1.0-bin/log

#set log propertity
export HADOOP_CLIENT_OPTS="$HADOOP_CLIENT_OPTS 
-Xlog:gc:/data01/data/apache-hive-metastore-4.1.0-bin/log/hivemetastore-gc-%t.log
 
-XX:HeapDumpPath=/data01/data/apache-hive-metastore-4.1.0-bin/log/hms_heapdump.hprof
 -Dmetastore.log.dir=/data01/data/apache-hive-metastore-4.1.0-bin/log 
-Dhive.log.file=hivemetastore.log"
{code}


* put mysql-jdbc.jar into HMS lib directory

* create metastore-site.xml with the following content:

{code:java}
  <configuration>
  <property>
    <name>javax.jdo.option.ConnectionPassword</name>
    <value>pwssd</value>
  </property>
  <property>
    <name>javax.jdo.option.ConnectionURL</name>
    <value>jdbc:mysql://127.0.01:3306/hive?createDatabaseIfNotExist=true</value>
  </property>
  <property>
    <name>javax.jdo.option.ConnectionDriverName</name>
    <value>com.mysql.jdbc.Driver</value>
    <description>Driver class name for a JDBC metastore</description>
  </property>
  <property>
    <name>javax.jdo.option.ConnectionUserName</name>
    <value>hive</value>
  </property>
</configuration>
{code}


* start standalone HMS

{code:java}
/data01/data/apache-hive-metastore-4.1.0-bin/bin/start-metastore
{code}

And then check the metastore.log from directory 
/data01/data/apache-hive-metastore-4.1.0-bin/log


> RuntimeException: null when starting standalone HMS
> ---------------------------------------------------
>
>                 Key: HIVE-29078
>                 URL: https://issues.apache.org/jira/browse/HIVE-29078
>             Project: Hive
>          Issue Type: Test
>          Components: Standalone Metastore
>    Affects Versions: 4.1.0
>            Reporter: Butao Zhang
>            Priority: Minor
>
> Build standalone HMS tar againt branch-4.1 
> (https://github.com/apache/hive/tree/branch-4.1)
> {code:java}
> cd hive/standalone-metastore
> mvn clean install -DskipTests -Pdocker -Pdist
> {code}
> Get the binary tar 
> {color:#DE350B}standalone-metastore/packaging/target/hive-standalone-metastore-4.1.0-bin.tar.gz{color}
> Tried to start HMS, startup was successful, but found an error. Not sure this 
> error has any other bad effect.
> {code:java}
> 2025-07-09T15:13:05,134 ERROR [Metastore threads starter thread] 
> leader.LeaseLeaderElection: Error notifying the listener: 
> org.apache.hadoop.hive.metastore.leader.CompactorTasks@e0059c8, leader: true
> java.lang.RuntimeException: null
>         at 
> org.apache.hadoop.hive.metastore.PersistenceManagerProvider.retry(PersistenceManagerProvider.java:662)
>  ~[hive-standalone-metastore-server-4.1.0.jar:4.1.0]
>         at 
> org.apache.hadoop.hive.metastore.PersistenceManagerProvider.updatePmfProperties(PersistenceManagerProvider.java:270)
>  ~[hive-standalone-metastore-server-4.1.0.jar:4.1.0]
>         at 
> org.apache.hadoop.hive.metastore.ObjectStore.setConf(ObjectStore.java:373) 
> ~[hive-standalone-metastore-server-4.1.0.jar:4.1.0]
>         at 
> org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:77) 
> ~[hadoop-common-3.4.1.jar:?]
>         at 
> org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:159) 
> ~[hadoop-common-3.4.1.jar:?]
>         at 
> org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:126) 
> ~[hadoop-common-3.4.1.jar:?]
>         at 
> org.apache.hadoop.hive.metastore.RawStoreProxy.<init>(RawStoreProxy.java:59) 
> ~[hive-standalone-metastore-server-4.1.0.jar:4.1.0]
>         at 
> org.apache.hadoop.hive.metastore.RawStoreProxy.getProxy(RawStoreProxy.java:67)
>  ~[hive-standalone-metastore-server-4.1.0.jar:4.1.0]
>         at 
> org.apache.hadoop.hive.metastore.HMSHandler.newRawStoreForConf(HMSHandler.java:565)
>  ~[hive-standalone-metastore-server-4.1.0.jar:4.1.0]
>         at 
> org.apache.hadoop.hive.metastore.HMSHandler.getMSForConf(HMSHandler.java:543) 
> ~[hive-standalone-metastore-server-4.1.0.jar:4.1.0]
>         at 
> org.apache.hadoop.hive.ql.txn.compactor.MetaStoreCompactorThread.init(MetaStoreCompactorThread.java:65)
>  ~[hive-exec-4.1.0-core.jar:4.1.0]
>         at 
> org.apache.hadoop.hive.ql.txn.compactor.Initiator.init(Initiator.java:232) 
> ~[hive-exec-4.1.0-core.jar:4.1.0]
>         at 
> org.apache.hadoop.hive.metastore.leader.CompactorTasks.takeLeadership(CompactorTasks.java:140)
>  ~[hive-standalone-metastore-server-4.1.0.jar:4.1.0]
>         at 
> org.apache.hadoop.hive.metastore.leader.LeaseLeaderElection.lambda$notifyListener$0(LeaseLeaderElection.java:141)
>  ~[hive-standalone-metastore-server-4.1.0.jar:4.1.0]
>         at java.base/java.util.ArrayList.forEach(ArrayList.java:1511) ~[?:?]
>         at 
> org.apache.hadoop.hive.metastore.leader.LeaseLeaderElection.notifyListener(LeaseLeaderElection.java:138)
>  ~[hive-standalone-metastore-server-4.1.0.jar:4.1.0]
>         at 
> org.apache.hadoop.hive.metastore.leader.LeaseLeaderElection.doWork(LeaseLeaderElection.java:120)
>  ~[hive-standalone-metastore-server-4.1.0.jar:4.1.0]
>         at 
> org.apache.hadoop.hive.metastore.leader.LeaseLeaderElection.tryBeLeader(LeaseLeaderElection.java:181)
>  ~[hive-standalone-metastore-server-4.1.0.jar:4.1.0]
>         at 
> org.apache.hadoop.hive.metastore.leader.LeaseLeaderElection.tryBeLeader(LeaseLeaderElection.java:63)
>  ~[hive-standalone-metastore-server-4.1.0.jar:4.1.0]
>         at 
> org.apache.hadoop.hive.metastore.leader.LeaderElectionContext.lambda$start$2(LeaderElectionContext.java:125)
>  ~[hive-standalone-metastore-server-4.1.0.jar:4.1.0]
>         at java.base/java.lang.Thread.run(Thread.java:833) [?:?]
>         at 
> org.apache.hadoop.hive.metastore.leader.LeaderElectionContext.start(LeaderElectionContext.java:136)
>  [hive-standalone-metastore-server-4.1.0.jar:4.1.0]
>         at 
> org.apache.hadoop.hive.metastore.HiveMetaStore$8.run(HiveMetaStore.java:855) 
> [hive-standalone-metastore-server-4.1.0.jar:4.1.0]
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to