Package org.apache.solr.common.cloud
Class VMParamsZkCredentialsInjector
- java.lang.Object
-
- org.apache.solr.common.cloud.VMParamsZkCredentialsInjector
-
- All Implemented Interfaces:
ZkCredentialsInjector
public class VMParamsZkCredentialsInjector extends Object implements ZkCredentialsInjector
Reads credentials from System Properties and injects them intoDigestZkCredentialsProvider
&DigestZkACLProvider
Usage:-DzkCredentialsInjector=org.apache.solr.common.cloud.VMParamsZkCredentialsInjector \ -DzkDigestUsername=admin-user -DzkDigestPassword=CHANGEME-ADMIN-PASSWORD \ -DzkDigestReadonlyUsername=readonly-user -DzkDigestReadonlyPassword=CHANGEME-READONLY-PASSWORD
Or from a Java property file:-DzkCredentialsInjector=org.apache.solr.common.cloud.VMParamsZkCredentialsInjector \ -DzkDigestCredentialsFile=SOLR_HOME_DIR/server/etc/zookeepercredentials.properties
Example of a Java property file:zkDigestUsername=admin-user zkDigestPassword=CHANGEME-ADMIN-PASSWORD zkDigestReadonlyUsername=readonly-user zkDigestReadonlyPassword=CHANGEME-READONLY-PASSWORD
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.solr.common.cloud.ZkCredentialsInjector
ZkCredentialsInjector.ZkCredential
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_DIGEST_FILE_VM_PARAM_NAME
static String
DEFAULT_DIGEST_PASSWORD_VM_PARAM_NAME
static String
DEFAULT_DIGEST_READONLY_PASSWORD_VM_PARAM_NAME
static String
DEFAULT_DIGEST_READONLY_USERNAME_VM_PARAM_NAME
static String
DEFAULT_DIGEST_USERNAME_VM_PARAM_NAME
-
Constructor Summary
Constructors Constructor Description VMParamsZkCredentialsInjector()
VMParamsZkCredentialsInjector(String zkDigestAllUsernameVMParamName, String zkDigestAllPasswordVMParamName, String zkDigestReadonlyUsernameVMParamName, String zkDigestReadonlyPasswordVMParamName)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description List<ZkCredentialsInjector.ZkCredential>
getZkCredentials()
static Properties
readCredentialsFile(String pathToFile)
-
-
-
Field Detail
-
DEFAULT_DIGEST_USERNAME_VM_PARAM_NAME
public static final String DEFAULT_DIGEST_USERNAME_VM_PARAM_NAME
- See Also:
- Constant Field Values
-
DEFAULT_DIGEST_PASSWORD_VM_PARAM_NAME
public static final String DEFAULT_DIGEST_PASSWORD_VM_PARAM_NAME
- See Also:
- Constant Field Values
-
DEFAULT_DIGEST_READONLY_USERNAME_VM_PARAM_NAME
public static final String DEFAULT_DIGEST_READONLY_USERNAME_VM_PARAM_NAME
- See Also:
- Constant Field Values
-
DEFAULT_DIGEST_READONLY_PASSWORD_VM_PARAM_NAME
public static final String DEFAULT_DIGEST_READONLY_PASSWORD_VM_PARAM_NAME
- See Also:
- Constant Field Values
-
DEFAULT_DIGEST_FILE_VM_PARAM_NAME
public static final String DEFAULT_DIGEST_FILE_VM_PARAM_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
readCredentialsFile
public static Properties readCredentialsFile(String pathToFile) throws org.apache.solr.common.SolrException
- Throws:
org.apache.solr.common.SolrException
-
getZkCredentials
public List<ZkCredentialsInjector.ZkCredential> getZkCredentials()
- Specified by:
getZkCredentials
in interfaceZkCredentialsInjector
- Returns:
- List of
ZkCredentialsInjector.ZkCredential
s representing Zookeeper credentials including the username, the password and the permissions (ALL or READ)
-
-