Search code examples
hivebeelinehive-metastore

beeline jdbc client - does it need Metastore JDBC connection details?


I have used hive CLI , that is "hive" ; upon reading a bit more, I came to know that "hive" cli is old one and the preferred way to interact with HIVE is using "beeline", which is a jdbc client, which connects to hiverserver2.

I have created a 5 node cluster and the "MetaStore database" (which is MySQL) is running on a physical server , with IP, say "11.22.33.44". (not writing the actual IP addresses)

The "hiveserver2" runs on a different physical server, 55.66.77.88 (not writing the actual IP addresses).

Now, when I want to connect to HIVE using "hiveserver2" , it asks for the Database URL.

Is this Database URL the same which we can connect to "MetaStore Database" (in my case MySQL) ?

Why should it ask for Database URL? As per my understanding, it connects to "hiveserver2" (which isn't a database server), so shouldn't it ask for host, port number where hiveserver2 is running?


Solution

  • If your hive server is running locally, you would access it like this

    beeline -u jdbc:hive2://localhost:10000
    

    Replace localhost with your Hive server ip/server name, not the metastore

    beeline -u jdbc:hive2://55.66.77.88:some_port -n someuser -p somepass