我正在尝试将我的项目与Sails.js连接到Redis,但是当我尝试解除它时,我有一个READONLY错误,
整个错误是下一个:
error: A hook ('orm') failed to load!
error: Error: READONLY You can't write against a read only slave.
at HiredisReplyParser.execute (/home/victor/Downloads/gestamp-desarrollo/gestamp-desarrollo/node_modules/redis/lib/parser/hiredis.js:30:33)
at RedisClient.on_data (/home/victor/Downloads/gestamp-desarrollo/gestamp-desarrollo/node_modules/redis/index.js:547:27)
at Socket.<anonymous> (/home/victor/Downloads/gestamp-desarrollo/gestamp-desarrollo/node_modules/redis/index.js:102:14)
at Socket.EventEmitter.emit (events.js:95:17)
at Socket.<anonymous> (_stream_readable.js:746:14)
at Socket.EventEmitter.emit (events.js:92:17)
at emitReadable_ (_stream_readable.js:408:10)
at emitReadable (_stream_readable.js:404:5)
at readableAddChunk (_stream_readable.js:165:9)
at Socket.Readable.push (_stream_readable.js:127:10)
at TCP.onread (net.js:526:21) [Error: READONLY You can't write against a read only slave.]
error: Error: READONLY You can't write against a read only slave.
at HiredisReplyParser.execute (/home/victor/Downloads/gestamp-desarrollo/gestamp-desarrollo/node_modules/redis/lib/parser/hiredis.js:30:33)
at RedisClient.on_data (/home/victor/Downloads/gestamp-desarrollo/gestamp-desarrollo/node_modules/redis/index.js:547:27)
at Socket.<anonymous> (/home/victor/Downloads/gestamp-desarrollo/gestamp-desarrollo/node_modules/redis/index.js:102:14)
at Socket.EventEmitter.emit (events.js:95:17)
at Socket.<anonymous> (_stream_readable.js:746:14)
at Socket.EventEmitter.emit (events.js:92:17)
at emitReadable_ (_stream_readable.js:408:10)
at emitReadable (_stream_readable.js:404:5)
at readableAddChunk (_stream_readable.js:165:9)
at Socket.Readable.push (_stream_readable.js:127:10)
at TCP.onread (net.js:526:21) [Error: READONLY You can't write against a read only slave.]
Sails.js版本为0.10.5
我的connections.js是
redis: {
adapter: 'sails-redis',
port: 6379,
host: '10.250.201.3',
// host: 'localhost',
password: null,
database: 2,
options: {
// low-level configuration
// (redis driver options)
parser: 'hiredis',
return_buffers: false,
detect_buffers: false,
socket_nodelay: true,
no_ready_check: false,
enable_offline_queue: true
}
},
我的模特是:
module.exports = {
schema: false,
connection: 'redis'
};