मुझे redis auth का उपयोग करने के लिए redis node.js दस्तावेज़ नहीं मिलता है।नोड.जेएस और रेडिस ऑथ
उदाहरण प्रति:
var redis = require("redis"),
client = redis.createClient();
// This command is magical. Client stashes the password and will issue on every connect.
client.auth("somepass");
मेरी कोड में मैं निम्नलिखित है:
var redis = require("redis");
r = redis.createClient(6379,'xxx.xxx.xxx.xxx');
r.auth("yyyyyyyy");
app.get('/', function(req, res){
r.set("foo", 'bar');
res.writeHead(200, {'Content-Type': 'image/gif'});
res.end('Hello');
});
यहाँ त्रुटि है मैं:
Express server listening on port 8070 in development mode
/home/ubuntu/workspace/rtbopsConfig/rtbServers/rtbNodejsServer/node_modules/redis/index.js:468
throw callback_err;
^
Error: Auth error: Error: ERR Client sent AUTH, but no password is set
at Command.callback (/home/ubuntu/workspace/rtbopsConfig/rtbServers/rtbNodejsServer/node_modules/redis/index.js:163:43)
at RedisClient.return_error (/home/ubuntu/workspace/rtbopsConfig/rtbServers/rtbNodejsServer/node_modules/redis/index.js:464:25)
at HiredisReplyParser.<anonymous> (/home/ubuntu/workspace/rtbopsConfig/rtbServers/rtbNodejsServer/node_modules/redis/index.js:253:14)
at HiredisReplyParser.emit (events.js:67:17)
at HiredisReplyParser.execute (/home/ubuntu/workspace/rtbopsConfig/rtbServers/rtbNodejsServer/node_modules/redis/lib/parser/hiredis.js:41:18)
at RedisClient.on_data (/home/ubuntu/workspace/rtbopsConfig/rtbServers/rtbNodejsServer/node_modules/redis/index.js:440:27)
at Socket.<anonymous> (/home/ubuntu/workspace/rtbopsConfig/rtbServers/rtbNodejsServer/node_modules/redis/index.js:70:14)
at Socket.emit (events.js:67:17)
at TCP.onread (net.js:367:14)
[7]+ Killed node app.js 8070
So, what is the proper way to auth?
EADDRINUSE एक http चीज है - क्या आप वाकई लालसा के साथ एक समस्या है जो आपके सर्वर को स्थापित करने के साथ नहीं है? – ControlAltDel
मैंने त्रुटि संदेश – Tampa
अपडेट किया था, मुझे एक ही समस्या थी, मैंने पाया कि मैंने पासवर्ड की आवश्यकता के लिए किसी अन्य सर्वर पर कॉन्फ़िगरेशन संपादित किया था और सर्वर जो मैं अपने स्टेजिंग सर्वर पर चला रहा था उसमें 'requpass $ uP3rs3cretpassW0rd' नहीं था ... लंगड़ा! लेकिन सब कुछ अब काम करता है। – nak