使用 spark
將 dataFrame
儲存到 elasticsearch
出現以下報錯:node
Caused by: org.elasticsearch.hadoop.EsHadoopException: Could not write all entries [1/1] (Maybe ES was overloaded?). Error sample (first [1] error messages): rejected execution of org.elasticsearch.transport.TransportService$4@7d5f91de on EsThreadPoolExecutor[bulk, queue capacity = 50, org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor@3447703a[Running, pool size = 32, active threads = 32, queued tasks = 68, completed tasks = 9151096]] Bailing out...
這個沒法查到定位到報錯位置,因此在新建 spark
的時候進行以下配置:app
val masterUrl = "local" val appName = "ttyb" val sparkConf = new SparkConf() .setMaster(masterUrl) .setAppName(appName) .set("es.nodes", "172.16.14.21") .set("es.port", "9200") //Bailing out...錯誤 .set("es.batch.size.entries", "1") //插入失敗後無限重複插數據 .set("es.batch.write.retry.count", "-1") //查數據等待時間 .set("es.batch.write.retry.wait", "100") val Spark = SparkSession.builder().config(sparkConf).getOrCreate()
獲得新的錯誤:elasticsearch
org.elasticsearch.hadoop.rest.EsHadoopInvalidRequest: null
報錯顯示:oop
ES
負載太高,須要從新修復ui
本想重啓 ES
,發現是機器 磁盤空間已滿
,查錯成功spa