Hadoop集群redhad离线安装Hive

2017-01-05 20:07:56来源:CSDN作者:BinChasing人点击

参考文档

http://dblab.xmu.edu.cn/blog/install-hive/ Ubuntu安装hive,并配置mysql作为元数据库
http://www.bkjia.com/Mysql/1093428.html Your password does not satisfy the current policy requirements,hy000satisfy

Hive安装

Hive只要安装在NameNode上,其余节点无需安装配置Hive
先安装Mysql,在安装Hive,最后配置数据库

Mysql安装

官网下载RPM安装包
这里写图片描述
RPM安装

#terminalmkdir mysqlcp mysql-5.7.17-1.el5.x86_64.rpm-bundle.tar mysqlcd mysqltar xvf mysql-5.7.17-1.el5.x86_64.rpm-bundle.tarsudo rpm -ivh mysql-community-common-5.7.17-1.el5.x86_64.rpm --nodeps --forcesudo rpm -ivh mysql-community-libs-5.7.17-1.el5.x86_64.rpm --nodeps --forcesudo rpm -ivh mysql-community-devel-5.7.17-1.el5.x86_64.rpm --nodeps --forcesudo rpm -ivh mysql-community-client-5.7.17-1.el5.x86_64.rpm --nodeps --forcesudo rpm -ivh mysql-community-server-5.7.17-1.el5.x86_64.rpm --nodeps --force

修改用户名密码

sudo /etc/init.d/mysqld startsudo /etc/init.d/mysqld stopsudo killall -TERM mysqldsudo mysqld_safe --skip-grant-tables --skip-networking &mysql -u root
#sqluse mysql;update user set authentication_string = password('123456'), password_expired = 'N', password_last_changed = now() where user = 'root';exit;
#terminalsudo /etc/init.d/mysqld restartmysql -u root -p
#sqlselect user();set global validate_password_policy=0;set global validate_password_length=1;ALTER USER USER() IDENTIFIED BY '123456';exit;

Hive安装

#解压hivecd ~sudo tar -zxvf ./apache-hive-1.2.1-bin.tar.gz -C /usr/local   # 解压到/usr/local中cd /usr/local/sudo mv apache-hive-1.2.1-bin hive       # 将文件夹名改为hivesudo chown -R hadoop:hadoop hive            # 修改文件权限vim ~/.bashrc
export HIVE_HOME=/usr/local/hiveexport PATH=$PATH:$HIVE_HOME/bin
source ~/.bashrc

修改配置文件

#修改配置文件cd /usr/local/hive/confcp hive-default.xml.template hive-default.xmlvim hive-site.xml #添加如下xml内容
<?xml version="1.0" encoding="UTF-8" standalone="no"?><?xml-stylesheet type="text/xsl" href="configuration.xsl"?><configuration>  <property>    <name>javax.jdo.option.ConnectionURL</name>    <value>jdbc:mysql://localhost:3306/hive?createDatabaseIfNotExist=true</value>    <description>JDBC connect string for a JDBC metastore</description>  </property>  <property>    <name>javax.jdo.option.ConnectionDriverName</name>    <value>com.mysql.jdbc.Driver</value>    <description>Driver class name for a JDBC metastore</description>  </property>  <property>    <name>javax.jdo.option.ConnectionUserName</name>    <value>hive</value>    <description>username to use against metastore database</description>  </property>  <property>    <name>javax.jdo.option.ConnectionPassword</name>    <value>hive</value>    <description>password to use against metastore database</description>  </property></configuration>

mysql jdbc + 配置mysql

配置mysql作为元数据库

cd ~tar -zxvf mysql-connector-java-5.1.40.tar.gzcp mysql-connector-java-5.1.40/mysql-connector-java-5.1.40-bin.jar  /usr/local/hive/lib #将mysql-connector-java-5.1.40-bin.jar拷贝到/usr/local/hive/lib目录下
mysql -u root -p
#sqlcreate database hive;grant all on *.* to hive@localhost identified by 'hive'; flush privileges;

遇到的问题

rpm安装

rpm -ivh MySQL-xxx.rpm

error: Failed dependencies:
纠结了半天,终于找到了解决方法:(感谢提供相关文章的博友)
在安装包后面加两个参数,如

rpm -ivh MySQL-server-5.5.24-1.linux2.6.x86_64.rpm --nodeps --force

加上那两个参数的意义就在于,
安装时不再分析包之间的依赖关系而直接安装,
也就不会再提示error: Failed dependencies:这样的错误了

Mysql5.7修改root密码

版本更新,原来user里的password字段已经变更为authentication_string
版本更新 缘故,好多网上的教程都不适用了,甚至连官网的文档也不是能够顺利操作的。
如果 MySQL 正在运行,首先杀之: killall -TERM mysqld。
运行mysqld_safe –skip-grant-tables &
如果此时不想被远程连接:mysqld_safe –skip-grant-tables –skip-networking &
使用mysql连接server
更改密码:update user set authentication_string = password(‘123456’), password_expired = ‘N’, password_last_changed = now() where user = ‘root’;
*特别提醒注意的一点是,新版的mysql数据库下的user表中已经没有Password字段了
而是将加密后的用户密码存储于authentication_string字段
修改完毕。重启
http://www.bkjia.com/Mysql/1093428.html
若出现“ERROR 1819 (HY000): Your password does not satisfy the current policy requirements”(重启后报错)
set global validate_password_policy=0;
set global validate_password_length=1;
ALTER USER USER() IDENTIFIED BY ‘123456’;

最新文章

123

最新摄影

微信扫一扫

第七城市微信公众平台