hadoop2.6 pseudo distribution configuration: http://blog.csdn.net/gamer_gyt/article/details/46793731
hive1.2 Derby metabase Configuration: http://blog.csdn.net/gamer_gyt/article/details/47150621
Environment description
hadoop2.6 Pseudo-Distribution Ubuntu14.04 hive 1.1 mysql 5.5 MySQL connection driver 5.1.11
One, hive configuration
1. Extract hive to the appropriate directory (my is/usr/localo/hadoop)
2. Renaming to Hive
3. Setting Environment variables
sudo gedit/etc/profile
Add: Export hive_home=/usr/local/hadoop/hive
Add $HIVE _hiome/bin in Path
4. Under directory $hive_home/conf/, perform the command MV hive-default.xml.template hive-site.xml Rename
Under Directory $hive_home/conf/, perform the command MV hive-env.sh.template hive-env.sh Rename
Under directory $hive_home/bin, modify the file hive-config.sh to add the following:
Export JAVA_HOME=/USR/LOCAL/JDK #你自己的java路径
Export Hive_home=/usr/local/hadoop/hive
Export Hadoop_home=/usr/local/hadoop
Modify hive-env.sh such as:
========================================================================================
At this point, the hive can be used normally, but the Derby database is used at this time, not two machines simultaneously access
========================================================================================
Two, MySQL installation
1. Delete MySQL
a. sudo apt-get autoremove--purge mysql-server-5.0 b. sudo apt-get remove Mysql-serverc. sudo apt-get autoremove Mysql-serverd. sudo apt-get Remove Mysql-common (very important)
In fact, some of the above is redundant, it is recommended to follow the order
2. Clean up residual data
Dpkg-l | grep ^rc| awk ' {print $} ' | sudo Xargs dpkg-p
3. Install MySQL
sudo Install mysql-sudoinstall mysql-client
Once the installation is complete, the MySQL server should start automatically. You can check whether the MySQL server is running by running the following command at the terminal prompt:
4. Check if MySQL is running
sudo grep MySQL
When you run the command, you can see a line similar to the following:
[email protected]:~# sudo netstat-tap | grep mysqltcp 0 0 localhost.localdo:mysql *:* LISTEN
If the server does not function correctly, you can start it by using the following command:
sudo /etc/init.d/mysql restart
third, use MySQL as Hive's metastore configuration
1. Place MySQL JDBC driver into Hive's lib directory
2. Modify the Hive-site.xml file, modify the corresponding content as follows:
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://localhost:3306/hive?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>root</value>
</property>
Note: The two root of the above configuration is the username and secret that you typed when you installed MySQL
============================================================================================
At this point, the configuration of MySQL as a metabase has been completed
============================================================================================
Four, wrong
If the installation process is not connected or inaccessible, it may be a permissions issue
Enter the Hadoop installation directory local execution: sudo chown - r Hadoop : hadoop ./ hadoop # Modify file permissions
If Com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:Communications link failure appears
Recommend a good view of the configuration file Hive-site.xml
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
hive1.2 pseudo-distributed MySQL database configuration detailed