spark写数据到装有searchgard的ES集群

来源:互联网 发布:外贸crm软件 编辑:程序博客网 时间:2024/06/08 19:38
增加配置信息
val conf = new SparkConf()conf.setAppName("etl_data_to_es")
conf.set("es.net.ssl", "true")conf.set("es.net.ssl.truststore.location", "truststore.jks")conf.set("es.net.ssl.protocol", "TLSv1.2")conf.set("es.net.ssl.truststore.pass", "changeit")conf.set("es.net.http.auth.user", "admin")conf.set("es.net.http.auth.pass", "admin")conf.set("es.batch.size.entries", "4000")conf.set("es.batch.size.bytes", "4mb")conf.set("es.nodes.wan.only", "false")conf.set("es.internal.es.version","5.4.1")

添加资源

将truststore.jks文件放在项目的classpath目录下(resource文件夹中就行)

原创粉丝点击