Thư viện tri thức trực tuyến
Kho tài liệu với 50,000+ tài liệu học thuật
© 2023 Siêu thị PDF - Kho tài liệu học thuật hàng đầu Việt Nam

High Availability MySQL Cookbook phần 2 pps
Nội dung xem thử
Mô tả chi tiết
Chapter 1
17
Creating an initial cluster configuration
file—config.ini
In this recipe, we will discuss the initial configuration required to start a MySQL Cluster.
A MySQL Cluster has a global configuration file—config.ini, which resides on all
management nodes. This file defines the nodes (processes) that make up the cluster
and the parameters that the nodes will use.
Each management node, when it starts, reads the config.ini file to get information on the
structure of the cluster and when other nodes (storage and SQL / API) start, they contact the
already-running management node to obtain the details of the cluster architecture.
The creation of this global configuration file—config.ini, is the first step in building the
cluster and this recipe looks at the initial configuration for this file. Later recipes will cover
more advanced parameters which you can define (typically to tune a cluster for specific
goals, such as performance).
How to do it…
The first step in building a cluster is to create a global cluster configuration file. This file,
called config.ini, by convention, is stored on each management node and is used by the
management node process to show the cluster makeup and define variables for each node.
In our example, we will store this in the file /usr/local/mysql-cluster/config.ini,
but it can be stored anywhere else.
The file consists of multiple sections. Each section contains parameters that apply to a
particular node, for example, the node's IP address or the amount of memory to reserve for
data. Each type of node (management, SQL, and data node) has an optional default section
to save duplicating the same parameter in each node. Each individual node that will make up
the cluster has its own sections, which inherits the defaults defined for its type and specifies
the additional parameters, or overrides the defaults.
This global configuration file is not complex, but is best analyzed with an example, and in
this recipe, we will create a simple cluster configuration file for this node. The first line to
add in the config.ini file is a block for this new management node:
[ndb_mgmd]
Now, we specify an ID for the node. This is absolutely not required, but can be
useful—particularly if you have multiple management nodes.
Id=1