mysql CLUTER自动安装

  1. Installing a Localhost MySQL Cluster
  2. Requirements
  3. Download the script
  4. Step 1. Store the script in a user writable directory
    1. Make the script executable
  5.  
  6. Step 2. Non-root Installation
  7. Step 3. Choose your Computer Architecture
  8. Step 4. Choose the Localhost Installation Option
  9. Step 4. Download MySQL Binaries
  10. Step 5. Store the MySQL Binaries in a User-Level Directory ( …
  11. Step 6. Store NDB Data in a User-Level Directory ( ~/.mysql/ndb[-version] …
  12. Step 7. Setup Symbolic Links to MySQL Binaries and NDB Data Directory
  13. Step 8. Configure Cluster Variables
  14. Step 9. Install MySQL Server Option
  15. Step 10. Configure MySQL Server Socket and Port
  16. Step 11. The MySQL Default Databases are Installed
  17. Step 12. Start the Cluster Running
  18. Step 13. Instructions for Using the Cluster
  19. Directory Layout of your Installation 

Download the script

Option 1 (Browser-based): Right-Click here and click "Save Link as" and save the ndbinstaller.sh file in a local directory (for example, /tmp/).

Option 2 (Command-line):

wget http://www.jimdowling.info/ndbinstaller/ndbinstaller.sh
# or
svn co http://www.jimdowling.info/ndbinstaller/

Step 1. Store the script in a user writable directory

cd $HOME
mkdir ndbinstaller
cp ~/Desktop/ndbinstaller.sh ndbinstaller

Make the script executable

chmod +x ndbinstaller.sh
./ndbinstaller.sh

Setup Script for Installation

Step 2. Non-root Installation

Check the text on the installation screen to make sure you are installing the cluster as a normal user.

It should display the following line:

"You are running install as non-root user"

Step 3. Choose your Computer Architecture

If you have a pentium processor, choose option 1. If you a Pentium D or AMD processor, choose option 2.

Step 4. Choose the Localhost Installation Option

Choose the localhost installation option. You can find out more information about the options by pressing the 'h' key.

Step 4. Download MySQL Binaries

Do you have to go through a proxy to access the Internet?

If you do not, select 'n'. If you do, select 'y', and then enter the address of the proxy server, your username and password.

If the binaries were successfully downloaded, they should be unzipped, with a subsequent Information Step:

Step 5. Store the MySQL Binaries in a User-Level Directory ( ~/.mysql/mysql[-version] by default)

Step 6. Store NDB Data in a User-Level Directory ( ~/.mysql/ndb[-version] by default)

Step 7. Setup Symbolic Links to MySQL Binaries and NDB Data Directory

This step is useful when managing multiple versions of cluster, or when programing cluster. After installation, you can set NDB_HOME environment variable to point to the symbolic link

export NDB_HOME=/home/yourusername/.mysql/ndb/

Step 8. Configure Cluster Variables

This is an important step for configuring your cluster.

You can configure parameters such as:

  • How many copies of the data (Number of Replicas) should be stored in the cluster? The more replicas, the lower the chance that your cluster will fail because a node in the cluster has failed. If you have only 1 Replica of the data, and a Data Node fails, then the cluster will fail. There needs to be at least one copy of the data available in the cluster, otherwise the cluster will shutdown.
  • Here we choose the default "2 Replicas". So if a single Data Node fails, our cluster will still have a copy of the data available, and the cluster will continue to function correctly. The failed data node, can later be restarted to rejoin the cluster.
  • Here you can setup the amount (in RAM) of Data Memory you want your data nodes to store. The default value of 80MB is quite low. Here, we'll increase it to 512MB RAM per data node. Your localhost should have at least 2GB of available RAM for this: we will install 2 Data Nodes on this machine, and we need space for Index Memory and some overhead for the operating system.
  • The installer recalculates the recommended amount of Index Memory required based on the size of Data Memory we entered (1/5th the size of Data Memory). Here we accept the suggested size of Index Memory.

  • If you're not sure what the NumFragmentLogFiles parameter means, use the help function. Help tells you that this variable represents how big my Redo Log on disk could become. Do I have 3072MB of disk space available? If yes, I'll accept it. You may choose a lower or higher number depending on your requirements.
  • I will also accept the default suggestions for the other parameters, details for which can be found in the MySQL Cluster Manual

A Summary of your Configuration of the Cluster is then displayed:

You can edit your configuration after installation by updating the $NDB_HOME/config-X.ini file(s):

Step 9. Install MySQL Server Option

This step involves setting up the data directories for a MySQL Server:

Step 10. Configure MySQL Server Socket and Port

Configure the MySQL Server (settings written to a my-[version].cnf file in $NDB_HOME): Default values are normally ok, unless you are already running a MySQL Server on this machine - in which case you should change the location of the socket and the port number.

Step 11. The MySQL Default Databases are Installed

The mysql_install_db script is run to install the default databases in the MySQL Server.

Step 12. Start the Cluster Running

This step allows you to choose the size of cluster you want to start (only 2-node and 4-node clusters are supported for localhost installations).

Step 13. Instructions for Using the Cluster

This step tells the user some simple commands for initialising the cluster, starting the cluster (after it has been initialised), shutting down the cluster, and observing the cluster,

Directory Layout of your Installation

Your directory layout should look like the following:

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值