Spark集群启动python shell错误: Could not resolve hostname localhost: Temporary failure
来源:互联网 发布:怎么在淘宝买东西便宜 编辑:程序博客网 时间:2024/06/13 05:29
Hadoop集群部署参考:点击查看
Spark集群部署参考:点击查看
最近在自己搭建的平台上测试spark-python脚本,发现一个错误如下:
<span style="font-size:14px;">[master@slave1 spark]$ bin/pyspark Python 2.6.6 (r266:84292, Jul 23 2015, 15:22:56) [GCC 4.4.7 20120313 (Red Hat 4.4.7-11)] on linux2Type "help", "copyright", "credits" or "license" for more information./opt/spark/python/pyspark/sql/context.py:477: DeprecationWarning: HiveContext is deprecated in Spark 2.0.0. Please use SparkSession.builder.enableHiveSupport().getOrCreate() instead. DeprecationWarning)Setting default log level to "WARN".To adjust logging level use sc.setLogLevel(newLevel).16/08/01 02:33:38 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicableTraceback (most recent call last): File "/opt/spark/python/pyspark/shell.py", line 43, in <module> spark = SparkSession.builder\ File "/opt/spark/python/pyspark/sql/session.py", line 169, in getOrCreate sc = SparkContext.getOrCreate(sparkConf) File "/opt/spark/python/pyspark/context.py", line 294, in getOrCreate SparkContext(conf=conf or SparkConf()) File "/opt/spark/python/pyspark/context.py", line 115, in __init__ conf, jsc, profiler_cls) File "/opt/spark/python/pyspark/context.py", line 174, in _do_init self._accumulatorServer = accumulators._start_update_server() File "/opt/spark/python/pyspark/accumulators.py", line 259, in _start_update_server server = AccumulatorServer(("localhost", 0), _UpdateRequestHandler) File "/usr/lib64/python2.6/SocketServer.py", line 412, in __init__ self.server_bind() File "/usr/lib64/python2.6/SocketServer.py", line 423, in server_bind self.socket.bind(self.server_address) File "<string>", line 1, in bindsocket.gaierror: [Errno -3] Temporary failure in name resolution>>> num = sc.parallelize([1,2,3,4])Traceback (most recent call last): File "<stdin>", line 1, in <module>NameError: name 'sc' is not defined</span>
刚开始无从下手,找不到错误的原因,过了一天之后再去看这个问题的时候,仔细一看是socket 即通信的问题,于是谷歌搜索了一番,终于知道原因了:
原因:
ssh 不能登录localhost 使用 ssh localhost 也报同样的错误说明免密码登录不能登录自己
这是因为我在配置hadoop集群时直接清除了/etc/hosts文件里的内容,所以在这里致使ssh localhost 不通
解决办法:
在/etc/hosts文件中加入以下内容:
<span style="font-size:14px;">localhost localhost4.localdomain4127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4::1 localhost localhost.localdomain localhost6 localhost6.localdomain6</span>
0 0
- Spark集群启动python shell错误: Could not resolve hostname localhost: Temporary failure
- ssh: Could not resolve hostname you: Temporary failure in name resolution
- SVN: Could not resolve hostname
- ssh: Could not resolve hostname
- ssh: Could not resolve hostname
- hadoop: Could not resolve hostname ***
- ssh: Could not resolve hostname ...
- 启动hadoop时报错Could not resolve hostname
- SVN: Could not resolve hostname 解决方法_
- Hadoop:could not resolve hostname[xxxx]
- hadoop启动时,报ssh: Could not resolve hostname xxx: Name or service not known
- yum安装软件报错:curl#6 - "Could not resolve host: mirrorlist.centos.org; Temporary failure in name resolut
- Hadoop之——Could not resolve hostname XX错误解决办法
- spring boot 启动错误:Could not resolve placeholder
- 项目启动一直报Could not resolve placeholder错误
- Could not resolve hostname 。。。。。。: Name or service not known
- 错误:ssh:could not resolve ....
- 配置hadoop2.2.0的时候出现错误:could not resolve hostname HotSpot(TM): Name or service not know
- 文件压缩
- BZOJ1731: [Usaco2005 dec]Layout 排队布局 差分约束 spfa
- 安卓二级缓存
- navicat for mysql的下载、安装与基本使用
- 多线程知识3-线程间通信
- Spark集群启动python shell错误: Could not resolve hostname localhost: Temporary failure
- 相关事件
- poj 1753 Flip Game
- poj 3368 Frequent values (RMQ或线段树)
- 多种CSMA策略的比较
- lua源码的研究入门之makefile
- iOS 常用的第三方库
- Label--自定义可调整内边距的Label
- 《GeekBand》c++面向对象高级编程02