Fix ports allocated for mongo2 that is w/o creds

This commit is contained in:
Yatsishin Ilya 2022-01-14 13:00:38 +00:00
parent 2088570a01
commit 2fe8f6c60b
2 changed files with 5 additions and 3 deletions

View File

@ -14,4 +14,4 @@ services:
image: mongo:5.0
restart: always
ports:
- "27018:27017"
- ${MONGO_NO_CRED_EXTERNAL_PORT}:${MONGO_NO_CRED_INTERNAL_PORT}

View File

@ -320,6 +320,8 @@ class ClickHouseCluster:
# available when with_mongo == True
self.mongo_host = "mongo1"
self.mongo_port = get_free_port()
self.mongo_no_cred_host = "mongo2"
self.mongo_no_cred_port = get_free_port()
# available when with_cassandra == True
self.cassandra_host = "cassandra1"
@ -727,8 +729,8 @@ class ClickHouseCluster:
env_variables['MONGO_HOST'] = self.mongo_host
env_variables['MONGO_EXTERNAL_PORT'] = str(self.mongo_port)
env_variables['MONGO_INTERNAL_PORT'] = "27017"
env_variables['MONGO_EXTERNAL_PORT_2'] = "27018"
env_variables['MONGO_INTERNAL_PORT_2'] = "27017"
env_variables['MONGO_NO_CRED_EXTERNAL_PORT'] = str(self.mongo_no_cred_port)
env_variables['MONGO_NO_CRED_INTERNAL_PORT'] = "27017"
self.base_cmd.extend(['--file', p.join(docker_compose_yml_dir, 'docker_compose_mongo.yml')])
self.base_mongo_cmd = ['docker-compose', '--env-file', instance.env_file, '--project-name', self.project_name,
'--file', p.join(docker_compose_yml_dir, 'docker_compose_mongo.yml')]