美文网首页
CDH 升级pyspark带来的问题

CDH 升级pyspark带来的问题

作者: 只是甲 | 来源:发表于2021-06-11 14:11 被阅读0次

一.问题描述

最近在自学pyspark,想本地通过pycharm来编辑pyspark脚本,运行的时候,提示没有pyspark模块,于是通过pycharm安装了pyspark(最新版本)。

而且这个安装到了远程服务器上,真的坑

奈何我安装的是CDH 6.3.1版本,然后spark版本是 2.4.0-cdh6.3.1,然后最新版本是3.0.2的


image.png

新的pyspak程序,都未记录到 History Server服务上。


image.png

重新安装了pyspark 2.4.0版本,依旧未记录到 History Server服务上。

[root@hp1 software]# pyspark
Python 2.7.5 (default, Apr  2 2020, 13:16:51) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
2021-04-09 17:22:21 WARN  NativeCodeLoader:62 - Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Setting default log level to "WARN".
To adjust logging level use sc.setLogLevel(newLevel). For SparkR, use setLogLevel(newLevel).
Welcome to
      ____              __
     / __/__  ___ _____/ /__
    _\ \/ _ \/ _ `/ __/  '_/
   /__ / .__/\_,_/_/ /_/\_\   version 2.4.0
      /_/

Using Python version 2.7.5 (default, Apr  2 2020 13:16:51)
SparkSession available as 'spark'.
>>> 

二.解决方案

首先想到的问题是卸载spark,然后重新安装

2.1 删除spark

image.png image.png image.png

更改配置后重新先停止然后删除spark


image.png image.png

界面删除了spark,依旧可以运行pyspark

[root@hp2 ~]# pyspark
Python 2.7.5 (default, Apr  2 2020, 13:16:51) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Setting default log level to "WARN".
To adjust logging level use sc.setLogLevel(newLevel). For SparkR, use setLogLevel(newLevel).
Welcome to
      ____              __
     / __/__  ___ _____/ /__
    _\ \/ _ \/ _ `/ __/  '_/
   /__ / .__/\_,_/_/ /_/\_\   version 2.4.0-cdh6.3.1
      /_/

Using Python version 2.7.5 (default, Apr  2 2020 13:16:51)
SparkSession available as 'spark'.
>>> exit()

2.2 重启整个集群

image.png

2.3 重新添加spark服务

image.png image.png image.png

重启整个集群

相关文章

网友评论

      本文标题:CDH 升级pyspark带来的问题

      本文链接:https://www.haomeiwen.com/subject/rhhwkltx.html