Nacos 客户端初始化说明
public final static String ENDPOINT = "endpoint"; public final static String NAMESPACE = "namespace"; public final static String ACCESS_KEY = "accessKey"; public final static String SECRET_KEY = "secretKey"; public final static String SERVER_ADDR = "serverAddr"; public final static String CONTEXT_PATH = "contextPath"; public final static String CLUSTER_NAME = "clusterName"; public final static String ENCODE = "encode";
一、客户端可以通过两种方式初始化(二选一,必传)
通过直接传入Nacos server端信息(ip
SERVER_ADDR server地址,格式为“ip1:port,ip2.port”
通过接入点进行接入获取环境信息
ENDPOINT 接入点CLUSTER_NAME 集群名字
二、链接的server的路径(非必传)
CONTEXT_PATH server根路径 (默认值 nacos)
三、区域隔离(非必传)
NAMESPACE 名称区域
四、鉴权参数(非必传)
ACCESS_KEY 公钥SECRET_KEY 私钥