SlideShare a Scribd company logo
1 of 3
Download to read offline
MySQL Cluster Quick Start Guide –– Windows
   This guide is intended to help the reader get a simple MySQL Cluster database up and running on a single Windows server. Note that
   for a live deployment multiple hosts should be used to provide redundancy but a single host can be used to gain familiarity with MySQL
   Cluster; please refer to the final section for links to material that will help turn this into a production system.

   Note that there is an alternate approach to creating your first MySQL Cluster – MySQL Cluster Manager is a commercial tool that is
   available for a 30 day free trial and it allows you to deploy MySQL Cluster with a single command: http://www.clusterdb.com/mysql-
   cluster/mysql-cluster-manager-1-1-2-creating-a-cluster-is-now-trivial/

1 Get the software
   For Generally Available (GA), supported versions of the software, download from http://www.mysql.com/downloads/cluster/

   Make sure that you select the correct platform – in this case, “Microsoft Windows” and then the correct architecture (for Windows this
   means x86 32 or 64 bit).

   If you want to try out a pre-GA version then check http://dev.mysql.com/downloads/cluster/

   For commercial versions of the MySQL Cluster download from https://edelivery.oracle.com/

   Note: Only use MySQL Server executables (mysqlds) that come with the MySQL Cluster installation.

2 Install
   Locate the zip file ball that you’ve downloaded, and extract the contents (in this case
   to c:Usersuser1mysqlc)

   Optionally, you could add c:Usersuser1mysqlcbin to your path to avoid
   needing the full path when running the processes.

3 Configure
   For a first Cluster, start with a single MySQL Server (mysqld), a pair of Data Nodes
   (ndbd) and a single management node (ndb_mgmd) – all running on the same server.

   Create folders to store the configuration files and the data files:

   C:Usersuser1> mkdir my_cluster my_clusterndb_data my_clustermysqld_data my_clusterconf
   my_clustermysqld_datamysql my_clustermysqld_datandbinfo

   In the conf folder, create 2 files (note that “/home/user1” should be replaced with your home directory):

      my.cnf:
      [mysqld]
      ndbcluster
      datadir=c:Usersuser1my_clustermysqld_data
      basedir=c:Usersuser1mysqlc
      port=5000

      config.ini:

      [ndb_mgmd]
      hostname=localhost
      datadir=c:Usersuser1my_clusterndb_data
      NodeId=1

      [ndbd default]
      noofreplicas=2
      datadir=c:Usersuser1my_clusterndb_data

      [ndbd]
      hostname=localhost
      NodeId=3



             Copyright © 2010, 2011 Oracle and/or its affiliates. All rights reserved.
[ndbd]
        hostname=localhost
        NodeId=4

        [mysqld]
        NodeId=50

    Note that in a production system there are other parameters that you would set to tune the configuration.

    Just like any other MySQL Server, the mysqld process requires a ‘mysql’ database to be created and populated with essential system
    data (and for MySQL Cluster 7.1, you also want the new ndbinfo database). These can be copied from the data folder in the MySQL
    Cluster installation:

        C:Usersuser1>copy mysqlcdatamysql my_clustermysqld_datamysql
        C:Usersuser1>copy mysqlcdatandbinfo my_clustermysqld_datandbinfo


4 Run
    Before starting any processes, ensure that ports 5000 and 1186 are not blocked by your firewall.

    The processes should be started in the order of management node, data nodes & then MySQL Server:

        C:Usersuser1>cd my_cluster
        C:Usersuser1my_cluster>start /B c:Usersuser1mysqlcbinndb_mgmd -f confconfig.ini --initial --
        configdir=c:Usersuser1my_clusterconf
        C:Usersuser1my_cluster>start /B c:Usersuser1mysqlcbinndbd -c localhost:1186
        C:Usersuser1my_cluster>start /B c:Usersuser1mysqlcbinndbd -c localhost:1186

    Check the status of the Cluster and wait for the Data Nodes to finish starting before starting the MySQL Server:

        C:Usersuser1my_cluster> c:Usersuser1mysqlcbinndb_mgm -e show

                  Connected to Management Server at: localhost:1186
                  Cluster Configuration
                  ---------------------
                  [ndbd(NDB)]     2 node(s)
                  id=3    @127.0.0.1 (mysql-5.1.44 ndb-7.1.3, starting, Nodegroup: 0, Master)
                  id=4    @127.0.0.1 (mysql-5.1.44 ndb-7.1.3, starting, Nodegroup: 0)

                  [ndb_mgmd(MGM)] 1 node(s)
                  id=1    @localhost (mysql-5.1.44 ndb-7.1.3)

                  [mysqld(API)]   1 node(s)
                  id=50 (not connected, accepting connect from any host)

        c:Usersuser1my_cluster>start /B c:Usersuser1mysqlcbinmysqld --defaults-file=confmy.cnf


5 Test
    Connect to the MySQL Server and confirm that a table can be created that uses the ndb (MySQL Cluster) storage engine:

        c:Usersuser1my_cluster>c:Usersuser1mysqlcbinmysql -h 127.0.0.1 -P5000 -u root
        mysql> create database clusterdb;use clusterdb;
        mysql> create table simples (id int not null primary key) engine=ndb;
        mysql> insert into simples values (1),(2),(3),(4);
        mysql> select * from simples;

                  +----+
                  | id |
                  +----+
                  | 1 |
                  | 2 |
                  | 3 |
                  | 4 |
                  +----+


6 Safely shut down
    The MySQL Server must be shut down manually but then the other Cluster nodes can be stopped using the ndb_mgm tool:


Copyright © 2010, 2011 Oracle and/or its affiliates. All rights reserved.                                Page 2 of 3
C:Usersuser1my_cluster> c:Usersuser1mysqlcbinmysqladmin -u root -h 127.0.0.1 –P5000 shutdown
        C:Usersuser1my_cluster>c:Usersuser1mysqlcbinndb_mgm -e shutdown


7 For further information

    MySQL Cluster Evaluation Guide (http://www.mysql.com/why-mysql/white-papers/mysql_cluster_eval_guide.php) In this whitepaper
    learn the fundamentals of how to design and select the proper components for a successful MySQL Cluster evaluation.

    MySQL Cluster Performance Optimization Guide (http://www.mysql.com/why-mysql/white-papers/mysql_wp_cluster_perfomance.php)
    In this guide, learn how to tune and optimize the MySQL Cluster database to handle diverse workload requirements.

    MySQL Cluster Documentation (http://dev.mysql.com/doc/index-cluster.html)




Copyright © 2010, 2011 Oracle and/or its affiliates. All rights reserved.                       Page 3 of 3

More Related Content

What's hot

Elasticsearch 1.x Cluster Installation (VirtualBox)
Elasticsearch 1.x Cluster Installation (VirtualBox)Elasticsearch 1.x Cluster Installation (VirtualBox)
Elasticsearch 1.x Cluster Installation (VirtualBox)Amir Sedighi
 
Distributed Data Processing Workshop - SBU
Distributed Data Processing Workshop - SBUDistributed Data Processing Workshop - SBU
Distributed Data Processing Workshop - SBUAmir Sedighi
 
Installing postgres & postgis
Installing postgres & postgisInstalling postgres & postgis
Installing postgres & postgisJohn Ashmead
 
MyAWR another mysql awr
MyAWR another mysql awrMyAWR another mysql awr
MyAWR another mysql awrLouis liu
 
Drupal MySQL Cluster
Drupal MySQL ClusterDrupal MySQL Cluster
Drupal MySQL ClusterKris Buytaert
 
My sql fabric ha and sharding solutions
My sql fabric ha and sharding solutionsMy sql fabric ha and sharding solutions
My sql fabric ha and sharding solutionsLouis liu
 
Los Angeles R users group - Dec 14 2010 - Part 2
Los Angeles R users group - Dec 14 2010 - Part 2Los Angeles R users group - Dec 14 2010 - Part 2
Los Angeles R users group - Dec 14 2010 - Part 2rusersla
 
MySQL Tokudb engine benchmark
MySQL Tokudb engine benchmarkMySQL Tokudb engine benchmark
MySQL Tokudb engine benchmarkLouis liu
 
An Introduction to Elasticsearch for Beginners
An Introduction to Elasticsearch for BeginnersAn Introduction to Elasticsearch for Beginners
An Introduction to Elasticsearch for BeginnersAmir Sedighi
 
HandlerSocket plugin for MySQL (English)
HandlerSocket plugin for MySQL (English)HandlerSocket plugin for MySQL (English)
HandlerSocket plugin for MySQL (English)akirahiguchi
 
Advanced Replication
Advanced ReplicationAdvanced Replication
Advanced ReplicationMongoDB
 
Elastic 101 tutorial - Percona Europe 2018
Elastic 101 tutorial - Percona Europe 2018 Elastic 101 tutorial - Percona Europe 2018
Elastic 101 tutorial - Percona Europe 2018 Antonios Giannopoulos
 
Replication and replica sets
Replication and replica setsReplication and replica sets
Replication and replica setsRandall Hunt
 
Recent my sql_performance Test detail
Recent my sql_performance Test detailRecent my sql_performance Test detail
Recent my sql_performance Test detailLouis liu
 
IBM DB2 LUW UDB DBA Training by www.etraining.guru
IBM DB2 LUW UDB DBA Training by www.etraining.guruIBM DB2 LUW UDB DBA Training by www.etraining.guru
IBM DB2 LUW UDB DBA Training by www.etraining.guruRavikumar Nandigam
 
MySQL cluster workshop
MySQL cluster workshopMySQL cluster workshop
MySQL cluster workshop郁萍 王
 
REDIS intro and how to use redis
REDIS intro and how to use redisREDIS intro and how to use redis
REDIS intro and how to use redisKris Jeong
 

What's hot (20)

Elasticsearch 1.x Cluster Installation (VirtualBox)
Elasticsearch 1.x Cluster Installation (VirtualBox)Elasticsearch 1.x Cluster Installation (VirtualBox)
Elasticsearch 1.x Cluster Installation (VirtualBox)
 
Distributed Data Processing Workshop - SBU
Distributed Data Processing Workshop - SBUDistributed Data Processing Workshop - SBU
Distributed Data Processing Workshop - SBU
 
Installing postgres & postgis
Installing postgres & postgisInstalling postgres & postgis
Installing postgres & postgis
 
MyAWR another mysql awr
MyAWR another mysql awrMyAWR another mysql awr
MyAWR another mysql awr
 
Drupal MySQL Cluster
Drupal MySQL ClusterDrupal MySQL Cluster
Drupal MySQL Cluster
 
My sql fabric ha and sharding solutions
My sql fabric ha and sharding solutionsMy sql fabric ha and sharding solutions
My sql fabric ha and sharding solutions
 
Los Angeles R users group - Dec 14 2010 - Part 2
Los Angeles R users group - Dec 14 2010 - Part 2Los Angeles R users group - Dec 14 2010 - Part 2
Los Angeles R users group - Dec 14 2010 - Part 2
 
MySQL Tokudb engine benchmark
MySQL Tokudb engine benchmarkMySQL Tokudb engine benchmark
MySQL Tokudb engine benchmark
 
An Introduction to Elasticsearch for Beginners
An Introduction to Elasticsearch for BeginnersAn Introduction to Elasticsearch for Beginners
An Introduction to Elasticsearch for Beginners
 
HandlerSocket plugin for MySQL (English)
HandlerSocket plugin for MySQL (English)HandlerSocket plugin for MySQL (English)
HandlerSocket plugin for MySQL (English)
 
Mydumper
MydumperMydumper
Mydumper
 
Advanced Replication
Advanced ReplicationAdvanced Replication
Advanced Replication
 
Elastic 101 tutorial - Percona Europe 2018
Elastic 101 tutorial - Percona Europe 2018 Elastic 101 tutorial - Percona Europe 2018
Elastic 101 tutorial - Percona Europe 2018
 
Replication and replica sets
Replication and replica setsReplication and replica sets
Replication and replica sets
 
Recent my sql_performance Test detail
Recent my sql_performance Test detailRecent my sql_performance Test detail
Recent my sql_performance Test detail
 
LSA2 - 02 Namespaces
LSA2 - 02  NamespacesLSA2 - 02  Namespaces
LSA2 - 02 Namespaces
 
IBM DB2 LUW UDB DBA Training by www.etraining.guru
IBM DB2 LUW UDB DBA Training by www.etraining.guruIBM DB2 LUW UDB DBA Training by www.etraining.guru
IBM DB2 LUW UDB DBA Training by www.etraining.guru
 
2 db2 instance creation
2 db2 instance creation2 db2 instance creation
2 db2 instance creation
 
MySQL cluster workshop
MySQL cluster workshopMySQL cluster workshop
MySQL cluster workshop
 
REDIS intro and how to use redis
REDIS intro and how to use redisREDIS intro and how to use redis
REDIS intro and how to use redis
 

Similar to Get mysql clusterrunning-windows

BITS: Introduction to MySQL - Introduction and Installation
BITS: Introduction to MySQL - Introduction and InstallationBITS: Introduction to MySQL - Introduction and Installation
BITS: Introduction to MySQL - Introduction and InstallationBITS
 
MySQL 101 PHPTek 2017
MySQL 101 PHPTek 2017MySQL 101 PHPTek 2017
MySQL 101 PHPTek 2017Dave Stokes
 
My First 100 days with a MySQL DBMS (WP)
My First 100 days with a MySQL DBMS (WP)My First 100 days with a MySQL DBMS (WP)
My First 100 days with a MySQL DBMS (WP)Gustavo Rene Antunez
 
MySQL replication & cluster
MySQL replication & clusterMySQL replication & cluster
MySQL replication & clusterelliando dias
 
MySQL database replication
MySQL database replicationMySQL database replication
MySQL database replicationPoguttuezhiniVP
 
MySQL cluster 72 in the Cloud
MySQL cluster 72 in the CloudMySQL cluster 72 in the Cloud
MySQL cluster 72 in the CloudMarco Tusa
 
MySQL for Oracle DBAs
MySQL for Oracle DBAsMySQL for Oracle DBAs
MySQL for Oracle DBAsMark Leith
 
All types of backups and restore
All types of backups and restoreAll types of backups and restore
All types of backups and restoreVasudeva Rao
 
Getting started with my sql
Getting started with my sqlGetting started with my sql
Getting started with my sqlWeb Sky
 
Restore MySQL database from mysqlbackup
Restore MySQL database from mysqlbackup Restore MySQL database from mysqlbackup
Restore MySQL database from mysqlbackup AllDatabaseSolutions
 
Advanced Ops Manager Topics
Advanced Ops Manager TopicsAdvanced Ops Manager Topics
Advanced Ops Manager TopicsMongoDB
 
Architecting cloud
Architecting cloudArchitecting cloud
Architecting cloudTahsin Hasan
 

Similar to Get mysql clusterrunning-windows (20)

My SQL 101
My SQL 101My SQL 101
My SQL 101
 
MySQL Cluster Basics
MySQL Cluster BasicsMySQL Cluster Basics
MySQL Cluster Basics
 
Mysql all
Mysql allMysql all
Mysql all
 
Mysql
Mysql Mysql
Mysql
 
Mysql all
Mysql allMysql all
Mysql all
 
BITS: Introduction to MySQL - Introduction and Installation
BITS: Introduction to MySQL - Introduction and InstallationBITS: Introduction to MySQL - Introduction and Installation
BITS: Introduction to MySQL - Introduction and Installation
 
MySQL 101 PHPTek 2017
MySQL 101 PHPTek 2017MySQL 101 PHPTek 2017
MySQL 101 PHPTek 2017
 
My First 100 days with a MySQL DBMS (WP)
My First 100 days with a MySQL DBMS (WP)My First 100 days with a MySQL DBMS (WP)
My First 100 days with a MySQL DBMS (WP)
 
MySQL replication & cluster
MySQL replication & clusterMySQL replication & cluster
MySQL replication & cluster
 
Mysql-Basics.pptx
Mysql-Basics.pptxMysql-Basics.pptx
Mysql-Basics.pptx
 
MySQL database replication
MySQL database replicationMySQL database replication
MySQL database replication
 
MySQL cluster 72 in the Cloud
MySQL cluster 72 in the CloudMySQL cluster 72 in the Cloud
MySQL cluster 72 in the Cloud
 
MySQL for Oracle DBAs
MySQL for Oracle DBAsMySQL for Oracle DBAs
MySQL for Oracle DBAs
 
All types of backups and restore
All types of backups and restoreAll types of backups and restore
All types of backups and restore
 
Getting started with my sql
Getting started with my sqlGetting started with my sql
Getting started with my sql
 
Restore MySQL database from mysqlbackup
Restore MySQL database from mysqlbackup Restore MySQL database from mysqlbackup
Restore MySQL database from mysqlbackup
 
Advanced Ops Manager Topics
Advanced Ops Manager TopicsAdvanced Ops Manager Topics
Advanced Ops Manager Topics
 
Architecting cloud
Architecting cloudArchitecting cloud
Architecting cloud
 
Mysql ppt
Mysql pptMysql ppt
Mysql ppt
 
My sql basic
My sql basicMy sql basic
My sql basic
 

Get mysql clusterrunning-windows

  • 1. MySQL Cluster Quick Start Guide –– Windows This guide is intended to help the reader get a simple MySQL Cluster database up and running on a single Windows server. Note that for a live deployment multiple hosts should be used to provide redundancy but a single host can be used to gain familiarity with MySQL Cluster; please refer to the final section for links to material that will help turn this into a production system. Note that there is an alternate approach to creating your first MySQL Cluster – MySQL Cluster Manager is a commercial tool that is available for a 30 day free trial and it allows you to deploy MySQL Cluster with a single command: http://www.clusterdb.com/mysql- cluster/mysql-cluster-manager-1-1-2-creating-a-cluster-is-now-trivial/ 1 Get the software For Generally Available (GA), supported versions of the software, download from http://www.mysql.com/downloads/cluster/ Make sure that you select the correct platform – in this case, “Microsoft Windows” and then the correct architecture (for Windows this means x86 32 or 64 bit). If you want to try out a pre-GA version then check http://dev.mysql.com/downloads/cluster/ For commercial versions of the MySQL Cluster download from https://edelivery.oracle.com/ Note: Only use MySQL Server executables (mysqlds) that come with the MySQL Cluster installation. 2 Install Locate the zip file ball that you’ve downloaded, and extract the contents (in this case to c:Usersuser1mysqlc) Optionally, you could add c:Usersuser1mysqlcbin to your path to avoid needing the full path when running the processes. 3 Configure For a first Cluster, start with a single MySQL Server (mysqld), a pair of Data Nodes (ndbd) and a single management node (ndb_mgmd) – all running on the same server. Create folders to store the configuration files and the data files: C:Usersuser1> mkdir my_cluster my_clusterndb_data my_clustermysqld_data my_clusterconf my_clustermysqld_datamysql my_clustermysqld_datandbinfo In the conf folder, create 2 files (note that “/home/user1” should be replaced with your home directory): my.cnf: [mysqld] ndbcluster datadir=c:Usersuser1my_clustermysqld_data basedir=c:Usersuser1mysqlc port=5000 config.ini: [ndb_mgmd] hostname=localhost datadir=c:Usersuser1my_clusterndb_data NodeId=1 [ndbd default] noofreplicas=2 datadir=c:Usersuser1my_clusterndb_data [ndbd] hostname=localhost NodeId=3 Copyright © 2010, 2011 Oracle and/or its affiliates. All rights reserved.
  • 2. [ndbd] hostname=localhost NodeId=4 [mysqld] NodeId=50 Note that in a production system there are other parameters that you would set to tune the configuration. Just like any other MySQL Server, the mysqld process requires a ‘mysql’ database to be created and populated with essential system data (and for MySQL Cluster 7.1, you also want the new ndbinfo database). These can be copied from the data folder in the MySQL Cluster installation: C:Usersuser1>copy mysqlcdatamysql my_clustermysqld_datamysql C:Usersuser1>copy mysqlcdatandbinfo my_clustermysqld_datandbinfo 4 Run Before starting any processes, ensure that ports 5000 and 1186 are not blocked by your firewall. The processes should be started in the order of management node, data nodes & then MySQL Server: C:Usersuser1>cd my_cluster C:Usersuser1my_cluster>start /B c:Usersuser1mysqlcbinndb_mgmd -f confconfig.ini --initial -- configdir=c:Usersuser1my_clusterconf C:Usersuser1my_cluster>start /B c:Usersuser1mysqlcbinndbd -c localhost:1186 C:Usersuser1my_cluster>start /B c:Usersuser1mysqlcbinndbd -c localhost:1186 Check the status of the Cluster and wait for the Data Nodes to finish starting before starting the MySQL Server: C:Usersuser1my_cluster> c:Usersuser1mysqlcbinndb_mgm -e show Connected to Management Server at: localhost:1186 Cluster Configuration --------------------- [ndbd(NDB)] 2 node(s) id=3 @127.0.0.1 (mysql-5.1.44 ndb-7.1.3, starting, Nodegroup: 0, Master) id=4 @127.0.0.1 (mysql-5.1.44 ndb-7.1.3, starting, Nodegroup: 0) [ndb_mgmd(MGM)] 1 node(s) id=1 @localhost (mysql-5.1.44 ndb-7.1.3) [mysqld(API)] 1 node(s) id=50 (not connected, accepting connect from any host) c:Usersuser1my_cluster>start /B c:Usersuser1mysqlcbinmysqld --defaults-file=confmy.cnf 5 Test Connect to the MySQL Server and confirm that a table can be created that uses the ndb (MySQL Cluster) storage engine: c:Usersuser1my_cluster>c:Usersuser1mysqlcbinmysql -h 127.0.0.1 -P5000 -u root mysql> create database clusterdb;use clusterdb; mysql> create table simples (id int not null primary key) engine=ndb; mysql> insert into simples values (1),(2),(3),(4); mysql> select * from simples; +----+ | id | +----+ | 1 | | 2 | | 3 | | 4 | +----+ 6 Safely shut down The MySQL Server must be shut down manually but then the other Cluster nodes can be stopped using the ndb_mgm tool: Copyright © 2010, 2011 Oracle and/or its affiliates. All rights reserved. Page 2 of 3
  • 3. C:Usersuser1my_cluster> c:Usersuser1mysqlcbinmysqladmin -u root -h 127.0.0.1 –P5000 shutdown C:Usersuser1my_cluster>c:Usersuser1mysqlcbinndb_mgm -e shutdown 7 For further information MySQL Cluster Evaluation Guide (http://www.mysql.com/why-mysql/white-papers/mysql_cluster_eval_guide.php) In this whitepaper learn the fundamentals of how to design and select the proper components for a successful MySQL Cluster evaluation. MySQL Cluster Performance Optimization Guide (http://www.mysql.com/why-mysql/white-papers/mysql_wp_cluster_perfomance.php) In this guide, learn how to tune and optimize the MySQL Cluster database to handle diverse workload requirements. MySQL Cluster Documentation (http://dev.mysql.com/doc/index-cluster.html) Copyright © 2010, 2011 Oracle and/or its affiliates. All rights reserved. Page 3 of 3