1、首先在ubuntu14.04上安装mysql,首先尝试的下载mysql的tar包安装,未成功,然后使用在线安装sudo apt-get install mysql-server mysql-client,安装成功。
2、登录数据库
a) 创建hive用户,create user hive identified by ‘hive’
b) 授予所有权限grant all privileges on *.* to ‘hive’ with grant option;
c) 创建hive数据库,create database ‘hive’
3、下载mysql连接java的驱动,复制到/opt/hive-1.1.1/lib下
4、修改/opt/hive-1.1.1/conf中的hive-default.xml为hive-site.xml
a)
javax.jdo.option.ConnectionURL
jdbc:mysql://localhost:3306/hive?createDatabaseIfNotExist=true
JDBC connect string for a JDBC metastore
b)
javax.jdo.option.ConnectionDriverName
com.mysql.jdbc.Driver
Driver class name for a JDBC metastore
c)
javax.jdo.option.ConnectionUserName
hive
username to use against metastore database
d)
javax.jdo.option.ConnectionPassword
hive
password to use against metastore database
5、启动hadoop,然后启动hive
a) 启动出现如下错误
解决方法:
b) 报错
解决方法:
将a中的相对路径修改为绝对路径。
6、配置hive环境变量时,修改了linux的etc目录权限为777后,重启linux机器后,
发现su、sudo等命令无法使用,hadoop启动失败。
7、重新克隆备份虚拟机,遇到一些问题,如:无密码登录失效,转到root用户失败
a) Ubuntu 下su:authentication failure的解决办法
i. $ sudo passwd root
ii. Enter new UNIX password:
iii. Retype new UNIX password:
iv. passwd: password updated successfully
b) 重设无密码登录。
删除/home/hadoop/.ssh后,重新使用ssh-keygen -t rsa -P “” ,只生成两个文件。
重新创建authorized_keys文件,touch authorized_keys;将公钥复制进去
cat id_rsa.pub >> authorized_keys,便可无密码登录
c) 从一台服务器复制到另一台服务器命令:
d) 创建[外部表]发生错误,提示信息如下图:
查询资料得,create table ... stored by textfile 在hive-1.1.1存在Bug,在1.0.0,
e) 创建[分区表]报错,提示如下:
语法错误:row format delimited 后面不应该加'\t'