#---------------------配置-----------------------#
[root@vwmaster conf]# pwd
/opt/bigdata/hadoop/hive110/conf
–新建hive-site.xml文件
------------ thrift => rpc -----------------
–ipc => 同节点进程之间函数调用
–rpc => 不同节点进程之间函数调用(微服的核心)
–thrift通过一个中间语言IDL(接口定义语言)来定义RPC的数据类型和接口,这些内容写在以.thrift结尾的文件中,
–然后通过特殊的编译器来生成不同语言的代码,以满足不同需要的开发者,比如java开发者,就可以生成java代码,c++开发者可以生成c++代码,
–生成的代码中不但包含目标语言的接口定义,方法,数据类型,还包含有RPC协议层和传输层的实现代码
[root@vwmaster conf]# vi hive-site.xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>hive.metastore.warehouse.dir</name>
<value>/opt/bigdata/hadoop/hive110/warehouse</value>
</property>
<property>
<name>javax.jdo.option.ConnectionURL</name>mysql
<value>jdbc:mysql://20.0.0.100:3306/hive110?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>
</configuration>
–将mysql-java驱动拷贝到 hive110/lib中
[root@vwmaster lib]# cp /opt/install/hadoop/mysql-connector-java-5.1.38.jar ./
– hive环境变量
export HIVE_HOME=/opt/bigdata/hive110
export PATH=$PATH:$HIVE_HOME/bin
–初始化hive
./schematool -dbType mysql -initSchema
–初始化异常:在mysql中给root授权
mysql> grant all on *.* to root@'%' identified by 'root';
grant all on *.* to root@'%' identified by 'root';
mysql> flush privileges;
–如果密码为纯数字,要去修改密码
mysql> update user set password=password('root') where user='root';
启动hive访问hiveserver
[root@vwmaster bin]# ./hive
select host,user,password from user
修改mysql数据库的权限
use mysql;
–取消繁琐的日志信息
----------临时 beeline
set hive.server2.logging.operation.level=NONE;
---------永久配置:配置后需要重启服务
<property>
<name>hive.server2.logging.operation.enabled</name>
<value>true<alue>
</property>
<property>
<name>hive.server2.logging.operation.level</name>
<value>NONE<alue>
</property>
<property>
<name>hive.server2.logging.operation.log.location</name>
<value>/opt/bigdata/hadoop/hive110/oprlog<alue>
</property>
-------如果密码为纯数字,要去修改密码-------
mysql> update user set password=password('root') where user='root';