Я новичок в использовании Spark для приложений с большими данными.Почему-то кажется, что pyspark не подключается к Java?
из импорта pyspark SQLContext sqlContext = SQLContext (sc) ОШИБКА: py4j.java_gateway: при попытке подключения к серверу Java произошла ошибка (127.0.0.1:50383) Traceback(последний вызов был последним): Файл "C: \ Users \ CHESTER \ AppData \ Local \ Programs \ Python \ Python37-32 \ lib \ site-packages \ py4j \ java_gateway.py", строка 929, в _get_connection connection = self.deque.pop () IndexError: выскочить из пустой deque
Во время обработки вышеупомянутого исключения произошло другое исключение:
Traceback (most recent call last):
File "C:\Users\CHESTER\AppData\Local\Programs\Python\Python37-32\lib\site-packages\py4j\java_gateway.py", line 1067, in start
self.socket.connect((self.address, self.port))
ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it
Traceback (most recent call last):
File "C:\Users\CHESTER\AppData\Local\Programs\Python\Python37-32\lib\site-packages\py4j\java_gateway.py", line 929, in _get_connection
connection = self.deque.pop()
IndexError: pop from an empty deque
Во время обработкиВ вышеуказанном исключении произошло другое исключение:
Traceback (most recent call last):
File "C:\Users\CHESTER\AppData\Local\Programs\Python\Python37-32\lib\site-packages\py4j\java_gateway.py", line 1067, in start
self.socket.connect((self.address, self.port))
ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it
Во время обработки вышеуказанного исключения произошло другое исключение:
Traceback (most recent call last):
File "<pyshell#15>", line 1, in <module>
sqlContext = SQLContext(sc)
File "C:\Users\CHESTER\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pyspark\sql\context.py", line 77, in __init__
sparkSession = SparkSession.builder.getOrCreate()
File "C:\Users\CHESTER\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pyspark\sql\session.py", line 170, in getOrCreate
sparkConf = SparkConf()
File "C:\Users\CHESTER\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pyspark\conf.py", line 116, in __init__
self._jconf = _jvm.SparkConf(loadDefaults)
File "C:\Users\CHESTER\AppData\Local\Programs\Python\Python37-32\lib\site-packages\py4j\java_gateway.py", line 1649, in __getattr__
"\n" + proto.END_COMMAND_PART)
File "C:\Users\CHESTER\AppData\Local\Programs\Python\Python37-32\lib\site-packages\py4j\java_gateway.py", line 983, in send_command
connection = self._get_connection()
File "C:\Users\CHESTER\AppData\Local\Programs\Python\Python37-32\lib\site-packages\py4j\java_gateway.py", line 931, in _get_connection
connection = self._create_connection()
File "C:\Users\CHESTER\AppData\Local\Programs\Python\Python37-32\lib\site-packages\py4j\java_gateway.py", line 937, in _create_connection
connection.start()
File "C:\Users\CHESTER\AppData\Local\Programs\Python\Python37-32\lib\site-packages\py4j\java_gateway.py", line 1079, in start
raise Py4JNetworkError(msg, e)
py4j.protocol.Py4JNetworkError: An error occurred while trying to connect to the Java server (127.0.0.1:50383)