How to use the [Password Provider] in druid0.10.0?

Hi:
i don’t want to show my mysql userpasword in common.runtime.properties , i find the new version 0.10.0 has the Password Provider function, but no examples.

druid.metadata.storage.connector.password
The password provider or String password used to connect with.
none

Password Provider

Environment variable password provider provides password by looking at specified environment variable. Use this in order to avoid specifying password in runtime.properties file. e.g

   {
    "type": "environment",
    "variable": "METADATA_STORAGE_PASSWORD"
   }

The values are described below.

Field
Type
Description
Required
type
String
password provider type
Yes: environment
variable
String
environment variable to read password from
Yes

could someone help me and give a example? Thanks

You need to first to include the following config in the runtime properties file

druid.metadata.storage.connector.password={ “type”: “environment”,“variable”: "METADATA_STORAGE_PASSWORD”}

Then make sure to export an environment variable called METADATA_STORAGE_PASSWORD in this example that has the password.

For instance you can add this to your start command:

export METADATA_STORAGE_PASSWORD=YOUR_PASSWORD; start_druid_command….

@Slim Bouguerra

yes, thanks a lot

在 2017年6月23日星期五 UTC+8上午10:29:15,Slim Bouguerra写道: