Пример #1
0
 def __init__(self, directory, shards, mysql_db, vschema, charset,
              web_dir=None):
   VtProcess.__init__(self, 'vtcombo-%s' % os.environ['USER'], directory,
                      environment.vtcombo_binary, port_name='vtcombo')
   topology = ','.join(['%s/%s:%s' % (shard.keyspace, shard.name,
                                      shard.db_name) for shard in shards])
   self.extraparams = [
       '-db-config-app-charset', charset,
       '-db-config-app-uname', mysql_db.username(),
       '-db-config-app-pass', mysql_db.password(),
       '-topology', topology,
       '-mycnf_server_id', '1',
       '-mycnf_socket_file', mysql_db.unix_socket(),
   ] + self.QUERYSERVER_PARAMETERS + environment.extra_vtcombo_parameters()
   if vschema:
     self.extraparams.extend(['-vschema', vschema])
   if web_dir:
     self.extraparams.extend(['-web_dir', web_dir])
   if mysql_db.unix_socket():
     self.extraparams.extend(
         ['-db-config-app-unixsocket', mysql_db.unix_socket()])
   else:
     self.extraparams.extend(
         ['-db-config-app-host', mysql_db.hostname(),
          '-db-config-app-port', str(mysql_db.port())])
Пример #2
0
 def __init__(self,
              directory,
              topology,
              mysql_db,
              schema_dir,
              charset,
              web_dir=None,
              web_dir2=None):
     VtProcess.__init__(self,
                        'vtcombo-%s' % os.environ['USER'],
                        directory,
                        environment.vtcombo_binary,
                        port_name='vtcombo')
     self.extraparams = [
         '-db-config-app-charset',
         charset,
         '-db-config-app-uname',
         mysql_db.username(),
         '-db-config-app-pass',
         mysql_db.password(),
         '-db-config-dba-charset',
         charset,
         '-db-config-dba-uname',
         mysql_db.username(),
         '-db-config-dba-pass',
         mysql_db.password(),
         '-proto_topo',
         text_format.MessageToString(topology, as_one_line=True),
         '-mycnf_server_id',
         '1',
         '-mycnf_socket_file',
         mysql_db.unix_socket(),
         '-normalize_queries',
     ] + self.QUERYSERVER_PARAMETERS + environment.extra_vtcombo_parameters(
     )
     if schema_dir:
         self.extraparams.extend(['-schema_dir', schema_dir])
     if web_dir:
         self.extraparams.extend(['-web_dir', web_dir])
     if web_dir2:
         self.extraparams.extend(['-web_dir2', web_dir2])
     if mysql_db.unix_socket():
         self.extraparams.extend([
             '-db-config-app-unixsocket',
             mysql_db.unix_socket(), '-db-config-dba-unixsocket',
             mysql_db.unix_socket()
         ])
     else:
         self.extraparams.extend([
             '-db-config-app-host',
             mysql_db.hostname(), '-db-config-app-port',
             str(mysql_db.port()), '-db-config-dba-host',
             mysql_db.hostname(), '-db-config-dba-port',
             str(mysql_db.port())
         ])
     self.vtcombo_mysql_port = environment.get_port('vtcombo_mysql_port')
     self.extraparams.extend([
         '-mysql_auth_server_impl', 'none', '-mysql_server_port',
         str(self.vtcombo_mysql_port)
     ])
Пример #3
0
 def __init__(self, directory, shards, mysql_db, charset):
     VtProcess.__init__(self,
                        'vtcombo-%s' % os.environ['USER'],
                        directory,
                        environment.vtcombo_binary,
                        port_name='vtcombo')
     topology = ",".join([
         "%s/%s:%s" % (shard.keyspace, shard.name, shard.db_name)
         for shard in shards
     ])
     self.extraparams = [
         '-db-config-app-charset',
         charset,
         '-db-config-app-host',
         mysql_db.hostname(),
         '-db-config-app-port',
         str(mysql_db.port()),
         '-db-config-app-uname',
         mysql_db.username(),
         '-db-config-app-pass',
         mysql_db.password(),
         '-db-config-app-unixsocket',
         mysql_db.unix_socket(),
         '-topology',
         topology,
         '-mycnf_server_id',
         '1',
         '-mycnf_socket_file',
         mysql_db.unix_socket(),
     ] + self.QUERYSERVER_PARAMETERS + environment.extra_vtcombo_parameters(
     )
Пример #4
0
 def __init__(self, directory, topology, mysql_db, schema_dir, charset,
              mysql_server_bind_address=None):
   VtProcess.__init__(self, 'vtcombo-%s' % os.environ['USER'], directory,
                      environment.vtcombo_binary, port_name='vtcombo')
   self.extraparams = [
       '-db_charset', charset,
       '-db_app_user', mysql_db.username(),
       '-db_app_password', mysql_db.password(),
       '-db_dba_user', mysql_db.username(),
       '-db_dba_password', mysql_db.password(),
       '-proto_topo', text_format.MessageToString(topology, as_one_line=True),
       '-mycnf_server_id', '1',
       '-mycnf_socket_file', mysql_db.unix_socket(),
       '-normalize_queries',
   ] + self.QUERYSERVER_PARAMETERS + environment.extra_vtcombo_parameters()
   if schema_dir:
     self.extraparams.extend(['-schema_dir', schema_dir])
   if mysql_db.unix_socket():
     self.extraparams.extend(['-db_socket', mysql_db.unix_socket()])
   else:
     self.extraparams.extend(
         ['-db_host', mysql_db.hostname(),
          '-db_port', str(mysql_db.port())])
   self.vtcombo_mysql_port = environment.get_port('vtcombo_mysql_port')
   if mysql_server_bind_address:
       # Binding to 0.0.0.0 instead of localhost makes it possible to connect to vtgate from outside a docker container
       self.extraparams.extend(['-mysql_server_bind_address', mysql_server_bind_address])
   else:
       self.extraparams.extend(['-mysql_server_bind_address', 'localhost'])
   self.extraparams.extend(
       ['-mysql_auth_server_impl', 'none',
        '-mysql_server_port', str(self.vtcombo_mysql_port)])
Пример #5
0
 def __init__(self, directory, topology, mysql_db, schema_dir, charset,
              web_dir=None, web_dir2=None):
   VtProcess.__init__(self, 'vtcombo-%s' % os.environ['USER'], directory,
                      environment.vtcombo_binary, port_name='vtcombo')
   self.extraparams = [
       '-db-config-app-charset', charset,
       '-db-config-app-uname', mysql_db.username(),
       '-db-config-app-pass', mysql_db.password(),
       '-db-config-dba-charset', charset,
       '-db-config-dba-uname', mysql_db.username(),
       '-db-config-dba-pass', mysql_db.password(),
       '-proto_topo', text_format.MessageToString(topology, as_one_line=True),
       '-mycnf_server_id', '1',
       '-mycnf_socket_file', mysql_db.unix_socket(),
       '-normalize_queries',
   ] + self.QUERYSERVER_PARAMETERS + environment.extra_vtcombo_parameters()
   if schema_dir:
     self.extraparams.extend(['-schema_dir', schema_dir])
   if web_dir:
     self.extraparams.extend(['-web_dir', web_dir])
   if web_dir2:
     self.extraparams.extend(['-web_dir2', web_dir2])
   if mysql_db.unix_socket():
     self.extraparams.extend(
         ['-db-config-app-unixsocket', mysql_db.unix_socket(),
          '-db-config-dba-unixsocket', mysql_db.unix_socket()])
   else:
     self.extraparams.extend(
         ['-db-config-app-host', mysql_db.hostname(),
          '-db-config-app-port', str(mysql_db.port()),
          '-db-config-dba-host', mysql_db.hostname(),
          '-db-config-dba-port', str(mysql_db.port())])
Пример #6
0
 def __init__(self, directory, topology, mysql_db, schema_dir, charset, web_dir=None, web_dir2=None):
     VtProcess.__init__(
         self, "vtcombo-%s" % os.environ["USER"], directory, environment.vtcombo_binary, port_name="vtcombo"
     )
     self.extraparams = (
         [
             "-db-config-app-charset",
             charset,
             "-db-config-app-uname",
             mysql_db.username(),
             "-db-config-app-pass",
             mysql_db.password(),
             "-db-config-dba-charset",
             charset,
             "-db-config-dba-uname",
             mysql_db.username(),
             "-db-config-dba-pass",
             mysql_db.password(),
             "-proto_topo",
             text_format.MessageToString(topology, as_one_line=True),
             "-mycnf_server_id",
             "1",
             "-mycnf_socket_file",
             mysql_db.unix_socket(),
         ]
         + self.QUERYSERVER_PARAMETERS
         + environment.extra_vtcombo_parameters()
     )
     if schema_dir:
         self.extraparams.extend(["-schema_dir", schema_dir])
     if web_dir:
         self.extraparams.extend(["-web_dir", web_dir])
     if web_dir2:
         self.extraparams.extend(["-web_dir2", web_dir2])
     if mysql_db.unix_socket():
         self.extraparams.extend(
             [
                 "-db-config-app-unixsocket",
                 mysql_db.unix_socket(),
                 "-db-config-dba-unixsocket",
                 mysql_db.unix_socket(),
             ]
         )
     else:
         self.extraparams.extend(
             [
                 "-db-config-app-host",
                 mysql_db.hostname(),
                 "-db-config-app-port",
                 str(mysql_db.port()),
                 "-db-config-dba-host",
                 mysql_db.hostname(),
                 "-db-config-dba-port",
                 str(mysql_db.port()),
             ]
         )
Пример #7
0
 def __init__(self, directory, shards, mysql_db, charset):
   VtProcess.__init__(self, 'vtcombo-%s' % os.environ['USER'], directory,
                      environment.vtcombo_binary, port_name='vtcombo')
   topology = ",".join(["%s/%s:%s" % (shard.keyspace, shard.name,
                                      shard.db_name) for shard in shards])
   self.extraparams = [
       '-db-config-app-charset', charset,
       '-db-config-app-host', mysql_db.hostname(),
       '-db-config-app-port', str(mysql_db.port()),
       '-db-config-app-uname', mysql_db.username(),
       '-db-config-app-pass', mysql_db.password(),
       '-db-config-app-unixsocket', mysql_db.unix_socket(),
       '-topology', topology,
       '-mycnf_server_id', '1',
       '-mycnf_socket_file', mysql_db.unix_socket(),
   ] + self.QUERYSERVER_PARAMETERS + environment.extra_vtcombo_parameters()
Пример #8
0
 def __init__(self, directory, shards, mysql_db, charset):
   VtProcess.__init__(self, 'vtcombo-%s' % os.environ['USER'], directory,
                      environment.vtcombo_binary, port_name='vtcombo')
   topology = ",".join(["%s/%s:%s" % (shard.keyspace, shard.name, shard.db_name) for shard in shards])
   self.extraparams = [
       '-db-config-app-charset', charset,
       '-db-config-app-host', mysql_db.hostname(),
       '-db-config-app-port', str(mysql_db.port()),
       '-db-config-app-uname', mysql_db.username(),
       '-db-config-app-pass', mysql_db.password(),
       '-db-config-app-unixsocket', mysql_db.unix_socket(),
       '-queryserver-config-pool-size', '4',
       '-queryserver-config-transaction-cap', '4',
       '-queryserver-config-transaction-timeout', '300',
       '-queryserver-config-schema-reload-time', '60',
       '-queryserver-config-stream-pool-size', '4',
       '-topology', topology,
       '-mycnf_server_id', '1',
       '-mycnf_socket_file', mysql_db.unix_socket(),
   ] + environment.extra_vtcombo_parameters()
Пример #9
0
 def __init__(self, directory, shards, mysql_db, charset):
     VtProcess.__init__(self,
                        'vtcombo-%s' % os.environ['USER'],
                        directory,
                        environment.vtcombo_binary,
                        port_name='vtcombo')
     topology = ",".join([
         "%s/%s:%s" % (shard.keyspace, shard.name, shard.db_name)
         for shard in shards
     ])
     self.extraparams = [
         '-db-config-app-charset',
         charset,
         '-db-config-app-host',
         mysql_db.hostname(),
         '-db-config-app-port',
         str(mysql_db.port()),
         '-db-config-app-uname',
         mysql_db.username(),
         '-db-config-app-pass',
         mysql_db.password(),
         '-db-config-app-unixsocket',
         mysql_db.unix_socket(),
         '-queryserver-config-pool-size',
         '4',
         '-queryserver-config-transaction-cap',
         '4',
         '-queryserver-config-transaction-timeout',
         '300',
         '-queryserver-config-schema-reload-time',
         '60',
         '-queryserver-config-stream-pool-size',
         '4',
         '-topology',
         topology,
         '-mycnf_server_id',
         '1',
         '-mycnf_socket_file',
         mysql_db.unix_socket(),
     ] + environment.extra_vtcombo_parameters()