-
-
Save SureshChaganti/37413cb3c38911974472ffbbd805409e to your computer and use it in GitHub Desktop.
Install hive on Mac with Homebrew
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ tar zxvf mysql-connector-java-5.1.44.tar.gz | |
$ sudo cp mysql-connector-java-5.1.44/mysql-connector-java-5.1.44-bin.jar /usr/local/Cellar/hive/2.1.1/libexec/lib/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ brew update | |
$ brew install hadoop | |
$ brew install hive | |
$ brew install mysql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ~/.bashrc | |
export HADOOP_HOME=/usr/local/Cellar/hadoop/2.8.1 | |
export HIVE_HOME=/usr/local/Cellar/hive/2.1.1/libexec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cd /usr/local/Cellar/hive/4.1.1/libexec/conf | |
$ cp hive-default.xml.template hive-site.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<property> | |
<name>javax.jdo.option.ConnectionURL</name> | |
<value>jdbc:mysql://localhost/metastore</value> | |
</property> | |
<property> | |
<name>javax.jdo.option.ConnectionDriverName</name> | |
<value>com.mysql.jdbc.Driver</value> | |
</property> | |
<property> | |
<name>javax.jdo.option.ConnectionUserName</name> | |
<value>hiveuser</value> | |
</property> | |
<property> | |
<name>javax.jdo.option.ConnectionPassword</name> | |
<value>password</value> | |
</property> | |
<property> | |
<name>datanucleus.fixedDatastore</name> | |
<value>false</value> | |
</property> | |
<property> | |
<name>hive.exec.local.scratchdir</name> | |
<value>/tmp/hive</value> | |
<description>Local scratch space for Hive jobs</description> | |
</property> | |
<property> | |
<name>hive.downloaded.resources.dir</name> | |
<value>/tmp/hive</value> | |
<description>Temporary local directory for added resources in the remote file system.</description> | |
</property> | |
<property> | |
<name>hive.querylog.location</name> | |
<value>/tmp/hive</value> | |
<description>Location of Hive run time structured log file</description> | |
</property> | |
<property> | |
`<name>hive.metastore.schema.verification</name>` | |
<value>false</value> | |
<description>Some Description</description> | |
</property> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
run the schematool so that hive will use mysql | |
./schematool -initSchema -dbType mysql | |
$hive | |
hive > show tables; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
start My sql with below command: | |
brew services start mysql | |
$ mysql | |
mysql> CREATE DATABASE metastore; | |
mysql> USE metastore; | |
mysql> CREATE USER 'hiveuser'@'localhost' IDENTIFIED BY 'password'; | |
mysql> GRANT SELECT,INSERT,UPDATE,DELETE,ALTER,CREATE, REFERENCES, INDEX ON metastore.* TO 'hiveuser'@'localhost'; |
You have to edit bash profile and copy these to paths in the file. To open type in command line: open ~/.bashrc
Hello Suresh,
Thank you for the post!
When I try to run the hive it gives me,
Unable to determine Hadoop version information.
'hadoop version' returned:
I have tried adding the Hadoop version in bashrc but still not working. Can you please help me resolve the issue?
cp mysql jdbc driver jar to hive lib,for example cp mysql-connector-java-8.0.16.jar /home/xxx/apache-hive-3.1.2-bin/lib/
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
step 2
~/.bashrc <---### -Would you please explain what exactly is that command and what it does
export HADOOP_HOME=/usr/local/Cellar/hadoop/2.8.1
export HIVE_HOME=/usr/local/Cellar/hive/2.1.1/libexec