Skip to content

Commit 3258f2f

Browse files
authored
Merge pull request #246 from globocom/remove_td_agent
Remove td agent
2 parents 5c2616d + 9c0d661 commit 3258f2f

File tree

21 files changed

+7
-392
lines changed

21 files changed

+7
-392
lines changed

dbaas/drivers/mongodb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,4 +349,4 @@ def switch_master(self):
349349
pass
350350

351351
def get_database_agents(self):
352-
return ['td-agent', 'monit']
352+
return []

dbaas/drivers/redis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,4 +347,4 @@ def switch_master(self):
347347
raise Exception(str(output))
348348

349349
def get_database_agents(self):
350-
return ['td-agent', 'httpd', 'monit']
350+
return ['httpd']

dbaas/drivers/replication_topologies/mysql.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def set_read_ip(self, driver, instance):
6464
raise NotImplementedError
6565

6666
def get_database_agents(self):
67-
return ['td-agent', 'mysql_statsd', 'monit']
67+
return ['monit']
6868

6969

7070
class MySQLSingle(BaseMysql):

dbaas/workflow/settings.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
'workflow.steps.mysql.flipperfox_migration.config_backup_log.ConfigBackupLog',
4646
'workflow.steps.mysql.flipperfox_migration.acl_database_bind.BindNewInstances',
4747
'workflow.steps.mysql.flipperfox_migration.replicate_old_acls.ReplicateOldAcl',
48-
'workflow.steps.mysql.flipperfox_migration.td_agent.StopTDAgent',
4948
)
5049

5150

@@ -60,8 +59,6 @@
6059
'workflow.steps.mysql.flipperfox_migration.set_infra_endpoint.SetInfraEndpoint',
6160
'workflow.steps.mysql.flipperfox_migration.update_zabbix_monitoring.UpdateZabbixMonitoring',
6261
'workflow.steps.mysql.flipperfox_migration.switch_dns.SwitchDNS',
63-
'workflow.steps.mysql.flipperfox_migration.td_agent.StartTDAgent',
64-
'workflow.steps.mysql.flipperfox_migration.start_mysql_statsd.StartMySQLStasD',
6562

6663
)
6764

dbaas/workflow/steps/mongodb/deploy/init_database.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,6 @@ def do(self, workflow_dict):
3030
workflow_dict['replicasetname'] = 'ReplicaSet_' + \
3131
workflow_dict['databaseinfra'].name
3232

33-
statsd_credentials = get_credentials_for(
34-
environment=workflow_dict['environment'],
35-
credential_type=CredentialType.STATSD)
36-
37-
statsd_host, statsd_port = statsd_credentials.endpoint.split(':')
3833
mongodb_password = get_credentials_for(environment=workflow_dict['environment'],
3934
credential_type=CredentialType.MONGODB).password
4035

@@ -60,8 +55,6 @@ def do(self, workflow_dict):
6055
'HOST': workflow_dict['hosts'][index].hostname.split('.')[0],
6156
'DATABASENAME': workflow_dict['name'],
6257
'ENGINE': 'mongodb',
63-
'STATSD_HOST': statsd_host,
64-
'STATSD_PORT': statsd_port,
6558
'IS_HA': workflow_dict['databaseinfra'].plan.is_ha
6659
}
6760
databaserule = 'ARBITER'
@@ -73,8 +66,6 @@ def do(self, workflow_dict):
7366
'DATABASENAME': workflow_dict['name'],
7467
'ENGINE': 'mongodb',
7568
'DBPASSWORD': mongodb_password,
76-
'STATSD_HOST': statsd_host,
77-
'STATSD_PORT': statsd_port,
7869
'IS_HA': workflow_dict['databaseinfra'].plan.is_ha
7970
}
8071

dbaas/workflow/steps/mongodb/upgrade/change_storage_engine_ha.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
from workflow.steps.mongodb.util import build_stop_database_script
1313
from workflow.steps.mongodb.util import build_clean_data_data_script
1414
from workflow.steps.mongodb.util import build_wait_admin_be_created_script
15-
from workflow.steps.util import td_agent_script
1615

1716

1817
LOG = logging.getLogger(__name__)
@@ -68,7 +67,6 @@ def change_instance_binaries(self, instance):
6867
script += build_clean_data_data_script()
6968
script += build_start_database_script()
7069
script += build_wait_admin_be_created_script()
71-
script += td_agent_script(option='restart')
7270

7371
context_dict = {
7472
}

dbaas/workflow/steps/mongodb/upgrade/change_storage_engine_single.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
from workflow.steps.mongodb.util import build_start_database_script
1515
from workflow.steps.mongodb.util import build_stop_database_script
1616
from workflow.steps.mongodb.util import build_clean_data_data_script
17-
from workflow.steps.util import td_agent_script
1817

1918

2019
LOG = logging.getLogger(__name__)
@@ -38,7 +37,6 @@ def do(self, workflow_dict):
3837
script += build_mongorestore_database_script()
3938
script += build_enable_authentication_single_instance_script()
4039
script += build_restart_database_script()
41-
script += td_agent_script(option='restart')
4240

4341
context_dict = {
4442
}

dbaas/workflow/steps/mongodb/upgrade/upgrade_mongodb_26_to_30_ha.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ def change_instance_binaries(self, instance, connect_string, is_primary):
8383
script += util.build_change_release_alias_script()
8484
script += util.build_start_database_script(wait_time=30)
8585
script += util.build_change_limits_script()
86-
script += util.build_remove_reprecated_index_counter_metrics()
8786

8887
if is_primary:
8988
script += util.build_authschemaupgrade_script()

dbaas/workflow/steps/mongodb/upgrade/upgrade_mongodb_26_to_30_single.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ def do(self, workflow_dict):
3434
script += util.build_authschemaupgrade_script()
3535
script += util.build_addrole_mongo3_script()
3636
script += util.build_change_limits_script()
37-
script += util.build_remove_reprecated_index_counter_metrics()
3837

3938
context_dict = {
4039
'SOURCE_PATH': '/mnt/software/db/mongodb',

dbaas/workflow/steps/mongodb/util/__init__.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -340,11 +340,3 @@ def build_change_mongodb_conf_file_script():
340340
line=$((line + 1))
341341
sed -i ${line}'i\httpinterface = true' /data/mongodb.conf
342342
"""
343-
344-
345-
def build_remove_reprecated_index_counter_metrics():
346-
return """
347-
sed -i '271,315 d' /etc/td-agent/td-agent.conf
348-
sleep 20
349-
/etc/init.d/td-agent start
350-
"""

0 commit comments

Comments
 (0)