第一個問題
Dstream checkpointing has been enabled but the Dstreams with their functions are not serializable
原因是創建JSSC的函數 使用到 set參數,不能使用原生的 map.keyset因爲不支持序列化
通過spark消費kafka 並且元數據通過checkpoint保存
Function0<JavaStreamingContext> createContextFunc= () -> createContext(conf);
JavaStreamingContext jssc = CommonUtil.getJavaStreamingContext(
ConfigurationManager.getProperty("spark.CheckPointPath"), createContextFunc);
問題是 創建函數裏用到了通過讀取redis保存的topic-partition map信息 直接使用的map.keyset 但是map.keyset是不可序列化的
解決辦法
new HashSet<>(map.keyset())
第二個問題
org.apache.hadoop.nativeio.NativeIO$windows.createFilewithMode0
解決
解決方案 移除 hadoop.dll
參考: