MySQL Cluster Multi Computer How To
This section is a “How-To
” that describes the basics
for how to plan, install, configure, and run a MySQL Cluster.
Whereas the examples in
Chapter 3, MySQL Cluster Configuration
provide more in-depth
information on a variety of clustering options and configuration,
the result of following the guidelines and procedures outlined here
should be a usable MySQL Cluster which meets the
minimum
requirements for availability and
safeguarding of data.
This section covers hardware and software requirements; networking
issues; installation of MySQL Cluster; configuration issues;
starting, stopping, and restarting the cluster; loading of a sample
database; and performing queries.
Basic assumptions.
This How-To
makes the following
assumptions:
The cluster is to be set up with four nodes, each on a separate
host, and each with a fixed network address on a typical
Ethernet network as shown here:
Node
IP Address
Management (MGMD) node
192.168.0.10
MySQL server (SQL) node
192.168.0.20
Data (NDBD) node "A"
192.168.0.30
Data (NDBD) node "B"
192.168.0.40
This may be made clearer in the following diagram:
In the interest of simplicity (and reliability), this
How-To
uses only numeric IP addresses.
However, if DNS resolution is available on your network, it is
possible to use host names in lieu of IP addresses in
configuring Cluster. Alternatively, you can use the
/etc/hosts
file or your operating
system's equivalent for providing a means to do host lookup
if such is available.
Note
A common problem when trying to use host names for Cluster
nodes arises because of the way in which some operating
systems (including some Linux distributions) set up the
system'
Ïà¹ØÎĵµ£º
1,ÔÚwindow×Ô´øµÄ·À»ðǽÀïµÄÀýÍâÌí¼Ó3306¶Ë¿Ú£¬ÎªTCP
2£¬½ñÌìÔÚÓÃÔ¶³ÌÁ¬½ÓMysql·þÎñÆ÷µÄÊý¾Ý¿â£¬²»¹ÜÔõôŪ¶¼ÊÇÁ¬½Ó²»µ½£¬´íÎó´úÂëÊÇ1130£¬ERROR 1130: Host 192.168.2.159 is not allowed to connect to this MySQL server
²ÂÏëÊÇÎÞ·¨¸øÔ¶³ÌÁ¬½ÓµÄÓû§È¨ÏÞÎÊÌâ¡£½á¹ûÕâÑù×Ó²Ù×÷mysql¿â£¬¼´¿É½â¾ö¡£ÔÚ±¾»úµÇÈëmysqlºó£¬¸ ......
¼ÇµÃÇ°ÌìÓÐÈËÎÊÎÒ£¬ Memcache ºÍ MySQL ×Ô¼ºµÄ Query Cache ÓÐɶÇø±ð? ÎÒÕâÑù»Ø´ðµÄ£¬Ç°ÕßÊÇɽկÖеÄÕ½¶·»ú£¬ºóÕßÊǹٷ½µÄÕ½¶·»ú¡£
ÐÂÊֻشðÎÊÌ⣬´íÁËĪ¹Ö¡£¹þ¹þ¹þ¡£
ºÃÏñϸ½ÚÉϵIJî±ð»¹ÊÇÓеġ£
MemcacheÓŵãÈçÏ£º
1. ÀíÂÛÉÏ¿ÉÒÔÖ§³ÅÎÞÏÞ²¢·¢ÒµÎñ²Ù×÷¡£
2. ¿ÉÒÔÆôÓõ¥¶ÀµÄʵÀýÀ´»º´æ¾Þ¶àµÄÊý¾Ý¡££¨µ± ......
ÔÚlinuxÏÂÃæ°²×°mysql£¬Ê×ÏàÒª¸ù¾Ý²Ù×÷ϵͳµÄ°æ±¾£¬Ñ¡Ôñ¶ÔÓ¦µÄmysqlµÄ°æ±¾£¬¹Ù·½ÍøÕ¾ÉÏÓзdz£Ã÷È·µÄ·ÖÀà
http://dev.mysql.com/downloads/
ÔÚÕâÀïÎÒʵÑéµÄ²Ù×÷ϵͳÊÇredhat linux
mysql ÓÃÁËÁ½¸ö°²×°°ü£¬Ò»¸öÊÇserver¶Ë£¬Ò»¸öÊÇclient,ÎÒÓõÄÊÇrpm°ü£¬°²×°µÄÖ¸Áî±È½Ï¼òµ¥¡£
MySQL-server-community-5.1.42-0.rhel4.i38 ......
²éѯÓï¾ä:
SELECT ×Ö¶ÎÃû from ±íÃû.
ÅÅÐò order by ÒªÅÅÐòµÄ×Ö¶ÎÃû desc :ÒÔµ¹Ðò²éѯ.
limit ´ÓµÚ¼¸¸ö¿ªÊ¼ ²éÕÒ¶àÉÙ¸ö :²éÕÒÖ¸¶¨¸öÊý.
ͬʱ²éѯ¶à¸ö×Ö¶ÎÓÃ","¸ô¿ª.
Èç²éѯ±íÀïÃæµÄËùÓÐÊý¾ÝÔÚ×Ö¶ÎÃû´¦Ìî"*".
ÈçÖ»ÏëÏÔʾij×ֶεÄÇ°¼¸Î»×Ö·û¿ÉÒÔʹÓÃLEFTº¯Êý.
SELECT ×Ö¶ÎÃû,LEFT(×Ö¶ÎÃû,λÊý),×Ö¶ÎÃû from ±íÃû.
COU ......
<?php
$db_name="new";
mysql_connect("localhost","root","123456");
mysql_select_db($db_name);
$tb=mysql_list_tables($db_name);
$sql="";
while($query=mysql_fetch_row($tb)){
$sql="";$table_sql="";
$sql.= get_table_fn($query[0]);
get_table_row($que ......