diff --git a/conpaas-client/cps/generic.py b/conpaas-client/cps/generic.py index c6f42650..62bca114 100644 --- a/conpaas-client/cps/generic.py +++ b/conpaas-client/cps/generic.py @@ -9,12 +9,12 @@ def info(self, app_id, service_id): service = BaseClient.info(self, app_id, service_id) nodes = self.callmanager(app_id, service['sid'], "list_nodes", False, {}) - if 'master' in nodes and nodes['master']: - # Only one master - master = nodes['master'][0] - params = { 'serviceNodeId': master } + if 'main' in nodes and nodes['main']: + # Only one main + main = nodes['main'][0] + params = { 'serviceNodeId': main } details = self.callmanager(app_id, service['sid'], "get_node_info", False, params) - print "master:", details['serviceNode']['ip'] + print "main:", details['serviceNode']['ip'] if 'node' in nodes: # Multiple nodes diff --git a/conpaas-client/cps/hadoop.py b/conpaas-client/cps/hadoop.py index ec726159..f33ee95e 100644 --- a/conpaas-client/cps/hadoop.py +++ b/conpaas-client/cps/hadoop.py @@ -6,19 +6,19 @@ def info(self, service_id): service = BaseClient.info(self, service_id) nodes = self.callmanager(service['sid'], "list_nodes", False, {}) - if 'masters' in nodes: - for master in nodes['masters']: - params = { 'serviceNodeId': master } + if 'mains' in nodes: + for main in nodes['mains']: + params = { 'serviceNodeId': main } details = self.callmanager(service['sid'], "get_node_info", False, params) - print "master namenode url:", + print "main namenode url:", print "http://%s:50070" % details['serviceNode']['ip'] - print "master job tracker url:", + print "main job tracker url:", print "http://%s:50030" % details['serviceNode']['ip'] - print "master HUE url:", + print "main HUE url:", print "http://%s:8088" % details['serviceNode']['ip'] def usage(self, cmdname): diff --git a/conpaas-director/cpsdirector/iaas/libcloud/dns/base.py b/conpaas-director/cpsdirector/iaas/libcloud/dns/base.py index d36bb171..02996b8a 100644 --- a/conpaas-director/cpsdirector/iaas/libcloud/dns/base.py +++ b/conpaas-director/cpsdirector/iaas/libcloud/dns/base.py @@ -37,7 +37,7 @@ def __init__(self, id, domain, type, ttl, driver, extra=None): @param domain: The name of the domain. @type type: C{string} - @param type: Zone type (master, slave). + @param type: Zone type (main, subordinate). @type ttl: C{int} @param ttl: Default TTL for records in this zone (in seconds). @@ -231,14 +231,14 @@ def get_record(self, zone_id, record_id): raise NotImplementedError( 'get_record not implemented for this driver') - def create_zone(self, domain, type='master', ttl=None, extra=None): + def create_zone(self, domain, type='main', ttl=None, extra=None): """ Create a new zone. @param domain: Zone domain name. @type domain: C{str} - @param type: Zone type (master / slave). + @param type: Zone type (main / subordinate). @type type: C{str} @param ttl: (optional) TTL for new records. @@ -252,7 +252,7 @@ def create_zone(self, domain, type='master', ttl=None, extra=None): raise NotImplementedError( 'create_zone not implemented for this driver') - def update_zone(self, zone, domain, type='master', ttl=None, extra=None): + def update_zone(self, zone, domain, type='main', ttl=None, extra=None): """ Update en existing zone. @@ -262,7 +262,7 @@ def update_zone(self, zone, domain, type='master', ttl=None, extra=None): @param domain: Zone domain name. @type domain: C{str} - @param type: Zone type (master / slave). + @param type: Zone type (main / subordinate). @type type: C{str} @param ttl: (optional) TTL for new records. diff --git a/conpaas-director/cpsdirector/iaas/libcloud/dns/drivers/dummy.py b/conpaas-director/cpsdirector/iaas/libcloud/dns/drivers/dummy.py index f1352f52..11283ff6 100644 --- a/conpaas-director/cpsdirector/iaas/libcloud/dns/drivers/dummy.py +++ b/conpaas-director/cpsdirector/iaas/libcloud/dns/drivers/dummy.py @@ -69,7 +69,7 @@ def list_zones(self): def list_records(self, zone): """ >>> driver = DummyDNSDriver('key', 'secret') - >>> zone = driver.create_zone(domain='apache.org', type='master', + >>> zone = driver.create_zone(domain='apache.org', type='main', ... ttl=100) >>> list(zone.list_records()) [] @@ -117,14 +117,14 @@ def get_record(self, zone_id, record_id): return zone_records[record_id] - def create_zone(self, domain, type='master', ttl=None, extra=None): + def create_zone(self, domain, type='main', ttl=None, extra=None): """ >>> driver = DummyDNSDriver('key', 'secret') - >>> zone = driver.create_zone(domain='apache.org', type='master', + >>> zone = driver.create_zone(domain='apache.org', type='main', ... ttl=100) >>> zone - >>> zone = driver.create_zone(domain='apache.org', type='master', + >>> zone = driver.create_zone(domain='apache.org', type='main', ... ttl=100) ... #doctest: +IGNORE_EXCEPTION_DETAIL Traceback (most recent call last): @@ -147,7 +147,7 @@ def create_zone(self, domain, type='master', ttl=None, extra=None): def create_record(self, name, zone, type, data, extra=None): """ >>> driver = DummyDNSDriver('key', 'secret') - >>> zone = driver.create_zone(domain='apache.org', type='master', + >>> zone = driver.create_zone(domain='apache.org', type='main', ... ttl=100) >>> record = driver.create_record(name='libcloud', zone=zone, ... type=RecordType.A, data='127.0.0.1') @@ -177,7 +177,7 @@ def create_record(self, name, zone, type, data, extra=None): def delete_zone(self, zone): """ >>> driver = DummyDNSDriver('key', 'secret') - >>> zone = driver.create_zone(domain='apache.org', type='master', + >>> zone = driver.create_zone(domain='apache.org', type='main', ... ttl=100) >>> driver.delete_zone(zone) True @@ -195,7 +195,7 @@ def delete_zone(self, zone): def delete_record(self, record): """ >>> driver = DummyDNSDriver('key', 'secret') - >>> zone = driver.create_zone(domain='apache.org', type='master', + >>> zone = driver.create_zone(domain='apache.org', type='main', ... ttl=100) >>> record = driver.create_record(name='libcloud', zone=zone, ... type=RecordType.A, data='127.0.0.1') diff --git a/conpaas-director/cpsdirector/iaas/libcloud/dns/drivers/gandi.py b/conpaas-director/cpsdirector/iaas/libcloud/dns/drivers/gandi.py index 8a8f68a0..27684084 100644 --- a/conpaas-director/cpsdirector/iaas/libcloud/dns/drivers/gandi.py +++ b/conpaas-director/cpsdirector/iaas/libcloud/dns/drivers/gandi.py @@ -104,7 +104,7 @@ def _to_zone(self, zone): return Zone( id=str(zone['id']), domain=zone['name'], - type='master', + type='main', ttl=0, driver=self, extra={} @@ -126,7 +126,7 @@ def get_zone(self, zone_id): zone = self.connection.request('domain.zone.info', zid) return self._to_zone(zone.object) - def create_zone(self, domain, type='master', ttl=None, extra=None): + def create_zone(self, domain, type='main', ttl=None, extra=None): params = { 'name': domain, } diff --git a/conpaas-director/cpsdirector/iaas/libcloud/dns/drivers/hostvirtual.py b/conpaas-director/cpsdirector/iaas/libcloud/dns/drivers/hostvirtual.py index c0ac57a0..8cb61f0d 100644 --- a/conpaas-director/cpsdirector/iaas/libcloud/dns/drivers/hostvirtual.py +++ b/conpaas-director/cpsdirector/iaas/libcloud/dns/drivers/hostvirtual.py @@ -81,7 +81,7 @@ def _to_zone(self, item): if 'records' in item: extra['records'] = item['records'] if item['type'] == 'NATIVE': - item['type'] = 'master' + item['type'] = 'main' zone = Zone(id=item['id'], domain=item['name'], type=item['type'], ttl=item['ttl'], driver=self, extra=extra) @@ -154,9 +154,9 @@ def delete_record(self, record): return bool(result) def create_zone(self, domain, type='NATIVE', ttl=None, extra=None): - if type == 'master': + if type == 'main': type = 'NATIVE' - elif type == 'slave': + elif type == 'subordinate': type = 'SLAVE' params = {'name': domain, 'type': type, 'ttl': ttl} result = self.connection.request( diff --git a/conpaas-director/cpsdirector/iaas/libcloud/dns/drivers/linode.py b/conpaas-director/cpsdirector/iaas/libcloud/dns/drivers/linode.py index 567621d0..23b53397 100644 --- a/conpaas-director/cpsdirector/iaas/libcloud/dns/drivers/linode.py +++ b/conpaas-director/cpsdirector/iaas/libcloud/dns/drivers/linode.py @@ -26,7 +26,7 @@ VALID_ZONE_EXTRA_PARAMS = ['SOA_Email', 'Refresh_sec', 'Retry_sec', - 'Expire_sec', 'status', 'master_ips'] + 'Expire_sec', 'status', 'main_ips'] VALID_RECORD_EXTRA_PARAMS = ['Priority', 'Weight', 'Port', 'Protocol', 'TTL_sec'] @@ -108,7 +108,7 @@ def get_record(self, zone_id, record_id): return records[0] - def create_zone(self, domain, type='master', ttl=None, extra=None): + def create_zone(self, domain, type='main', ttl=None, extra=None): """ Create a new zone. diff --git a/conpaas-director/cpsdirector/iaas/libcloud/dns/drivers/rackspace.py b/conpaas-director/cpsdirector/iaas/libcloud/dns/drivers/rackspace.py index dd30171b..6dc7dd5c 100644 --- a/conpaas-director/cpsdirector/iaas/libcloud/dns/drivers/rackspace.py +++ b/conpaas-director/cpsdirector/iaas/libcloud/dns/drivers/rackspace.py @@ -174,7 +174,7 @@ def get_record(self, zone_id, record_id): record = self._to_record(data=response, zone=zone) return record - def create_zone(self, domain, type='master', ttl=None, extra=None): + def create_zone(self, domain, type='main', ttl=None, extra=None): extra = extra if extra else {} # Email address is required @@ -313,7 +313,7 @@ def _to_zones(self, data): def _to_zone(self, data): id = data['id'] domain = data['name'] - type = 'master' + type = 'main' ttl = data.get('ttl', 0) extra = {} diff --git a/conpaas-director/cpsdirector/iaas/libcloud/dns/drivers/route53.py b/conpaas-director/cpsdirector/iaas/libcloud/dns/drivers/route53.py index 64918ade..ace445fc 100644 --- a/conpaas-director/cpsdirector/iaas/libcloud/dns/drivers/route53.py +++ b/conpaas-director/cpsdirector/iaas/libcloud/dns/drivers/route53.py @@ -159,7 +159,7 @@ def get_record(self, zone_id, record_id): return record - def create_zone(self, domain, type='master', ttl=None, extra=None): + def create_zone(self, domain, type='main', ttl=None, extra=None): zone = ET.Element('CreateHostedZoneRequest', {'xmlns': NAMESPACE}) ET.SubElement(zone, 'Name').text = domain ET.SubElement(zone, 'CallerReference').text = str(uuid.uuid4()) @@ -272,7 +272,7 @@ def _to_zone(self, elem): extra = {'Comment': comment, 'ResourceRecordSetCount': resource_record_count} - zone = Zone(id=id, domain=name, type='master', ttl=0, driver=self, + zone = Zone(id=id, domain=name, type='main', ttl=0, driver=self, extra=extra) return zone diff --git a/conpaas-director/cpsdirector/iaas/libcloud/dns/drivers/zerigo.py b/conpaas-director/cpsdirector/iaas/libcloud/dns/drivers/zerigo.py index 404b8da1..af32b78e 100644 --- a/conpaas-director/cpsdirector/iaas/libcloud/dns/drivers/zerigo.py +++ b/conpaas-director/cpsdirector/iaas/libcloud/dns/drivers/zerigo.py @@ -39,7 +39,7 @@ API_VERSION = '1.1' API_ROOT = '/api/%s/' % (API_VERSION) -VALID_ZONE_EXTRA_PARAMS = ['notes', 'tag-list', 'ns1', 'slave-nameservers'] +VALID_ZONE_EXTRA_PARAMS = ['notes', 'tag-list', 'ns1', 'subordinate-nameservers'] VALID_RECORD_EXTRA_PARAMS = ['notes', 'ttl', 'priority'] # Number of items per page (maximum limit is 1000) @@ -164,7 +164,7 @@ def get_record(self, zone_id, record_id): record = self._to_record(elem=data, zone=zone) return record - def create_zone(self, domain, type='master', ttl=None, extra=None): + def create_zone(self, domain, type='main', ttl=None, extra=None): """ Create a new zone. @@ -276,7 +276,7 @@ def ex_get_zone_by_domain(self, domain): zone = self._to_zone(elem=data) return zone - def ex_force_slave_axfr(self, zone): + def ex_force_subordinate_axfr(self, zone): """ Force a zone transfer. @@ -285,7 +285,7 @@ def ex_force_slave_axfr(self, zone): @rtype: L{Zone} """ - path = API_ROOT + 'zones/%s/force_slave_axfr.xml' % (zone.id) + path = API_ROOT + 'zones/%s/force_subordinate_axfr.xml' % (zone.id) self.connection.set_context({'resource': 'zone', 'id': zone.id}) response = self.connection.request(path, method='POST') assert response.status == httplib.ACCEPTED @@ -301,28 +301,28 @@ def _to_zone_elem(self, domain=None, type=None, ttl=None, extra=None): if type: ns_type_elem = ET.SubElement(zone_elem, 'ns-type') - if type == 'master': + if type == 'main': ns_type_elem.text = 'pri_sec' - elif type == 'slave': + elif type == 'subordinate': if not extra or 'ns1' not in extra: raise LibcloudError('ns1 extra attribute is required ' + - 'when zone type is slave', driver=self) + 'when zone type is subordinate', driver=self) ns_type_elem.text = 'sec' ns1_elem = ET.SubElement(zone_elem, 'ns1') ns1_elem.text = extra['ns1'] - elif type == 'std_master': + elif type == 'std_main': # TODO: Each driver should provide supported zone types - # Slave name servers are elsewhere - if not extra or 'slave-nameservers' not in extra: - raise LibcloudError('slave-nameservers extra ' + + # Subordinate name servers are elsewhere + if not extra or 'subordinate-nameservers' not in extra: + raise LibcloudError('subordinate-nameservers extra ' + 'attribute is required whenzone ' + - 'type is std_master', driver=self) + 'type is std_main', driver=self) ns_type_elem.text = 'pri' - slave_nameservers_elem = ET.SubElement(zone_elem, - 'slave-nameservers') - slave_nameservers_elem.text = extra['slave-nameservers'] + subordinate_nameservers_elem = ET.SubElement(zone_elem, + 'subordinate-nameservers') + subordinate_nameservers_elem.text = extra['subordinate-nameservers'] if ttl: default_ttl_elem = ET.SubElement(zone_elem, 'default-ttl') @@ -383,21 +383,21 @@ def _to_zone(self, elem): id = findtext(element=elem, xpath='id') domain = findtext(element=elem, xpath='domain') type = findtext(element=elem, xpath='ns-type') - type = 'master' if type.find('pri') == 0 else 'slave' + type = 'main' if type.find('pri') == 0 else 'subordinate' ttl = findtext(element=elem, xpath='default-ttl') - hostmaster = findtext(element=elem, xpath='hostmaster') + hostmain = findtext(element=elem, xpath='hostmain') custom_ns = findtext(element=elem, xpath='custom-ns') custom_nameservers = findtext(element=elem, xpath='custom-nameservers') notes = findtext(element=elem, xpath='notes') nx_ttl = findtext(element=elem, xpath='nx-ttl') - slave_nameservers = findtext(element=elem, xpath='slave-nameservers') + subordinate_nameservers = findtext(element=elem, xpath='subordinate-nameservers') tags = findtext(element=elem, xpath='tag-list') tags = tags.split(' ') if tags else [] - extra = {'hostmaster': hostmaster, 'custom-ns': custom_ns, + extra = {'hostmain': hostmain, 'custom-ns': custom_ns, 'custom-nameservers': custom_nameservers, 'notes': notes, - 'nx-ttl': nx_ttl, 'slave-nameservers': slave_nameservers, + 'nx-ttl': nx_ttl, 'subordinate-nameservers': subordinate_nameservers, 'tags': tags} zone = Zone(id=str(id), domain=domain, type=type, ttl=int(ttl), driver=self, extra=extra) diff --git a/conpaas-services/contrib/ganglia_modules/mysql/mysql.py b/conpaas-services/contrib/ganglia_modules/mysql/mysql.py index bbea9a94..4e159f27 100644 --- a/conpaas-services/contrib/ganglia_modules/mysql/mysql.py +++ b/conpaas-services/contrib/ganglia_modules/mysql/mysql.py @@ -42,7 +42,7 @@ REPORT_MASTER = True REPORT_SLAVE = True -def update_stats(get_innodb=True, get_master=True, get_slave=True): +def update_stats(get_innodb=True, get_main=True, get_subordinate=True): logging.warning('updating stats') global last_update global mysql_stats @@ -85,7 +85,7 @@ def update_stats(get_innodb=True, get_master=True, get_slave=True): # try not to fail ? get_innodb = get_innodb and variables['have_innodb'].lower() == 'yes' - get_master = get_master and variables['log_bin'].lower() == 'on' + get_main = get_main and variables['log_bin'].lower() == 'on' if get_innodb: cursor = conn.cursor(MySQLdb.cursors.Cursor) @@ -93,22 +93,22 @@ def update_stats(get_innodb=True, get_master=True, get_slave=True): innodb_status = parse_innodb_status(cursor.fetchone()[0].split('\n')) cursor.close() - if get_master: + if get_main: cursor = conn.cursor(MySQLdb.cursors.Cursor) cursor.execute("SHOW MASTER LOGS") - master_logs = cursor.fetchall() + main_logs = cursor.fetchall() cursor.close() - if get_slave: + if get_subordinate: cursor = conn.cursor(MySQLdb.cursors.DictCursor) cursor.execute("SHOW SLAVE STATUS") - slave_status = {} + subordinate_status = {} res = cursor.fetchone() if res: for (k,v) in res.items(): - slave_status[k.lower()] = v + subordinate_status[k.lower()] = v else: - get_slave = False + get_subordinate = False cursor.close() cursor = conn.cursor(MySQLdb.cursors.DictCursor) @@ -170,8 +170,8 @@ def update_stats(get_innodb=True, get_master=True, get_slave=True): 'select_range', 'select_range_check', 'select_scan', - 'slave_open_temp_tables', - 'slave_retried_transactions', + 'subordinate_open_temp_tables', + 'subordinate_retried_transactions', 'slow_launch_threads', 'slow_queries', 'sort_range', @@ -197,32 +197,32 @@ def update_stats(get_innodb=True, get_master=True, get_slave=True): for istat in innodb_status: mysql_stats['innodb_' + istat] = innodb_status[istat] - # process master logs - if get_master: - mysql_stats['binlog_count'] = len(master_logs) - mysql_stats['binlog_space_current'] = master_logs[-1][1] - #mysql_stats['binlog_space_total'] = sum((long(s[1]) for s in master_logs)) + # process main logs + if get_main: + mysql_stats['binlog_count'] = len(main_logs) + mysql_stats['binlog_space_current'] = main_logs[-1][1] + #mysql_stats['binlog_space_total'] = sum((long(s[1]) for s in main_logs)) mysql_stats['binlog_space_total'] = 0 - for s in master_logs: + for s in main_logs: mysql_stats['binlog_space_total'] += int(s[1]) - mysql_stats['binlog_space_used'] = float(master_logs[-1][1]) / float(variables['max_binlog_size']) * 100 - - # process slave status - if get_slave: - mysql_stats['slave_exec_master_log_pos'] = slave_status['exec_master_log_pos'] - #mysql_stats['slave_io'] = 1 if slave_status['slave_io_running'].lower() == "yes" else 0 - if slave_status['slave_io_running'].lower() == "yes": - mysql_stats['slave_io'] = 1 + mysql_stats['binlog_space_used'] = float(main_logs[-1][1]) / float(variables['max_binlog_size']) * 100 + + # process subordinate status + if get_subordinate: + mysql_stats['subordinate_exec_main_log_pos'] = subordinate_status['exec_main_log_pos'] + #mysql_stats['subordinate_io'] = 1 if subordinate_status['subordinate_io_running'].lower() == "yes" else 0 + if subordinate_status['subordinate_io_running'].lower() == "yes": + mysql_stats['subordinate_io'] = 1 else: - mysql_stats['slave_io'] = 0 - #mysql_stats['slave_sql'] = 1 if slave_status['slave_sql_running'].lower() =="yes" else 0 - if slave_status['slave_sql_running'].lower() == "yes": - mysql_stats['slave_sql'] = 1 + mysql_stats['subordinate_io'] = 0 + #mysql_stats['subordinate_sql'] = 1 if subordinate_status['subordinate_sql_running'].lower() =="yes" else 0 + if subordinate_status['subordinate_sql_running'].lower() == "yes": + mysql_stats['subordinate_sql'] = 1 else: - mysql_stats['slave_sql'] = 0 - mysql_stats['slave_lag'] = slave_status['seconds_behind_master'] - mysql_stats['slave_relay_log_pos'] = slave_status['relay_log_pos'] - mysql_stats['slave_relay_log_space'] = slave_status['relay_log_space'] + mysql_stats['subordinate_sql'] = 0 + mysql_stats['subordinate_lag'] = subordinate_status['seconds_behind_main'] + mysql_stats['subordinate_relay_log_pos'] = subordinate_status['relay_log_pos'] + mysql_stats['subordinate_relay_log_space'] = subordinate_status['relay_log_space'] def get_stat(name): logging.info("getting stat: %s" % name) @@ -260,8 +260,8 @@ def metric_init(params): global REPORT_SLAVE REPORT_INNODB = str(params.get('get_innodb', True)) == "True" - REPORT_MASTER = str(params.get('get_master', True)) == "True" - REPORT_SLAVE = str(params.get('get_slave', True)) == "True" + REPORT_MASTER = str(params.get('get_main', True)) == "True" + REPORT_SLAVE = str(params.get('get_subordinate', True)) == "True" logging.warning("init: " + str(params)) @@ -273,9 +273,9 @@ def metric_init(params): connect_timeout = params.get('timeout', 30), ) - master_stats_descriptions = {} + main_stats_descriptions = {} innodb_stats_descriptions = {} - slave_stats_descriptions = {} + subordinate_stats_descriptions = {} misc_stats_descriptions = dict( aborted_clients = { @@ -498,14 +498,14 @@ def metric_init(params): 'units': 'joins', }, - slave_open_temp_tables = { - 'description': 'The number of temporary tables that the slave SQL thread currently has open', + subordinate_open_temp_tables = { + 'description': 'The number of temporary tables that the subordinate SQL thread currently has open', 'units': 'tables', 'slope': 'both', }, - slave_retried_transactions = { - 'description': 'The total number of times since startup that the replication slave SQL thread has retried transactions', + subordinate_retried_transactions = { + 'description': 'The total number of times since startup that the replication subordinate SQL thread has retried transactions', 'units': 'count', }, @@ -584,7 +584,7 @@ def metric_init(params): ) if REPORT_MASTER: - master_stats_descriptions = dict( + main_stats_descriptions = dict( binlog_count = { 'description': "Number of binary logs", 'units': 'logs', @@ -612,34 +612,34 @@ def metric_init(params): ) if REPORT_SLAVE: - slave_stats_descriptions = dict( - slave_exec_master_log_pos = { - 'description': "The position of the last event executed by the SQL thread from the master's binary log", + subordinate_stats_descriptions = dict( + subordinate_exec_main_log_pos = { + 'description': "The position of the last event executed by the SQL thread from the main's binary log", 'units': 'bytes', 'slope': 'both', }, - slave_io = { - 'description': "Whether the I/O thread is started and has connected successfully to the master", + subordinate_io = { + 'description': "Whether the I/O thread is started and has connected successfully to the main", 'value_type': 'uint8', 'units': 'True/False', 'slope': 'both', }, - slave_lag = { + subordinate_lag = { 'description': "Replication Lag", 'units': 'secs', 'slope': 'both', }, - slave_relay_log_pos = { + subordinate_relay_log_pos = { 'description': "The position up to which the SQL thread has read and executed in the current relay log", 'units': 'bytes', 'slope': 'both', }, - slave_sql = { - 'description': "Slave SQL Running", + subordinate_sql = { + 'description': "Subordinate SQL Running", 'value_type': 'uint8', 'units': 'True/False', 'slope': 'both', @@ -915,7 +915,7 @@ def metric_init(params): update_stats(REPORT_INNODB, REPORT_MASTER, REPORT_SLAVE) - for stats_descriptions in (innodb_stats_descriptions, master_stats_descriptions, misc_stats_descriptions, slave_stats_descriptions): + for stats_descriptions in (innodb_stats_descriptions, main_stats_descriptions, misc_stats_descriptions, subordinate_stats_descriptions): for label in stats_descriptions: if mysql_stats.has_key(label): @@ -956,8 +956,8 @@ def metric_cleanup(): parser.add_option("-p", "--password", dest="passwd", help="password", default="") parser.add_option("-P", "--port", dest="port", help="port", default=3306, type="int") parser.add_option("--no-innodb", dest="get_innodb", action="store_false", default=True) - parser.add_option("--no-master", dest="get_master", action="store_false", default=True) - parser.add_option("--no-slave", dest="get_slave", action="store_false", default=True) + parser.add_option("--no-main", dest="get_main", action="store_false", default=True) + parser.add_option("--no-subordinate", dest="get_subordinate", action="store_false", default=True) parser.add_option("-b", "--gmetric-bin", dest="gmetric_bin", help="path to gmetric binary", default="/usr/bin/gmetric") parser.add_option("-c", "--gmond-conf", dest="gmond_conf", help="path to gmond.conf", default="/etc/ganglia/gmond.conf") parser.add_option("-g", "--gmetric", dest="gmetric", help="submit via gmetric", action="store_true", default=False) @@ -971,8 +971,8 @@ def metric_cleanup(): 'user': options.user, 'port': options.port, 'get_innodb': options.get_innodb, - 'get_master': options.get_master, - 'get_slave': options.get_slave, + 'get_main': options.get_main, + 'get_subordinate': options.get_subordinate, }) for d in descriptors: diff --git a/conpaas-services/src/conpaas/core/git.py b/conpaas-services/src/conpaas/core/git.py index 78abd0ad..a6d3af7d 100644 --- a/conpaas-services/src/conpaas/core/git.py +++ b/conpaas-services/src/conpaas/core/git.py @@ -58,7 +58,7 @@ def remove_authorized_keys(keys): def git_push(repo, destination_ip): """Push repository contents to the given destination_ip""" - cmd = 'git push git@%s:%s master' % (destination_ip, DEFAULT_CODE_REPO) + cmd = 'git push git@%s:%s main' % (destination_ip, DEFAULT_CODE_REPO) return run_cmd(cmd, repo) def git_create_tmp_repo(): diff --git a/conpaas-services/src/conpaas/services/generic/agent/agent.py b/conpaas-services/src/conpaas/services/generic/agent/agent.py index 2c5cdafb..9f614ac6 100644 --- a/conpaas-services/src/conpaas/services/generic/agent/agent.py +++ b/conpaas-services/src/conpaas/services/generic/agent/agent.py @@ -98,11 +98,11 @@ def init_agent(self, kwargs): simplejson.dump(agents_info, outfile) agent_role = [i['role'] for i in agents_info if i['ip'] == agent_ip][0] - master_ip = [i['ip'] for i in agents_info if i['role'] == 'master'][0] + main_ip = [i['ip'] for i in agents_info if i['role'] == 'main'][0] self.env.update({'MY_IP':agent_ip}) self.env.update({'MY_ROLE':agent_role}) - self.env.update({'MASTER_IP':master_ip}) + self.env.update({'MASTER_IP':main_ip}) self.logger.info('Agent initialized') return HttpJsonResponse() diff --git a/conpaas-services/src/conpaas/services/generic/manager/manager.py b/conpaas-services/src/conpaas/services/generic/manager/manager.py index e28a83c2..2e830912 100644 --- a/conpaas-services/src/conpaas/services/generic/manager/manager.py +++ b/conpaas-services/src/conpaas/services/generic/manager/manager.py @@ -66,7 +66,7 @@ class GenericManager(BaseManager): # Generic node types - ROLE_MASTER = 'master' # master node (the first one started) + ROLE_MASTER = 'main' # main node (the first one started) # a regular node (the role used by any other node) is defined in base class # String used as an error message when 'interrupt' is called when no @@ -92,7 +92,7 @@ def __init__(self, config_parser, **kwargs): self._create_initial_configuration() self.agents_info = [] - self.master_ip = None + self.main_ip = None def _prepare_default_config_script(self, script_name): fileno, path = tempfile.mkstemp() @@ -103,7 +103,7 @@ def _prepare_default_config_script(self, script_name): echo "Parameters ($#): $@" >> /root/generic.out echo "My IP is $MY_IP" >> /root/generic.out echo "My role is $MY_ROLE" >> /root/generic.out -echo "My master IP is $MASTER_IP" >> /root/generic.out +echo "My main IP is $MASTER_IP" >> /root/generic.out echo "Information about other agents is stored at /var/cache/cpsagent/agents.json" >> /root/generic.out cat /var/cache/cpsagent/agents.json >> /root/generic.out echo "" >> /root/generic.out @@ -161,7 +161,7 @@ def _create_initial_configuration(self): self._configuration_set(config) def on_start(self, nodes): - """Start up the service. The first node will be the master node.""" + """Start up the service. The first node will be the main node.""" nr_instances = 1 @@ -180,7 +180,7 @@ def on_start(self, nodes): # Extend the nodes list with the newly created one self.agents_info += agents_info - self.master_ip = nodes[0].ip + self.main_ip = nodes[0].ip return True except Exception, err: self.logger.exception('_do_startup: Failed to create agents: %s' % err) @@ -223,7 +223,7 @@ def on_stop(self): # self.controller.delete_nodes(self.nodes) del_nodes = self.nodes[:] self.agents_info = [] - self.master_ip = None + self.main_ip = None return del_nodes def on_add_nodes(self, node_instances): @@ -247,7 +247,7 @@ def check_remove_nodes(self, node_roles): BaseManager.check_remove_nodes(self, node_roles) if node_roles.get(self.ROLE_MASTER, 0) > 0: - raise Exception("Cannot remove the master node.") + raise Exception("Cannot remove the main node.") def on_remove_nodes(self, node_roles): count = sum(node_roles.values()) @@ -259,7 +259,7 @@ def on_remove_nodes(self, node_roles): self.agents_info.pop() self.logger.info("Removing node with IP %s" % node.ip) if not cp_nodes: - self.master_ip = None + self.main_ip = None self.state_set(self.S_STOPPED) else: self._do_execute_script('notify', cp_nodes) @@ -267,9 +267,9 @@ def on_remove_nodes(self, node_roles): return del_nodes - def __is_master(self, node): - """Return True if the given node is the Generic master""" - return node.ip == self.master_ip + def __is_main(self, node): + """Return True if the given node is the Generic main""" + return node.ip == self.main_ip @expose('GET') def list_nodes(self, kwargs): @@ -286,14 +286,14 @@ def list_nodes(self, kwargs): return HttpJsonResponse({}) generic_nodes = [ - node.id for node in self.nodes if not self.__is_master(node) + node.id for node in self.nodes if not self.__is_main(node) ] - generic_master = [ - node.id for node in self.nodes if self.__is_master(node) + generic_main = [ + node.id for node in self.nodes if self.__is_main(node) ] return HttpJsonResponse({ - self.ROLE_MASTER: generic_master, + self.ROLE_MASTER: generic_main, self.ROLE_REGULAR: generic_nodes }) @@ -332,7 +332,7 @@ def get_node_info(self, kwargs): 'ip': serviceNode.ip, 'vmid': serviceNode.vmid, 'cloud': serviceNode.cloud_name, - 'is_master': self.__is_master(serviceNode), + 'is_main': self.__is_main(serviceNode), 'role': serviceNode.role, 'logs': self.get_role_logs(serviceNode.role) diff --git a/conpaas-services/src/conpaas/services/htc/agent/agent.py b/conpaas-services/src/conpaas/services/htc/agent/agent.py index f39c5a28..b21e8065 100644 --- a/conpaas-services/src/conpaas/services/htc/agent/agent.py +++ b/conpaas-services/src/conpaas/services/htc/agent/agent.py @@ -100,6 +100,6 @@ def create_node(self, kwargs): @expose('POST') def condor_off(self,kwargs): - """Turn off local condor daemons, so the master will know we are gone""" + """Turn off local condor daemons, so the main will know we are gone""" os.system("condor_off") return HttpJsonResponse() diff --git a/conpaas-services/src/conpaas/services/mapreduce/manager/manager.py b/conpaas-services/src/conpaas/services/mapreduce/manager/manager.py index 50612781..9f981064 100644 --- a/conpaas-services/src/conpaas/services/mapreduce/manager/manager.py +++ b/conpaas-services/src/conpaas/services/mapreduce/manager/manager.py @@ -27,7 +27,7 @@ def __init__(self, def _do_startup(self, cloud): ''' Starts up the service. The first node will be the job - master as well as an hadoop worker. + main as well as an hadoop worker. ''' startCloud = self._init_cloud(cloud) try: @@ -108,7 +108,7 @@ def list_nodes(self, kwargs): if self.state != self.S_RUNNING: return HttpErrorResponse('ERROR: Wrong state to list_nodes') return HttpJsonResponse({ - 'masters' : [self.nodes[0].id], + 'mains' : [self.nodes[0].id], 'workers': [ node.id for node in self.nodes[1:] ] }) diff --git a/conpaas-services/src/conpaas/services/mysql/agent/role.py b/conpaas-services/src/conpaas/services/mysql/agent/role.py index 42e83d76..92908447 100644 --- a/conpaas-services/src/conpaas/services/mysql/agent/role.py +++ b/conpaas-services/src/conpaas/services/mysql/agent/role.py @@ -236,11 +236,11 @@ def restart(self): """Before creating a data snapshot or starting the replication process, you should record the - position of the binary log on the master. You will - need this information when configuring the slave so - that the slave knows where within the binary log to + position of the binary log on the main. You will + need this information when configuring the subordinate so + that the subordinate knows where within the binary log to start executing events. See Section 15.1.1.4, Obtaining - the Replication Master Binary Log Coordinates. + the Replication Main Binary Log Coordinates. 1st session mysql> FLUSH TABLES WITH READ LOCK; @@ -251,7 +251,7 @@ def restart(self): close 2nd session - on the master + on the main mysqldump --all-databases --lock-all-tables >dbdump.db 1st session diff --git a/docs/conf.py b/docs/conf.py index 403ecc29..67e48ad8 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -40,8 +40,8 @@ # The encoding of source files. #source_encoding = 'utf-8-sig' -# The master toctree document. -master_doc = 'index' +# The main toctree document. +main_doc = 'index' # General information about the project. project = u'ConPaaS'