hadoop mysql 安装失败_hadoop hive2.0 mysql本地仓库安装 错误解决

参考资料:

hive安装手册。

Hadoop2.7实战v1.0之Hive-2.0.0+MySQL远程模式安装  http://m.blog.itpub.net/30089851/viewspace-2082805/

安装环境

Ubuntu 12.04 server

java 1.7.0_95

hadoop 2.6.4

步骤:

1、安装mysql

直接使用命令安装:

更新源

sudo apt-get update

安装

sudo apt-get install mysql-server mysql-client

2、Mysql创建新用户以及数据库并授权

mysql> create database hive_remote_meta;

Query OK, 1 row affected (0.04 sec)

mysql> create user ‘hive‘ identified by ‘hive‘;

Query OK, 0 rows affected (0.05 sec)

mysql> grant all privileges on hive_remote_meta.* to ‘hive‘@‘%‘;

Query OK, 0 rows affected (0.03 sec)

mysql> flush privileges;

Query OK, 0 rows affected (0.01 sec)

查看Mysql监听地址

nestart -an | grep 3306

tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN

结果如上即修改Mysql监听IP地址

sudo vim /etc/mysql/my.cnf

# localhost which is more compatible and is not less secure.

bind-address = 127.0.0.1 #注释掉

#

# * Fine Tuning

3、安装hive

官网下载hive2.0安装包

解压到指定文件夹

sudo tar -zxvf apache-hive-2.0.0-bin.tar.gz -C /you_hive_path

配置环境变量

sudo vim ~/.bashrc

export HIVE_HOME=/you_hive_path/apache-hive-2.0.0-bin

export PATH=$PATH:$HIVE_HOME/bin

4、配置hive-size.xml文件,位于 HIVE_HOME下的conf中,新建。

#设置为本地仓库

hive.metastore.local

true

#设置仓库地址, value更换为你创建的mysql数据库

javax.jdo.option.ConnectionURL

jdbc:mysql://Master:3306/hive_remote_meta?characterEncoding=UTF-8

JDBC connect string for a JDBC metastore

#设置使用 JDBC

javax.jdo.option.ConnectionDriverName

com.mysql.jdbc.Driver

Driver class name for a JDBC metastore

#数据库用户名

javax.jdo.option.ConnectionUserName

hive

username to use against metastore database

#数据库密码

javax.jdo.option.ConnectionPassword

hive

password to use against metastore database

5、初始化hive仓库

schematool -initSchema -dbType mysql

SLF4J: Class path contains multiple SLF4J bindings.

SLF4J: Found binding in [jar:file:/usr/local/hadoop/hive/apache-hive-2.0.0-bin/lib/hive-jdbc-2.0.0-standalone.jar!/org/slf4j/impl/StaticLoggerBinder.class]

SLF4J: Found binding in [jar:file:/usr/local/hadoop/hive/apache-hive-2.0.0-bin/lib/log4j-slf4j-impl-2.4.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]

SLF4J: Found binding in [jar:file:/usr/local/hadoop/share/hadoop/common/lib/slf4j-log4j12-1.7.5.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]

Metastore connection URL:jdbc:mysql://Master:3306/hive_remote_meta?createDatabaseIfNotExist=true

Metastore Connection Driver :com.mysql.jdbc.Driver

Metastore connection User:hive

Starting metastore schema initialization to 2.0.0

Initialization script hive-schema-2.0.0.mysql.sql

Initialization script completed

schemaTool completed

6、启动

hive

hive>

若出现

Name node is in safe mode.

则关闭hdfs安全模式

hadoop dfsadmin -safemode leave

完。

hadoop hive2.0 mysql本地仓库安装 错误解决

标签:

本条技术文章来源于互联网,如果无意侵犯您的权益请点击此处反馈版权投诉

本文系统来源:http://www.cnblogs.com/yicoder/p/5470491.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值