4月份小问题总结

版权声明:原创文章欢迎转载,转载请注明出处 https://blog.csdn.net/lushuangning/article/details/79836451

1.连接MySQL时的一条警告

在使用Hive的时候,由于metstore设置的数据库是服务器上的MySQL,这个MySQL版本是5.7.15,终端会弹下面的一条警告:

WARN: Establishing SSL connection without server's identity verification is not recommended. 
According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established 
by default if explicit option isn't set. For compliance with existing applications not 
using SSL the verifyServerCertificate property is set to 'false'. 
You need either to explicitly disable SSL by setting useSSL=false, 
or set useSSL=true and provide truststore for server certificate verification.

之前在使用MyBatis的时候出现过该问题,解决方法就是将连接数据库的url后面加一个参数useSSL=false,变成jdbc:mysql://xxx.xxx.xxx.xxx:3306/database_name?u&useSSL=false的形式。

按照这个思路,打开hive/conf/hive-site.xml文件,找到这个property

<property>
    <name>javax.jdo.option.ConnectionURL</name>
    <value>jdbc:mysql://xxx.xxx.xxx.xxx:3306/hive?createDatabaseIfNotExist=true</value>
 </property>

将其中的value改为

jdbc:mysql://xxx.xxx.xxx.xxx:3306/hive?createDatabaseIfNotExist=true&useSSL=false

启动时却发现报错,原因是

The reference to entity "useSSL" must end with the ';' delimiter.

参考文章在xml文件中&符号需要转义 后,将value改成

jdbc:mysql://xxx.xxx.xxx.xxx:3306/hive?createDatabaseIfNotExist=true&amp;useSSL=false

问题解决


2.Anaconda下载很慢

从Anaconda官网上下载的时候速度很慢,下着下着就提示下载失败,任何下载工具都不好使。
推荐一个清华大学开源软件镜像站,在这里面下,不用再担心下载速度问题。


3.CUDA driver version is insufficient for CUDA runtime version

在Ubuntu 16.04上将NVIDIA驱动和CUDA装起,运行/ usr / local / cuda / samples / 1_Utilities / deviceQuery以验证安装是否成功时,报

CUDA driver version is insufficient for CUDA runtime version Result = FAIL

这篇文章说是有多个显卡驱动,要卸载显卡驱动。简直就是bullshit!这根本不是多个显卡驱动的问题,并且Ubuntu上装NVIDIA显卡驱动本身就很麻烦不说,就是重装了驱动也无助于解决问题。

这句话的意思就是CUDA运行时的版本和驱动版本不匹配,我找到了当时安装显卡驱动和CUDA时的两个安装文件,一个是NVIDIA-Linux-x86_64-384.111.run,一个是cuda_9.1.85_387.26_linux.run。是的,CUDA是837.26,而显卡驱动是834.111。

于是,先卸载当前版本的CUDA。进入/usr/local/cuda-9.1/bin执行sudo ./uninstall_cuda_9.1.pl,最后手动删除cuda目录即可。

下载稍早的CUDA版本,我这里选择cuda_9.0.176_384.81_linux.run,比显卡驱动的384.111要靠前,安装后,不要忘记手动修改环境变量,再次测试

deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 9.0, CUDA Runtime Version = 9.0, NumDevs = 1
Result = PASS

问题解决。

4.Hadoop无法正常启动,namenode的log中报Cannot assign requested address。

用三台服务器搭建Hadoop集群,hadoop版本是2.7.5,服务器系统全是Centos 7.4,两台腾讯云服务器,一台阿里云服务器。

然而当把配置都配好之后,在主节点上运行start-dfs.sh后查看jps并没有发现NameNode进程和SecondaryNameNode两个进程。和之前搭建单机伪分布不同,按照我之前的一篇博客Hadoop2.7.5伪分布式配置及遇到的问题总结记录的方法并没有解决问题。

直到看到Hadoop启动出错Cannot assign requested address这篇博客,按照作者的说法,腾讯云服务器无法绑定公网IP的地址,评论中有人说阿里云也有这个问题。试着按照作者的方法,将hosts里的内容改成如下的形式

内网IP地址  你的hostname
公网IP地址  别的hostname
公网IP地址  别的hostname

既然阿里云也有这个问题,那我就把三台服务器的hosts都改了,需要注意在腾讯云的Centos系统中修改hosts的方法是直接修改/etc/cloud/templates/hosts.redhat.tmpl,不然重启后hosts还会变成修改前的状态,修改完毕,重启系统。

之后,再按照我那篇博客里面解决NameNode未启动的方法,成功搭建起Hadoop集群。

猜你喜欢

转载自blog.csdn.net/lushuangning/article/details/79836451