dubbo icon indicating copy to clipboard operation
dubbo copied to clipboard

Problems assign username/password when using redis as registry.

Open lisancheng opened this issue 8 years ago • 2 comments

dubbo2.5.8 用redis做注册中心时,设置密码时,为什么还需要设置用户名,不设置用户名报错 URL.class 类,public URL(String protocol, String username, String password, String host, int port, String path, Map<String, String> parameters) 方法 if ((username == null || username.length() == 0) && password != null && password.length() > 0) { throw new IllegalArgumentException("Invalid url, password without username!"); }

lisancheng avatar Jan 10 '18 08:01 lisancheng

dubbo目前只能支持无密码的redis

hanwangkun avatar Jan 11 '18 08:01 hanwangkun

有个取巧的办法,就是在配置文件中设置了密码,然后再设置一个用户名,只要用户名不为空就行;username="任意合法值"。 例: <dubbo:registry address="redis://xx.xx.212.27" password="xxxxx" port="6379" username="222"/>

lisancheng avatar Jan 11 '18 10:01 lisancheng