Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error starting the Metastore #1

Open
johndpknt opened this issue Jul 15, 2020 · 6 comments
Open

Error starting the Metastore #1

johndpknt opened this issue Jul 15, 2020 · 6 comments

Comments

@johndpknt
Copy link

Hello There,

I was working with your repo. getting below error in starting the metastore .
Can you help ?

Thanks in advance
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/opt/apache-hive-metastore-3.0.0-bin/lib/log4j-slf4j-impl-2.8.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/opt/hadoop-3.2.0/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console. Set system property 'org.apache.logging.log4j.simplelog.StatusLogger.level' to TRACE to show Log4j2 internal initialization logging.
2020-07-15 22:13:22: Starting Metastore Server
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/opt/apache-hive-metastore-3.0.0-bin/lib/log4j-slf4j-impl-2.8.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/opt/hadoop-3.2.0/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
Exception in thread "main" java.lang.NumberFormatException: For input string: "tcp://10.0.223.215:9083"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:580)
at java.lang.Integer.parseInt(Integer.java:615)
at org.apache.hadoop.hive.metastore.HiveMetaStore$HiveMetastoreCli.parse(HiveMetaStore.java:8636)
at org.apache.hadoop.hive.metastore.HiveMetaStore.main(HiveMetaStore.java:8654)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.hadoop.util.RunJar.run(RunJar.java:323)
at org.apache.hadoop.util.RunJar.main(RunJar.java:236)

2020-07-15 22:13:25,985 shutdown-hook-0 INFO Log4j appears to be running in a Servlet environment, but there's no log4j-web module available. If you want better web container support, please add the log4j-web JAR to your web archive or server lib directory.
2020-07-15 22:13:25,989 shutdown-hook-0 INFO Log4j appears to be running in a Servlet environment, but there's no log4j-web module available. If you want better web container support, please add the log4j-web JAR to your web archive or server lib directory.
2020-07-15 22:13:25,998 shutdown-hook-0 WARN Unable to register Log4j shutdown hook because JVM is shutting down. Using SimpleLogger

@joshuarobinson
Copy link
Owner

Hi, I have not seen that error before, but my guess is that the "tcp://" isn't supposed to be there.

Can you describe your kubernetes environment?

@ognjen-it
Copy link

@johndpknt
Hi,

I had the same problem and I resolved it when I changed versions of jar files.
My Dockerfile looks much different than his:

FROM openjdk:11-slim

ARG HADOOP_VERSION=3.2.1

RUN apt-get update && apt-get install -y curl --no-install-recommends && \
	rm -rf /var/lib/apt/lists/*

# Download and extract the Hadoop binary package.
RUN curl https://downloads.apache.org/hadoop/common/hadoop-$HADOOP_VERSION/hadoop-$HADOOP_VERSION.tar.gz \
	| tar xvz -C /opt/  \
	&& ln -s /opt/hadoop-$HADOOP_VERSION /opt/hadoop \
	&& rm -r /opt/hadoop/share/doc 

# Add S3a jars to the classpath using this hack.
RUN ln -s /opt/hadoop/share/hadoop/tools/lib/hadoop-aws* /opt/hadoop/share/hadoop/common/lib/ && \
    ln -s /opt/hadoop/share/hadoop/tools/lib/aws-java-sdk* /opt/hadoop/share/hadoop/common/lib/

# Set necessary environment variables. 
ENV HADOOP_HOME="/opt/hadoop"
ENV PATH="/opt/spark/bin:/opt/hadoop/bin:${PATH}"

# Download and install the standalone metastore binary.
RUN curl https://repo1.maven.org/maven2/org/apache/hive/hive-standalone-metastore/3.1.2/hive-standalone-metastore-3.1.2-bin.tar.gz \
	| tar xvz -C /opt/ \
	&& ln -s /opt/apache-hive-metastore-3.1.2-bin /opt/hive-metastore

# Download and install the mysql connector.
RUN curl -L https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.47.tar.gz \
	| tar xvz -C /opt/ \
	&& ln -s /opt/mysql-connector-java-5.1.47/mysql-connector-java-5.1.47.jar /opt/hadoop/share/hadoop/common/lib/ \
	&& ln -s /opt/mysql-connector-java-5.1.47/mysql-connector-java-5.1.47.jar /opt/hive-metastore/lib/ 

RUN rm /opt/hive-metastore/lib/guava-19.0.jar && \
	ls -lah /opt/hadoop/share/hadoop/common/lib/ && \
	cp /opt/hadoop/share/hadoop/common/lib/guava-27.0-jre.jar /opt/hive-metastore/lib/ && \
	cp /opt/hadoop/share/hadoop/tools/lib/hadoop-aws-3.2.1.jar /opt/hive-metastore/lib/ && \
	cp /opt/hadoop/share/hadoop/tools/lib/aws-java-sdk-bundle-1.11.375.jar /opt/hive-metastore/lib/

Just to know, when you deploy Mysql, you need to wait for 3 minutes until you see in logs:
mysqld: ready for connections

I can create PR if @joshuarobinson would like to review the code and merge it if it's better.

@sudoduan
Copy link

@ognjen-it @joshuarobinson This issue is happening to me as well even with the updated Dockerfile above. The error occurs when the "service" object is deployed. How would the service object affect the behavior? Any idea?

@temyer
Copy link

temyer commented Feb 10, 2022

I've solved it by adding:
enableServiceLinks: false
to metastore.yaml like this:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: metastore
spec:
  selector:
    matchLabels:
      app: metastore
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: metastore
    spec:
      enableServiceLinks: false
      containers:
      - name: metastore
        image: joshuarobinson/hivemetastore

@ognjen-it
Copy link

@sudoduan I just saw your message. Did you resolve the problem?

@ognjen-it
Copy link

I can confirm that @temyer's suggestion has resolved the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants