2

When tried to launch the Spark history server (from my SPARK_HOME/sbin) using Powershell terminal

.\start-history-server.sh 

Getting the windows terminal launched with below message and then closes.

ps: unknown option -- o
Try `ps --help' for more information.
starting org.apache.spark.deploy.history.HistoryServer, logging to C:\Spark/logs/spark--org.apache.spark.deploy.history.HistoryServer-1-<my-machine>.out
ps: unknown option -- o
Try `ps --help' for more information.
ps: unknown option -- o
Try `ps --help' for more information.
ps: unknown option -- o
Try `ps --help' for more information.
ps: unknown option -- o
Try `ps --help' for more information.

Here is output in the spark--org.apache.spark.deploy.history.HistoryServer-1-<my-machine>.out generated in the 'C:\Spark\logs'

Spark Command: C:\Program Files (x86)\Java\jre1.8.0_161\bin\java -cp C:\Spark/conf\;C:\Spark\jars\* -Xmx1g org.apache.spark.deploy.history.HistoryServer C:\Spark\logs
========================================
"C:\Program Files (x86)\Java\jre1.8.0_161\bin\java" -cp "C:\Spark/conf\;C:\Spark\jars\*" -Xmx1g org.apache.spark.deploy.history.HistoryServer C:\Spark\logs 
C:\Spark/bin/spark-class: line 96: CMD: bad array subscript

What I have already tried:

Updated 'spark-defaults.conf' as below:

spark.eventLog.enabled           true
spark.eventLog.dir               file:///C:\Spark\logs
spark.history.fs.logDirectory    file:///C:\Spark\logs

[Also following the discussion here] (cannot start spark history server) i have tried running the below command (from the SPARK_HOME/sbin )

spark-class org.apache.spark.deploy.history.HistoryServer

But it results in the FileNotFound exception as below: (which is strange because somehow it is trying to look for C:Sparklogs instead of C:\Spark\logs )

PS C:\Spark\sbin> spark-class org.apache.spark.deploy.history.HistoryServer                                                                                                                  Using Spark's default log4j profile: org/apache/spark/log4j-defaults.properties
20/08/26 12:18:03 INFO HistoryServer: Started daemon with process name: 24364@<my-machine>
20/08/26 12:18:03 WARN NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
20/08/26 12:18:03 INFO SecurityManager: Changing view acls to: <USER>
20/08/26 12:18:03 INFO SecurityManager: Changing modify acls to: <USER>
20/08/26 12:18:03 INFO SecurityManager: Changing view acls groups to:
20/08/26 12:18:03 INFO SecurityManager: Changing modify acls groups to:
20/08/26 12:18:03 INFO SecurityManager: SecurityManager: authentication disabled; ui acls disabled; users  with view permissions: Set(<USER>); groups with view permissions: Set(); users  with modify permissions: Set(<USER>); groups with modify permissions: Set()
20/08/26 12:18:04 INFO FsHistoryProvider: History server ui acls disabled; users with admin permissions: ; groups with admin permissions
20/08/26 12:18:05 INFO Utils: Successfully started service on port 18080.
20/08/26 12:18:05 INFO HistoryServer: Bound HistoryServer to 0.0.0.0, and started at http://my-machine:18080
Exception in thread "main" java.io.FileNotFoundException: Log directory specified does not exist: file:///C:Sparklogs
        at org.apache.spark.deploy.history.FsHistoryProvider.startPolling(FsHistoryProvider.scala:279)
        at org.apache.spark.deploy.history.FsHistoryProvider.initialize(FsHistoryProvider.scala:227)
        at org.apache.spark.deploy.history.FsHistoryProvider.start(FsHistoryProvider.scala:409)
        at org.apache.spark.deploy.history.HistoryServer$.main(HistoryServer.scala:303)
        at org.apache.spark.deploy.history.HistoryServer.main(HistoryServer.scala)
Caused by: java.io.FileNotFoundException: File file:/C:Sparklogs does not exist
        at org.apache.hadoop.fs.RawLocalFileSystem.deprecatedGetFileStatus(RawLocalFileSystem.java:611)
        at org.apache.hadoop.fs.RawLocalFileSystem.getFileLinkStatusInternal(RawLocalFileSystem.java:824)
        at org.apache.hadoop.fs.RawLocalFileSystem.getFileStatus(RawLocalFileSystem.java:601)
        at org.apache.hadoop.fs.FilterFileSystem.getFileStatus(FilterFileSystem.java:428)
        at org.apache.spark.deploy.history.FsHistoryProvider.startPolling(FsHistoryProvider.scala:269)
    

Can any one suggest what else I could try here to fix the issue and launch the Spark History server ?

Thank you.

Mathias R. Jessen
  • 157,619
  • 12
  • 148
  • 206
Vizag
  • 375
  • 2
  • 6
  • 22
  • Those are `sh` files and windows need cmd files. Even you cannot run correctly the `spark-shell.sh`, I think. – Lamanus Aug 26 '20 at 12:16

1 Answers1

3

Update: This following worked:

  1. Updated my logs 'spark.eventLog.dir' and 'spark.history.fs.logDirectory' to : 'file:///C:/Spark/eventlog'
  2. Executed Spark-class org.apache.spark.deploy.history.HistoryServer from SPARKHOME/sbin
  3. Now could access the history server Web ui from here: http://localhost:18080
Vizag
  • 375
  • 2
  • 6
  • 22