/// <summary> /// <summary> /// 基于Redis集群的初始化 /// </summary> /// <param name="redisMasterHostsStr">设置Redis主机IP配置信息,多个逗号英文分隔</param> /// <param name="defaultdb">默认redis连接DB</param> public static void InitRedis(string redisMasterHostsStr, int defaultdb = 0) { instance = SERedisClient.Create().RedisConfigHost(redisMasterHostsStr).DefaultDB(defaultdb).BuildRedis(); }
/// <summary> /// <summary> /// 基于Redis集群的初始化 /// </summary> /// <param name="configurationStr">设置RedisSe的configuration连接</param> public static void InitRedisFullConn(string configurationStr) { instance = SERedisClient.Create().RedisConfiguration(configurationStr).BuildRedis(); }
/// <summary> /// <summary> /// 基于ZK的Codis初始化 /// </summary> /// <param name="zkhosts">ZK地址,多个以“,”分割</param> /// <param name="db_proxy">CodisProxy实例节点</param> /// <param name="defaultdb">默认redis连接DB</param> public static void Init(string zkhosts, string db_proxy, int defaultdb = 0) { instance = SERedisClient.Create().CuratorClient(zkhosts, 60).ZkProxyDir(db_proxy).DefaultDB(defaultdb).Build(); }