cloudera manager添加hive时报错找不到jdbc driver
报错
JDBC driver cannot be found. Unable to find the JDBC database jar on host
把包放入这个目录,注意文件名要保持一致 网上又很多需要把这个驱动包放到
cp /root/mysql-connector-java-5.1.33-bin.jar /opt/cloudera/parcels/CDH-5.4.0-1.cdh5.4.0.p0.27/lib/hive/lib/
/opt/cloudera/parcels/CDH/lib/hive/lib或者
/opt/cloudera/parcels/CDH-5.4.0-1.cdh5.4.0.p0.27/lib/hive/lib
以上其实是同一个位置
*** 作后问题依旧出现。
解决方法:
后来在网上找到需要将这个包放到这个路径下就通过了(名字需要修改下)
/usr/share/java/mysql-connector-java.jar
有个连接数据库的jar包用来驱动
2.连接数据库,具体代码网上有,主要就是设置数据库类型,名字,用户名,密码之类的
3.调用连接,写入数据,
Connection con=new Connection()
String sql="insert into 表名 (列名1,列名2) values(值1,值2)"
PreparedStatement ps=con.getPerpareStatment()
1、yum install cloudera-manager-daemons cloudera-manager-agent cloudera-manager-server2、cd /opt/cloudera/parcel-repo
(1)将第一部分下载的CDH Parcel文件(CDH-6.2.0-1.cdh6.2.0.p0.967373-el7.parcelCDH-6.2.0-1.cdh6.2.0.p0.967373-el7.parcel.sha256和manifest.json)上传至该目录下
(2)mv CDH-6.2.0-1.cdh6.2.0.p0.967373-el7.parcel.sha256 CDH-6.2.0-1.cdh6.2.0.p0.967373-el7.parcel.sha
(3)chown -R cloudera-scm:cloudera-scm /opt/cloudera/parcel-repo/*
3、将mysql-connector-java-5.1.47-bin.jar文件上传至CM Server节点上的/usr/share/java/目录下并重命名为mysql-connector-java.jar
4、安装 mysql(安装过程略),并创建相应库
mysql>CREATE DATABASE scm DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci
mysql>CREATE DATABASE amon DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci
mysql>CREATE DATABASE rman DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci
mysql>CREATE DATABASE metastore DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci
mysql>GRANT ALL ON scm.* TO 'scm'@'%' IDENTIFIED BY 'scm'
mysql>GRANT ALL ON amon.* TO 'amon'@'%' IDENTIFIED BY 'amon'
mysql>GRANT ALL ON rman.* TO 'rman'@'%' IDENTIFIED BY 'rman'
mysql>GRANT ALL ON metastore.* TO 'hive'@'%' IDENTIFIED BY 'hive'
mysql>FLUSH PRIVILEGES
mysql数据库与CM Server是同一台主机
执行命令:/opt/cloudera/cm/schema/scm_prepare_database.sh mysql scm scm
mysql数据库与CM Server不在同一台主机上
执行命令:/opt/cloudera/cm/schema/scm_prepare_database.sh mysql -h --scm-host scm scm
5、启动cloudera-scm-server
systemctl start cloudera-scm-server
6、登录页面进行配置
ip:7180
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)