Safe Shutdown and Restart of MySQL Cluster
To shut down the cluster, enter the following command in a shell
on the machine hosting the management node:
shell> ndb_mgm -e shutdown
The -e
option here is used to pass a command to
the ndb_mgm
client from the shell. (See
Section 4.23, “Options Common to MySQL Cluster Programs”
, for more
information about this option.) The command causes the
ndb_mgm
, ndb_mgmd
, and any
ndbd
processes to terminate gracefully. Any SQL
nodes can be terminated using mysqladmin
shutdown
and other means.
To restart the cluster, run these commands:
On the management host (192.168.0.10
in our
example setup):
shell> ndb_mgmd -f /var/lib/mysql-cluster/config.ini
On each of the data node hosts
(192.168.0.30
and
192.168.0.40
):
shell> ndbd
On the SQL host (192.168.0.20
):
shell> mysqld_safe &
In a production setting, it is usually not desirable to shut down
the cluster completely. In many cases, even when making
configuration changes, or performing upgrades to the cluster
hardware or software (or both), which require shutting down
individual host machines, it is possible to do so without shutting
down the cluster as a whole by performing a rolling
restart
of the cluster. For more information about
doing this, see Section 2.6.1, “Performing a Rolling Restart of a MySQL Cluster”
.
Ïà¹ØÎĵµ£º
Æô¶¯Mysql ´íÎó 1067 ½ø³ÌÒâÍâÖÕÖ¹µÄÒ»ÖÖ½â¾ö·½·¨
mysqld-nt --defaults-file=my.ini --standalone --console
²é¿´ÐÅÏ¢ÄÚÈÝ
·¢ÏÖMYSQL INNODB³õʼ»¯´íÎó¡£
´íÎóÈçÏ£º
InnoDB: The first specified data file .\ibdata1 did not exist:
InnoDB: a new database to be created!
100115 10:14:04 InnoDB: Setti ......
my.cnf »òÕßÊÇ my.ini
ÔÚ[MySQL(ºÍPHP´îÅäÖ®×î¼Ñ×éºÏ)d]ÅäÖöÎÌí¼Ó£º
max_connections = 1000
±£´æ£¬ÖØÆôMySQL(ºÍPHP´îÅäÖ®×î¼Ñ×éºÏ)·þÎñ¡£
È»ºóÓÃÃüÁ
MySQL(ºÍPHP´îÅäÖ®×î¼Ñ×éºÏ)admin -uroot -p variables
ÊäÈërootÊý¾Ý¿âÕ˺ŵÄÃÜÂëºó¿É¿´µ½
| max_connections | 1000 |
Æô¶¯mysql·þÎñ
RedHat ......
>>mysql:
1¡¢²é¿´ËùÓбíÃû£º
show tables [from db_name];
2¡¢²é¿´×Ö¶ÎÐÅÏ¢
SHOW FULL COLUMNS from db_name.table_name
»ñÈ¡ÒÔÏÂÐÅÏ¢
Field £º×Ö¶ÎÃû
Type£º×Ö¶ÎÀàÐÍ
Collation£º×Ö·û¼¯ £¨mysql 5.0ÒÔÉÏÓУ©
Null £ºÊÇ·ñ¿ÉÒÔΪNULL
Key£ºË÷Òý£¨PRI,unique,index)
Default£ºÈ±Ê¡Öµ
Extra£º¶îÍ⣨ÊÇ·ñ aut ......
ÔÚ±¾ÎÄÖУ¬ÎÒÃǽ«Ñ§Ï°ÈçºÎͨ¹ýPHP 5µÄÒ»¸ö»ù±¾³éÏóÀàʹÓÃÍâ¼üÔ¼ÊøÀ´¸üÐÂÁ½¸öInnoDB±íµÄÊý¾Ý¡£ ÎÒÃǽ«Í¨¹ý¾ßÌåʾÀýÀ´ËµÃ÷ÈçºÎͨ¹ý·þÎñÆ÷¶Ë½Å±¾ÓïÑÔÀ´Ê¹ÓÃÍâ¼üÔ¼Êø¡£
¡¡¡¡Ò»¡¢ÀûÓÃÍâ¼üÔ¼Êø¸üÐÂMySQLÖеÄÊý¾Ý
¡¡¡¡ÏÖÔÚ£¬×îÁ÷ÐеĿªÔ´¹ØÏµÐÍÊý¾Ý¿â¹ÜÀíϵͳ·ÇMySQLĪÊô£¬¶øMySQLÓÖÖ§³Ö¶à¸ö´æ´¢ÒýÇæ£¬ÆäÖÐĬÈϵÄÒ²ÊÇËٶȽϿìµÄ´ ......
Starting the cluster is not very difficult after it has been configured. Each cluster node process must be started separately, and on the host where it resides. The management node should be started first, followed by the data nodes, and then finally by any SQL nodes:
On the management host, issu ......