Skip to content

I have two redis one master and one from use , how to Read and write separation use lua-resty-redis-connector  #29

@sixtool

Description

@sixtool
local rc = require("resty.redis.connector").new({
    connect_timeout = 100,
    keepalive_poolsize = 100
})
local hosts = {
    {host = "127.0.0.1", db = 7, role="master",port = 7379}, --master 
    {host = "127.0.0.1", db = 7, role="slave",port = 18379} --slave  it's not work 
}

local redis, err, previous_errors = rc:try_host(hosts)
redis:set("dog4","1")
ngx.say(cjson.encode(previous_errors)),      why previouse_errors is nil ???

I have two redis one master and one from use , how to Read and write separation use lua-resty-redis-connector

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions