MySQL Cluster Multi Computer Configuration
For our four-node, four-host MySQL Cluster, it is necessary to
write four configuration files, one per node host.
Each data node or SQL node requires a
my.cnf
file that provides two pieces of
information: a connectstring
that tells
the node where to find the management node, and a line telling
the MySQL server on this host (the machine hosting the data
node) to enable the NDBCLUSTER
storage engine.
For more information on connectstrings, see
Section 3.2.3, “The MySQL Cluster Connectstring”
.
The management node needs a config.ini
file telling it how many replicas to maintain, how much memory
to allocate for data and indexes on each data node, where to
find the data nodes, where to save data to disk on each data
node, and where to find any SQL nodes.
Configuring the Storage and SQL
Nodes
The my.cnf
file needed for the data nodes is
fairly simple. The configuration file should be located in the
/etc
directory and can be edited using any
text editor. (Create the file if it does not exist.) For example:
shell> vi /etc/my.cnf
Note
We show vi
being used here to create the
file, but any text editor should work just as well.
For each data node and SQL node in our example setup,
my.cnf
should look like this:
# Options for mysqld process:
[mysqld]
ndbcluster # run NDB storage engine
ndb-connectstring=192.168.0.10 # location of management server
# Options for ndbd process:
[mysql_cluster]
ndb-connectstring=192.168.0.10 # location of management server
After entering the preceding information, save this file and exit
the text editor. Do this for the machines hosting data node
“A
”,
Ïà¹ØÎĵµ£º
¡¡Õâ´ÎÊÇFotolog
µÄ¾Ñ飬´«ËµÖбÈFlickr¸ü´óµÄÍøÕ¾
£¬FotologÔÚ21̨·þÎñ
Æ÷Éϲ¿ÊðÁË51¸ömemcachedʵÀý£¬×ܼÆÓÐ254G»º´æ¿Õ¼ä
¿ÉÓ㬻º´æÁ˶à´ï175GµÄÄÚÈÝ£¬Õâ¸öÊýÁ¿±ÈºÜ¶àÍøÕ¾µÄÊý¾Ý¿â¶¼Òª´óµÄ¶à£¬ÔÎÄÊÇA Bunch of Great Strategies for Using Memcached and MySQL Better Together
£¬ÎÒÕâÀﻹÊÇÑ¡ÔñÐԵķÒëÒÔ¼°°´ÕÕ ......
ÀïÊÇÒ»¸öʹÓÃÈÕÆÚº¯ÊýµÄÀý×Ó¡£ÏÂÃæµÄ²éѯѡÔñÁËËùÓмǼ£¬Æädate_colµÄÖµÊÇÔÚ×îºó30ÌìÒÔÄÚ£º
¡¡¡¡mysql> SELECT something from table
¡¡¡¡WHERE TO_DAYS(NOW()) - TO_DAYS(date_col) <= 30;
select TO_DAYS(NOW());
select now() ;
¡¡¡¡DAYOFWEEK( ......
Æô¶¯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 ......
mysql ´ó¶ÔÏó´æÈ¡:
ÀàÐÍÒ»°ãÓ¦¸ÃÓÃmediumblod,
blobÖ»ÄÜ´æ2µÄ16´Î·½¸öbyte,
mediumblodÊÇ24´Î·½,
Ò»°ãÀ´Ëµ¹»ÓÃÁË.longblobÊÇ32´Î·½ÓÐЩ´ó.
MYSQLĬÈÏÅäÖÃÖ»ÄÜ´æ1M´óСµÄÎļþ,ÒªÐÞ¸ÄÅäÖÃ,WIN°æ±¾µÄÔÚmysql.iniÎļþÖÐ
ÐÞ¸Ämax_allowed_packet,net_buffer_lengthµÈ¼¸¸ö²ÎÊý,»òÖ±½ÓSET GLOBAL varName=value.
linux°æ± ......
Each MySQL Cluster host computer running an SQL node must have
installed on it a MySQL binary. For management nodes and data
nodes, it is not necessary to install the MySQL server binary, but
management nodes require the management server daemon
......