1. 程式人生 > >Spark叢集啟動python shell錯誤: Could not resolve hostname localhost: Temporary failure

Spark叢集啟動python shell錯誤: Could not resolve hostname localhost: Temporary failure

Hadoop叢集部署參考:點選檢視

Spark叢集部署參考:點選檢視

最近在自己搭建的平臺上測試spark-python指令碼,發現一個錯誤如下:

<span style="font-size:14px;">[[email protected] 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 linux2
Type "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 applicable
Traceback (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 bind
socket.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.localdomain4
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6</span>
再次啟動pysaprk 或者執行 py檔案就可以了

相關推薦

Spark叢集啟動python shell錯誤 Could not resolve hostname localhost: Temporary failure

Hadoop叢集部署參考:點選檢視 Spark叢集部署參考:點選檢視 最近在自己搭建的平臺上測試spark-python指令碼,發現一個錯誤如下: <span style="font-size:14px;">[[email protected] spa

ssh: Could not resolve hostname you: Temporary failure in name resolution

今天在 start-all.sh 啟動 Hadoop 時出現了很多這樣的異常資訊:  “ssh: Could not resolve hostname you: Temporary failure in name resolution” 解決辦法:在 /etc/prof

ssh: Could not resolve hostname host: Temporary failure in name resolution

ssh: Could not resolve hostname host: Temporary failure in name resolution 無法解析域名,即DNS解析配置出現問題。可以對/e

啟動錯誤Could not resolve placeholder 'spring.datasource.url' in value "${spring.datasource.url}"

專案啟動報錯:Could not resolve placeholder 'spring.datasource.url' in value "${spring.datasource.url}"專案在配置更改後要對maven進行clean,install的操作,清除以重新編譯專

hadoop啟動報錯localhost: ssh: Could not resolve hostname localhost

hadoop啟動journalnode時報錯:localhost: ssh: Could not resolve hostname localhost: Temporary failure in name resolution 解決辦法:將高亮部分補充到/etc/profile中,然後source生效 ex

Eclipse使用Maven建立Web時錯誤Could not resolve archetype org.apache.maven.archetypes:maven-archetype-webap

     如圖:接下來在使用剛新增的catalog建立web工程          這個時候就可以看到Eclipse聯網下載了:     這個時候看一下是不是建立成功了如果還是不能建立或者問題沒有解決可以安裝下面的方法:1.刪除maven已經下載的檔案路徑:.m2\repository\org\apache\

git提示錯誤關於錯誤:ssh: Could not resolve hostname github.com: Name or service not known.fatal: Could not read from remote repository.

eight 無法讀取 主機名 github上 錯誤2 winsock nal file drive 關於 Git 使用中出現的錯誤 饑人谷_楠柒 關註 2016.11.02 15:33* 字數 746 閱讀 3607評論 5喜歡 10贊賞 1 關

Redis在windows下的安裝啟動(解決一個錯誤Could not get a resource from the pool)

由於專案需要,最近在將專案的每個模組改變成一個單獨的服務來進行部署,但是服務寫完之後,在啟動時報了一個錯誤:Could not get a resource from the pool,如下圖所示: 由以上資訊並查閱資料後明白可能是redis沒有啟動,但是公司

【SpringBoot】整合JPA啟動基於JPA的單元測試方法報如下錯誤could not initialize proxy

出現該錯誤,分析了一下原因:基於JPA的實現來說,在進行資料庫訪問的時候,針對資料庫的訪問與操作session已經關閉釋放了。 百度了一下,網上有如下解決方案: 第一種方案:在@OneToMany的引數中使用fetch=FetchType=Eager 未涉及到該註解的使

解決apache啟動錯誤Could not reliably determine the server's fully qualified domain name

原文地址:http://www.2cto.com/os/201201/117797.html 啟動apache遇到錯誤:httpd: Could not reliably determine the server's fully qualified domain name

python安裝opencv出現如下錯誤Could not find a version that satisfies the requirement cv2 (from versions: )

如題所示在python中安裝cv2庫是提示不能找到滿足需要的版本,我的環境配置是:pycharm+anaconda3,對應的python版本是python3.6,之前想著在pycharm中直接安裝的,即開啟專案對應的直譯器設定模組,然後安裝,但是發現安裝失敗,最後轉至用命令安

Spring @Value("$XXX")注入值失敗,錯誤資訊提示Could not resolve placeholder佔位符不能被解析

問題原因: Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'wx.app.config.appid' in string value "${wx.app.config

註解配置實體類出現錯誤Could not determine type for: java.util.Set, at table

org.hibernate.MappingException: Could not determine type for: java.util.Set, at table: bs_merchant, for columns: [org.hibernate.mapping.Co

qt程式編譯錯誤could not exec ‘/usr/lib/x86_64-linux-gnu/qt4/bin/qmake’

linux下安裝Qt5.7後新增qmake環境變數後出現錯誤 執行: qmake -v 出現錯誤:qmake: could not exec ‘/usr/lib/x86_64-linux-gnu/qt4/bin/qmake’: No such file or directory 分析: qtch

Could not find a version that satisfies the requirement flask pip安裝python包出錯Could not find a version that satisfies the requirement skimage (from ver

使用命令安裝flask,出現報錯 百度找到解決方法https://www.cnblogs.com/lijinze-tsinghua/p/8666558.html 參考修改成pip install flask -i http://pypi.douban.com/simple/ --trusted-hos

錯誤Could not load requested class:com.microsoft.sqlserver.jdbc.SQLServerDriver

在使用hibernate對映實體類到資料庫時,本地安裝的資料庫是sqlserver2014,在執行ExportDB時,出現錯誤: Could not load requested class:com.microsoft.sqlserver.jdbc.SQLServerD

解決myeclipse錯誤Could not create the view: An unexpected exception was thrown.

報錯資訊如下: at com.genuitec.eclipse.ast.deploy.core.DeploymentManager.loadFromPreferences(Unknown Source) at com.genuitec.ec

Android Studio提示模擬器錯誤Could not initialize OpenglES emulation, use '-gpu off' to disable it.

安裝之後,開啟模擬器遇到以下錯誤提示 :並且有一些對應的文字提醒,上網搜尋了很久,有各種各樣的問題,但都不是同一個問題,有的還把英文搞反的。       在冷靜下來之後,把每一個比較關鍵的錯誤提醒都拿去

ionic3 打包錯誤解決Could not resolve all files for configuration ':classpath'.

失敗 時報 過程 目錄 b- 報錯 res 升級 () 問題:IONIC打包時報錯,ionic cordova build android --debug 將下面目錄文件的 mavenCentral()、jcenter() platforms/a