Compare commits
No commits in common. "7907e3fe85f388f48360823c99923a9c8e374cea" and "03dd49e3a9c937a5b07cae2b60e300068ad913e6" have entirely different histories.
7907e3fe85
...
03dd49e3a9
|
@ -92,12 +92,6 @@ class Config {
|
|||
'bad config: sentinel port must be a number');
|
||||
this.redis.sentinels.push({ host, port });
|
||||
});
|
||||
if (config.redis.sentinelPassword !== undefined) {
|
||||
assert(typeof config.redis.sentinelPassword === 'string',
|
||||
'bad config: redis.sentinelPassword must be a string');
|
||||
this.redis.sentinelPassword =
|
||||
config.redis.sentinelPassword;
|
||||
}
|
||||
} else {
|
||||
// check for standalone configuration
|
||||
assert(typeof config.redis.host === 'string',
|
||||
|
|
|
@ -22,7 +22,6 @@ class UtapiReindex {
|
|||
host: '127.0.0.1',
|
||||
port: 16379,
|
||||
name: 'scality-s3',
|
||||
sentinelPassword: '',
|
||||
};
|
||||
this._bucketd = {
|
||||
host: '127.0.0.1',
|
||||
|
@ -37,12 +36,10 @@ class UtapiReindex {
|
|||
this._schedule = config.schedule;
|
||||
}
|
||||
if (config && config.sentinel) {
|
||||
const { host, port, name, sentinelPassword } = config.sentinel;
|
||||
const { host, port, name } = config.sentinel;
|
||||
this._sentinel.host = host || this._sentinel.host;
|
||||
this._sentinel.port = port || this._sentinel.port;
|
||||
this._sentinel.name = name || this._sentinel.name;
|
||||
this._sentinel.sentinelPassword =
|
||||
sentinelPassword || this._sentinel.sentinelPassword;
|
||||
}
|
||||
if (config && config.bucketd) {
|
||||
const { host, port } = config.bucketd;
|
||||
|
@ -64,7 +61,6 @@ class UtapiReindex {
|
|||
port: this._sentinel.port,
|
||||
}],
|
||||
name: this._sentinel.name,
|
||||
sentinelPassword: this._sentinel.sentinelPassword,
|
||||
}, this._log);
|
||||
}
|
||||
|
||||
|
@ -82,7 +78,6 @@ class UtapiReindex {
|
|||
this._sentinel.host,
|
||||
this._sentinel.port,
|
||||
this._sentinel.name,
|
||||
this._sentinel.sentinelPassword,
|
||||
this._bucketd.host,
|
||||
this._bucketd.port,
|
||||
]);
|
||||
|
|
|
@ -10,13 +10,12 @@ import sys
|
|||
from threading import Thread
|
||||
from concurrent.futures import ThreadPoolExecutor
|
||||
|
||||
if len(sys.argv) == 7:
|
||||
if len(sys.argv) == 6:
|
||||
ip = sys.argv[1]
|
||||
port = sys.argv[2]
|
||||
sentinel_cluster_name = sys.argv[3]
|
||||
sentinel_password = sys.argv[4]
|
||||
bucketd_host = sys.argv[5]
|
||||
bucketd_port = sys.argv[6]
|
||||
bucketd_host = sys.argv[4]
|
||||
bucketd_port = sys.argv[5]
|
||||
print("Sentinel IP used: %s" % ip)
|
||||
print("Sentinel port used: %s" % port)
|
||||
print("Sentinel cluster name used: %s" % sentinel_cluster_name)
|
||||
|
@ -26,7 +25,6 @@ else:
|
|||
ip = "127.0.0.1"
|
||||
port = "16379"
|
||||
sentinel_cluster_name = "scality-s3"
|
||||
sentinel_password = ''
|
||||
bucketd_host = "127.0.0.1"
|
||||
bucketd_port = "9000"
|
||||
|
||||
|
@ -39,7 +37,7 @@ class askRedis():
|
|||
|
||||
def __init__(self, ip="127.0.0.1", port="16379", sentinel_cluster_name="scality-s3"):
|
||||
|
||||
r = redis.Redis(host=ip, port=port, db=0, password=sentinel_password)
|
||||
r = redis.Redis(host=ip, port=port, db=0)
|
||||
self._ip, self._port = r.sentinel_get_master_addr_by_name(sentinel_cluster_name)
|
||||
|
||||
def read(self, resource, name):
|
||||
|
|
|
@ -10,13 +10,12 @@ import sys
|
|||
from threading import Thread
|
||||
from concurrent.futures import ThreadPoolExecutor
|
||||
|
||||
if len(sys.argv) == 7:
|
||||
if len(sys.argv) == 6:
|
||||
ip = sys.argv[1]
|
||||
port = sys.argv[2]
|
||||
sentinel_cluster_name = sys.argv[3]
|
||||
sentinel_password = sys.argv[4]
|
||||
bucketd_host = sys.argv[5]
|
||||
bucketd_port = sys.argv[6]
|
||||
bucketd_host = sys.argv[4]
|
||||
bucketd_port = sys.argv[5]
|
||||
print("Sentinel IP used: %s" % ip)
|
||||
print("Sentinel port used: %s" % port)
|
||||
print("Sentinel cluster name used: %s" % sentinel_cluster_name)
|
||||
|
@ -26,7 +25,6 @@ else:
|
|||
ip = "127.0.0.1"
|
||||
port = "16379"
|
||||
sentinel_cluster_name = "scality-s3"
|
||||
sentinel_password = ''
|
||||
bucketd_host = "127.0.0.1"
|
||||
bucketd_port = "9000"
|
||||
|
||||
|
@ -39,7 +37,7 @@ class updateRedis():
|
|||
|
||||
def __init__(self, ip="127.0.0.1", port="16379", sentinel_cluster_name="scality-s3"):
|
||||
|
||||
r = redis.Redis(host=ip, port=port, db=0, password=sentinel_password)
|
||||
r = redis.Redis(host=ip, port=port, db=0)
|
||||
self._ip, self._port = r.sentinel_get_master_addr_by_name(sentinel_cluster_name)
|
||||
|
||||
def read(self, resource, name):
|
||||
|
|
|
@ -6,7 +6,6 @@ const Redis = require('ioredis');
|
|||
* @param {string} config.host - redis host
|
||||
* @param {number} config.port - redis port
|
||||
* @param {string} [config.password] - redis password (optional)
|
||||
* @param {string} [config.sentinelPassword] - sentinel password (optional)
|
||||
* @param {Werelogs.Logger} log - Werelogs logger
|
||||
* @return {Redis} - Redis client instance
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue