storage: remove mongodb_replica_set option
This option is not needed as you can pass the option into the MongoDB URL. Change-Id: Ic549e7d0da6cdff5babaae58ff0b823122e00fbf
This commit is contained in:
parent
20a58df640
commit
829a33bf94
@ -34,11 +34,6 @@ OPTS = [
|
|||||||
default=-1,
|
default=-1,
|
||||||
help=("Number of seconds that alarm histories are kept "
|
help=("Number of seconds that alarm histories are kept "
|
||||||
"in the database for (<= 0 means forever).")),
|
"in the database for (<= 0 means forever).")),
|
||||||
cfg.StrOpt('mongodb_replica_set',
|
|
||||||
default=None,
|
|
||||||
help='The name of the replica set which is used to connect to '
|
|
||||||
'MongoDB database. If it is set, MongoReplicaSetClient '
|
|
||||||
'will be used instead of MongoClient.'),
|
|
||||||
cfg.StrOpt('alarm_connection',
|
cfg.StrOpt('alarm_connection',
|
||||||
secret=True,
|
secret=True,
|
||||||
default=None,
|
default=None,
|
||||||
|
@ -44,8 +44,7 @@ class Connection(pymongo_base.Connection):
|
|||||||
self.conn = self.CONNECTION_POOL.connect(
|
self.conn = self.CONNECTION_POOL.connect(
|
||||||
url,
|
url,
|
||||||
conf.database.max_retries,
|
conf.database.max_retries,
|
||||||
conf.database.retry_interval,
|
conf.database.retry_interval)
|
||||||
conf.database.mongodb_replica_set)
|
|
||||||
|
|
||||||
# Require MongoDB 2.4 to use $setOnInsert
|
# Require MongoDB 2.4 to use $setOnInsert
|
||||||
if self.conn.server_info()['versionArray'] < [2, 4]:
|
if self.conn.server_info()['versionArray'] < [2, 4]:
|
||||||
|
@ -59,7 +59,7 @@ class ConnectionPool(object):
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
self._pool = {}
|
self._pool = {}
|
||||||
|
|
||||||
def connect(self, url, max_retries, retry_interval, replica_set=None):
|
def connect(self, url, max_retries, retry_interval):
|
||||||
connection_options = pymongo.uri_parser.parse_uri(url)
|
connection_options = pymongo.uri_parser.parse_uri(url)
|
||||||
del connection_options['database']
|
del connection_options['database']
|
||||||
del connection_options['username']
|
del connection_options['username']
|
||||||
@ -77,9 +77,7 @@ class ConnectionPool(object):
|
|||||||
LOG.info(_('Connecting to %(db)s on %(nodelist)s') % log_data)
|
LOG.info(_('Connecting to %(db)s on %(nodelist)s') % log_data)
|
||||||
try:
|
try:
|
||||||
client = MongoProxy(
|
client = MongoProxy(
|
||||||
pymongo.MongoClient(
|
pymongo.MongoClient(url),
|
||||||
url, replicaSet=replica_set,
|
|
||||||
),
|
|
||||||
max_retries,
|
max_retries,
|
||||||
retry_interval,
|
retry_interval,
|
||||||
)
|
)
|
||||||
|
@ -48,11 +48,12 @@ MongoDB
|
|||||||
[database]
|
[database]
|
||||||
connection = mongodb://username:password@host:27017/aodh
|
connection = mongodb://username:password@host:27017/aodh
|
||||||
|
|
||||||
If MongoDB is configured in replica set mode, add param in aodh.conf
|
If MongoDB is configured in replica set mode, add `?replicaSet=` in your
|
||||||
to use MongoReplicaSetClient::
|
connection URL::
|
||||||
|
|
||||||
[database]
|
[database]
|
||||||
mongodb_replica_set = replica_name
|
connection = mongodb://username:password@host:27017/aodh?replicaSet=foobar
|
||||||
|
|
||||||
|
|
||||||
SQLalchemy-supported DBs
|
SQLalchemy-supported DBs
|
||||||
------------------------
|
------------------------
|
||||||
|
Loading…
x
Reference in New Issue
Block a user