5.2.6 The create site Command

create site {--hosts=|-h }host_list site_name

host_list:
    host[,host[,...]]

The create site command is used to create a MySQL Cluster Manager management site; that is, a set of MySQL Cluster Manager management agents running on one or more host computers. The command requires a list of one or more hosts where management agents are running and a name for the site. The host list is passed as the value of the --hosts option (short form: -h).

This is an example of a create site command that creates a site named mysite, consisting of the hosts tonfisk and flundra:

mcm> create site --hosts=tonfisk,flundra mysite;
+---------------------------+
| Command result            |
+---------------------------+
| Site created successfully |
+---------------------------+
1 row in set (0.31 sec)
Tip

You can verify that the site was created as intended, using the list sites command, as shown here:

mcm> list sites;
+--------+------+-------+-----------------+
| Site   | Port | Local | Hosts           |
+--------+------+-------+-----------------+
| mysite | 1862 | Local | tonfisk,flundra |
+--------+------+-------+-----------------+
1 row in set (0.06 sec)

(See Section 5.2.8, “The list sites Command”, for more information about this command.)

Agents must be running on all hosts specified in the --hosts option when create site is executed; otherwise, the command fails with the error Agent on host host:port is unavailable. The host where the agent used to issue the command is running must be one of the hosts listed. Otherwise, the command fails with the error Host host_name is not a member of site site_name.

Warning

Moreover, if the client and the agent it is connected to are on the same host, that host must be included in the host list using its host name or its own loopback address (which can be something other than 127.0.0.1 on some systems); otherwise, the cluster might become not restartable in the future.

A given agent may be a member of one site only; if one of the management agents specified in the host_list already belongs to a site, the command fails with the error Host host is already a member of site site.

Notes
  • Using localhost as the argument for the --hosts option will result in the creation of a single-host site (consisting of the host on which the command is run) that cannot be scaled up later by the add hosts command. Also notice that you cannot mix localhost with other host names in the host list. Therefore, it is recommended that you use IP addresses (but not any addresses belonging to the localhost subnet 127.*.*.*) or proper host names in the list.

  • When IPv6-enabled Windows systems are used as MySQL NDB Cluster hosts under MySQL Cluster Manager, you must reference these hosts using IPv4 addresses. Otherwise, MySQL Cluster Manager will be unable to connect to the agent processes on those hosts. See Section 6.1, “MySQL Cluster Manager Usage and Design Limitations”.