How to protect password and username in Spark (such as for JDBC connections/accessing RDBMS databases)?

前端 未结 2 1320
隐瞒了意图╮
隐瞒了意图╮ 2021-01-04 13:14

We have a use case where we need to export data from HDFS to a RDBMS. I saw this example . Here they have store the username and password in the code. Is there any way to hi

2条回答
  •  一个人的身影
    2021-01-04 13:49

    As you run the application from console using spark-submit, you can access it through Java API:

    Console console = System.console();
    char passwordArray[] = console.readPassword("Enter your secret password: ");
    account.setPassword(passwordArray);
    

提交回复
热议问题