6

在EMR我的星火計劃不斷收到此錯誤:在Apache Spark中。如何設置worker/executor的環境變量?

Caused by: javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated 
    at sun.security.ssl.SSLSessionImpl.getPeerCertificates(SSLSessionImpl.java:421) 
    at org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:128) 
    at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:397) 
    at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:148) 
    at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:149) 
    at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:121) 
    at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:573) 
    at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:425) 
    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820) 
    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:754) 
    at org.jets3t.service.impl.rest.httpclient.RestStorageService.performRequest(RestStorageService.java:334) 
    at org.jets3t.service.impl.rest.httpclient.RestStorageService.performRequest(RestStorageService.java:281) 
    at org.jets3t.service.impl.rest.httpclient.RestStorageService.performRestHead(RestStorageService.java:942) 
    at org.jets3t.service.impl.rest.httpclient.RestStorageService.getObjectImpl(RestStorageService.java:2148) 
    at org.jets3t.service.impl.rest.httpclient.RestStorageService.getObjectDetailsImpl(RestStorageService.java:2075) 
    at org.jets3t.service.StorageService.getObjectDetails(StorageService.java:1093) 
    at org.jets3t.service.StorageService.getObjectDetails(StorageService.java:548) 
    at org.apache.hadoop.fs.s3native.Jets3tNativeFileSystemStore.retrieveMetadata(Jets3tNativeFileSystemStore.java:172) 
    at sun.reflect.GeneratedMethodAccessor18.invoke(Unknown Source) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    at java.lang.reflect.Method.invoke(Method.java:606) 
    at org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:190) 
    at org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:103) 
    at org.apache.hadoop.fs.s3native.$Proxy8.retrieveMetadata(Unknown Source) 
    at org.apache.hadoop.fs.s3native.NativeS3FileSystem.getFileStatus(NativeS3FileSystem.java:414) 
    at org.apache.hadoop.fs.FileSystem.exists(FileSystem.java:1398) 
    at org.apache.hadoop.fs.s3native.NativeS3FileSystem.create(NativeS3FileSystem.java:341) 
    at org.apache.hadoop.fs.FileSystem.create(FileSystem.java:906) 
    at org.apache.hadoop.fs.FileSystem.create(FileSystem.java:887) 
    at org.apache.hadoop.fs.FileSystem.create(FileSystem.java:784) 

我做了一些研究,發現這個認證可以在低安全性的情況下被禁用,通過設置環境變量:

com.amazonaws.sdk.disableCertChecking=true 

但我只能使用spark-submit.sh --conf進行設置,它隻影響驅動程序,而大部分錯誤都在工作人員身上。

有沒有辦法將它們傳播給工人?

非常感謝。

回答

3

只是在一些在Spark documentation跌跌撞撞:

spark.executorEnv.[EnvironmentVariableName]

Add the environment variable specified by EnvironmentVariableName to the Executor process. The user can specify multiple of these to set multiple environment variables.

所以你的情況,我會星火配置選項spark.executorEnv.com.amazonaws.sdk.disableCertChecking設置爲true,看看有沒有什麼幫助。

+0

非常感謝!我剛剛在官方文檔中發現,不知道爲什麼它被忽略之前 – tribbloid 2015-04-20 00:10:21

+0

容易被忽視的選項。這節省了我一些頭痛,謝謝。 – 2016-09-15 01:57:42

+0

我需要同樣的東西,但在'工人'上:去看看是否可用.. – javadba 2017-06-04 18:05:20