Giter VIP home page Giter VIP logo

Comments (2)

yfgu avatar yfgu commented on July 17, 2024

修改文件lib/abtesting/utils/redis.lua的代码(_M.connectdb = function(self)里面),下面123456是redis的密码:
--if ok then return red:select(dbid) end
if ok then
red:auth('123456')
end

from abtestinggateway.

yfgu avatar yfgu commented on July 17, 2024

(1)设置redis的密码
A.utils/conf/redis.conf:
requirepass 123456
B.重启redis:
/usr/local/bin/redis-server {项目目录}/utils/conf/redis.conf
(2)修改代码
A.utils/conf/default.conf, utils/conf/vhost.conf等
set $redis_pass 123456;
B.lib/abtesting/utils/init.lua
_M.redisConf下增加:
["pass"] = ngx.var.redis_pass
C.lib/abtesting/utils/redis.lua
a. _M.new下增加:
self.pass = conf.pass

b. _M.connectdb下增加:
local pass = self.pass

c. _M.connectdb下修改:
--if ok then return red:select(dbid) end
if ok then
red:auth(pass)
return red:select(dbid)
end

from abtestinggateway.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.