Work fine after add docker --network. Thanks all. But I still have a question about how to change log level?
Jia Fan <fanjia1...@gmail.com> 于2024年9月30日周一 10:45写道: > Thanks Simhadri. > I checked /tmp/hive/hive.log. The key error is can not parse host > `metastore`. > ``` > Caused by: java.net.UnknownHostException: metastore > at > java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:184) > at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) > at java.net.Socket.connect(Socket.java:607) > at org.apache.thrift.transport.TSocket.open(TSocket.java:221) > ... 31 more > ``` > > Another question, how to change hive log level when start docker > container? I only can get few log use docker log command. > > Simhadri G <simhad...@apache.org> 于2024年9月30日周一 10:37写道: > >> Hi Jia Fan, >> >> Can you please, docker exec into the container and share the stack trace >> from the log file at tmp/root/hive.log ? >> >> That will give us more info on what's going on . >> >> Thanks >> Simhadri G >> >> On Mon, Sep 30, 2024, 8:02 AM Jia Fan <fanjia1...@gmail.com> wrote: >> >>> Thanks Zoltan for response. >>> I pull docker image[1] from docker hub. I believe it pushed by hive team. >>> [1] >>> https://hub.docker.com/layers/apache/hive/3.1.3/images/sha256-d102ba29ad07e93c303894896203a80b903c0001d80221f1cb9fea92dcac06e4?context=explore >>> >>> Zoltán Rátkai <zrat...@cloudera.com.invalid> 于2024年9月30日周一 03:51写道: >>> >>>> Hi Jia Fan, >>>> >>>> did you check the if metastore started properly as well? >>>> On Dockerhub there is Hive version from 4.0, but as I see you tried to >>>> use 3.1.3. >>>> >>>> Regards, >>>> >>>> Zoltan Ratkai >>>> >>>> On Sun, Sep 29, 2024 at 12:10 PM Jia Fan <fanjia1...@gmail.com> wrote: >>>> >>>>> Hi folks, >>>>> I followed the guide[1] to run docker with hive. >>>>> These are my shell command: >>>>> >>>>> ``` >>>>> [root@localhost ~]# docker run -d -p 9083:9083 --env >>>>> SERVICE_NAME=metastore --name metastore apache/hive:3.1.3 >>>>> b8674d57fa252258354b9795eb2098b020f7ea8987f519b51cc158196b3da35f >>>>> [root@localhost ~]# docker run -d -p 10000:10000 -p 10002:10002 --env >>>>> SERVICE_NAME=hiveserver2 --env >>>>> SERVICE_OPTS="-Dhive.metastore.uris=thrift://metastore:9083" --env >>>>> IS_RESUME="true" --name hiveserver2-standalone apache/hive:3.1.3 >>>>> 4478c26d41aab075da8b014dd0cb64c0ef6baec148872f761b697fc674edfc6b >>>>> ``` >>>>> >>>>> >>>>> The hive container seem like started properly. >>>>> But I can not start beeline with command: >>>>> >>>>> ``` >>>>> [root@localhost ~]# docker exec -it hiveserver2-standalone beeline >>>>> -u 'jdbc:hive2://localhost:10000/' >>>>> SLF4J: Class path contains multiple SLF4J bindings. >>>>> SLF4J: Found binding in >>>>> [jar:file:/opt/hive/lib/log4j-slf4j-impl-2.17.1.jar!/org/slf4j/impl/StaticLoggerBinder.class] >>>>> SLF4J: Found binding in >>>>> [jar:file:/opt/hadoop/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] >>>>> Connecting to jdbc:hive2://localhost:10000/ >>>>> 24/09/29 09:53:35 [main]: WARN jdbc.HiveConnection: Failed to connect >>>>> to localhost:10000 >>>>> Could not open connection to the HS2 server. Please check the server >>>>> URI and if the URI is correct, then ask the administrator to check the >>>>> server status. >>>>> Error: Could not open client transport with JDBC Uri: >>>>> jdbc:hive2://localhost:10000/: java.net.ConnectException: Connection >>>>> refused (Connection refused) (state=08S01,code=0) >>>>> Beeline version 3.1.3 by Apache Hive >>>>> [WARN] Failed to create directory: /home/hive/.beeline >>>>> No such file or directory >>>>> [root@localhost ~]# docker exec -it hiveserver2-standalone beeline >>>>> -u 'jdbc:hive2://localhost:10000/' >>>>> SLF4J: Class path contains multiple SLF4J bindings. >>>>> SLF4J: Found binding in >>>>> [jar:file:/opt/hive/lib/log4j-slf4j-impl-2.17.1.jar!/org/slf4j/impl/StaticLoggerBinder.class] >>>>> SLF4J: Found binding in >>>>> [jar:file:/opt/hadoop/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] >>>>> Connecting to jdbc:hive2://localhost:10000/ >>>>> 24/09/29 09:59:12 [main]: WARN jdbc.HiveConnection: Failed to connect >>>>> to localhost:10000 >>>>> Could not open connection to the HS2 server. Please check the server >>>>> URI and if the URI is correct, then ask the administrator to check the >>>>> server status. >>>>> Error: Could not open client transport with JDBC Uri: >>>>> jdbc:hive2://localhost:10000/: java.net.ConnectException: Connection >>>>> refused (Connection refused) (state=08S01,code=0) >>>>> Beeline version 3.1.3 by Apache Hive >>>>> [WARN] Failed to create directory: /home/hive/.beeline >>>>> No such file or directory >>>>> ``` >>>>> >>>>> Could you give me some help. Thanks. >>>>> >>>>> [1] https://hub.docker.com/r/apache/hive >>>>> >>>>> ________________________ >>>>> >>>>> >>>>> Jia Fan >>>>> >>>>