I have a question regarding to Elasticsearch. I use Search Guard as transport layer security and when I want to read data from elasticsearch I have to give username and password. Just like this:
import org.apache.spark.{SparkConf, SparkContext}
import org.elasticsearch.spark._
object ReadDataFromES {
def main(args: Array[String]) {
val conf = new SparkConf()
.setAppName("SampleESApp")
.set("es.index.auto.create", "true")
.set("es.nodes", "localhost:9200")
.set("es.net.http.auth.user", "elastic_user")
.set("es.net.http.auth.pass", "elastic_password")
val sc = new SparkContext(conf)
print("Reading data \n\n\n")
val RDD = sc.esRDD("bank/account")
println(RDD.first())
println("\n\n")
/*
print("Writing data \n\n\n")
RDD.saveToEs("bank/spark")
*/
}
}
But the problem is that I don't want to have password (value of es.net.http.auth.pass parameter) as plain text in my code. Does anyone know a way to hash this password?