hive stepped on a pit

When configuring Metastore to MySql, I encountered a java.net.ConnectException pit.
 
First, we should rule out basic hive configuration is successful, at least ensure that the stand-alone mode (Metastore default stored in the built-in derby database) can reach the following hive input interface
 
 
Secondly, we need to install a lower version of the database (as 5.7 or less, the test version is 5.6). Then you need to add a hive-site.xml in the hive / conf / directory
Configuration is as follows:

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>

<configuration>
<property>
<name>hive.metastore.warehouse.dir</name>
<value>/user/hive/warehouse</value>
</property>

<property>
<name>hive.metastore.local</name>
<value>false</value>
</property>

<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://{mysql安装的ip}:3306/hive_remote?createDatabaseIfNotExist=true</value>

</property>

<property>
<name>javax.jdo.option.ConnectionDriverName</name>
<value>com.mysql.jdbc.Driver</value>
</property>

<property>
<name>javax.jdo.option.ConnectionUserName</name>
<value>root</value>
</property>

<property>
<name>javax.jdo.option.ConnectionPassword</name>
<value>11451287</value>
</property>

</configuration>

Ensure that the user under our hdfs / hive / warehouse and tmp directory is created, if an error occurs also need to change the access rights of the two directories.

 

 And then start the entire cluster hadoop zookeeper (due blogger zookeeper with jdk versions have differences, so there is no process of zookeeper)

 

 

Finally start hive, and bloggers continue error, climbed the pit a few days, whether it is for the jdbc driver version, or reinstall mysql, or reinstall the hive, he has refused all connected. Then pit the two days off, burst of inspiration, found a real machine to mysql even pc virtual machine connection is a failure, even though I turned off the virtual firewall. Then found that we needed to set up such a command in mysql the following, we end real machine can be accessed

mysql> GRANT ALL PRIVILEGES ON *.* TO 'username'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;

 

This time on the virtual machine with good hive MySQL map (found successful launch)

 

 

Therefore, the conclusion is: play had previously been playing in the single database above, even with the installation of the host database host above all normal, but when we play in the server above, not only to pay attention to the problem of strong fire switch, mysql database itself also needs we are authorized to connect to the MySQL server from any host

 

 

Guess you like

Origin www.cnblogs.com/ming1024/p/11784750.html
Recommended