在集群上运行hbase的jar程序时报找不到scan的类库,输入
代码语言:javascript复制export HADOOP_CLASSPATH=$HBASE_HOME/lib/*:$CLASSPATH
安装mysql 1.先删除linux上相关mysql
代码语言:javascript复制yum remove mysql-libs
是否继续?[y/N]:y 2.下载 mysql57-community-release-el7-8.noarch.rpm 的 YUM 源:
代码语言:javascript复制wget http://repo.mysql.com/mysql57-community-release-el7-8.noarch.rpm
3.安装 mysql57-community-release-el7-8.noarch.rpm:
代码语言:javascript复制rpm -ivh mysql57-community-release-el7-8.noarch.rpm
安装完后,cd /etc/yum.repos.d/
代码语言:javascript复制mysql-community.repo
mysql-community-source.repo
4.安装mysql service
代码语言:javascript复制yum install mysql-server
执行y
安装完毕删除
代码语言:javascript复制rm -rf mysql57-community-release-el7-8.noarch.rpm
6.启动mysql
代码语言:javascript复制service mysqld start
7.查看root的默认密码
代码语言:javascript复制cat /var/log/mysqld.log | grep password
8.登录mysql
代码语言:javascript复制mysql -uroot -p
9.修改root的默认密码
代码语言:javascript复制alter user 'root'@'localhost' identified by 'Www_110';
10.创建hive的数据库
代码语言:javascript复制create database hive;
11.创建一个用户,一般操作不要用root
代码语言:javascript复制create user 'hiveme'@'%' identified by 'Www_110';
12.给刚创建的用户授权
代码语言:javascript复制grant all on hive.* TO 'hiveme'@'%';
grant all on hive.* TO 'hiveowner'@'localhost' identified by 'Www_110';
Hive安装 1.官网下载安装包,上传到服务器,解压 2.配置环境变量
代码语言:javascript复制vim /etc/profile
export HIVE_HOME=/root/hd/apache-hive-2.3.3-bin
export PATH=$PATH:$JAVA_HOME/bin:$HADOOP_HOME/bin:$HADOOP_HOME/sbin:$HBASE_HOME/bin:$HIVE_HOME/bin
生效
代码语言:javascript复制source /etc/profile
3.配置hive-site.xml 先生成一个hive-site.xml
代码语言:javascript复制cp hive-default.xml.template hive-site.xml
删除所有esc ggvG d
把如下信息复制到hive-site.xml
代码语言:javascript复制<?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://ip:3306/hive?useSSL=false</value>
</property>
<property>
<name>javax.jdo.option.ConnectionDriverName</name>
<value>com.mysql.jdbc.Driver</value>
</property>
<property>
<name>javax.jdo.option.ConnectionUserName</name>
<value>hiveowner</value>
</property>
<property>
<name>javax.jdo.option.ConnectionPassword</name>
<value>Welcowww</value>
</property>
</configuration>
4.初始化mysql
代码语言:javascript复制schematool -dbType mysql -initSchema
5.找不到jar
代码语言:javascript复制org.apache.hadoop.hive.metastore.HiveMetaException: Failed to load driver
Underlying cause: java.lang.ClassNotFoundException : com.mysql.jdbc.Driver
6.官网下载jar
代码语言:javascript复制https://downloads.mysql.com/archives/c-j/
下载解压获取jar 7.复制jar到hive到lib
代码语言:javascript复制 scp -r /Users/hh/desktop/mysql-connector-java-5.1.46-bin.jar hh555:/root/hd/apache-hive-2.3.3-bin/lib/
8.再次重新初始化mysql
代码语言:javascript复制schematool -dbType mysql -initSchema
hive安装完毕!