• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

Converters/H03-May-2022-

impl/H28-Aug-2020-12,7027,805

test/H03-May-2022-579

README.mdH A D28-Aug-20206.2 KiB12994

package.jsonH A D28-Aug-20201.1 KiB4137

README.md

1Jones-NDB
2=========
3
4Introduction
5------------
6Jones-NDB is the Database Jones service provider for MySQL Cluster.
7
8Jones-NDB uses C++ native code to link with the NDB API and provide direct,
9high-performance access to MySQL Cluster. A Node.js process running jones-ndb
10will join the cluster as an API node. All data operations are executed with
11direct communication between this API node and the NDB data nodes where the
12data is stored.  The MySQL node of the cluster is not used for data operations,
13only for metadata operations such as CREATE and DROP table.
14
15In order to support these metadata operations, Jones-Ndb relies on [Jones-MySQL](../jones-mysql) as a dependency.
16
17
18Building Jones-NDB
19------------------
20The C++ native code component of Jones-NDB must be built before it can be used
21by JavaScript.  This component shared library file object file is named
22ndb_adapter.node.  Jones-NDB is built with node-gyp, the Node.JS build tool.
23You can download and install node-gyp via npm:
24  + `npm install -g node-gyp`
25
26You can build the adapter by running the following commands.
27  + Change to the top-level "jones-ndb" directory:
28    + `cd path-to/jones/jones-ndb`
29
30+ The configure script is an interactive program that will prompt you to enter the path to an installed version of MySQL Cluster that includes NDB API header files and shared libraries.  It supports tab-completion for pathname entry. Choose the path that includes subdirectories: bin, docs, include, and lib. The product of the configure script is a config.gypi file for use by node-gyp.
31    + `node configure`
32+  In the next step, node-gyp will create the build environment.
33    + `node-gyp configure`
34+  Build a *Release* (or, with the -d flag, a *Debug*) version of ndb_adapter.node.  Note that on some Windows platforms the Release build will not run and therefore a Debug build is required.
35    + `node-gyp build` or `node-gyp build -d`
36
37Running and Testing Jones-NDB
38-----------------------------
39
40### Setting the run-time library load path
41
42The NDB adapter has a run-time dependency on the NDB API library, libndbclient.
43On some platforms this dependency can only be satisfied when an environment
44variable points to the appropriate directory: LD_LIBRARY_PATH on most Unix
45derivatives, but DYLD_LIBRARY_PATH on Mac OS X. This is the path that ends with: /lib.
46
47### Configuring a simple MySQL Cluster
48
49Testing Jones-NDB requires, at minimum, a simple MySQL Cluster containing a management node, a MySQL node, and at least one NDB data node.  A standard mysql distribution contains several simple ways to quickly configure such a cluster.
50
51#### Using the NDB Memcache Sandbox environment
52
53The sandbox.sh script in the Memcache distribution can be used to start and stop a cluster with an NDB management server and MySQL server running on their default ports and single NDB data node.
54From the MySQL base directory:
55+ `cd share`
56+ `cd memcache-api`
57+ `sh sandbox.sh start`
58+ To shut down this cluster, use `sh sandbox.sh stop`
59+ The data in this environment is stored under share/memcache-api/sandbox and will persist from one run to the next.
60
61#### Using the mysql-test environment
62
63MySQL's test tool, `mysql-test-run`, can also be used to start a simple cluster.  In this configuration, ndb_mgmd and mysqld will listen on non-standard ports. mysql-test-run will assign these port numbers dynamically at run-time, but in most cases we will find a management server on port 13000 and a MySQL server at port 13001.
64Jones connection properties are commonly managed using a jones_deployments.js file.  The standard [jones_deployments.js](../jones_deployments.js) includes a deployment named "mtr" configured especially for the cluster created by mysql-test-run.
65From the MySQL base directory:
66+ `cd mysql-test`
67+ `./mtr --start ndb.ndb_basic`
68+ To shut down this cluster, use ctrl-c.
69+ The data in this environment is stored in mysql-test/var and is normally deleted after every test run.
70
71
72#### MySQL Cluster in Production
73
74The best way to manage a production MySQL Cluster is using "MCM",
75[MySQL Cluster Manager](http://www.mysql.com/products/cluster/mcm/).
76
77
78### Running the test suite
79
80To test that jones-ndb is fully installed:
81+ `cd test`
82+ By default, jones-ndb looks for ndb_mgmd and mysqld servers at their default ports on the local machine.  If this is the case, simply type `node driver`
83+ If you are using mysql-test-run, use the `-E` option to select the mtr deployment:  `node driver -E mtr`
84+ For some other configuration, define a deployment with appropriate connection properties in [jones_deployments.js](../jones_deployments.js) and use it:  `node driver -E my_test_deployment`
85
86#### Test results
87
88The final output from a succesful test run should look something like this:
89
90```
91Adapter:  ndb
92Elapsed:  11.634 sec.
93Started:  627
94Passed:   625
95Failed:   0
96Skipped:  2
97```
98
99
100NDB Connection Properties
101-------------------------
102Each Jones Service Provider supports a different set of connection properties, based on the data source it supports.  These properties, and their default values, are documented in the file [DefaultConnectionProperties.js](DefaultConnectionProperties.js)
103
104
105Copyright and License Terms
106---------------------------
107Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
108
109This program is free software; you can redistribute it and/or modify
110it under the terms of the GNU General Public License, version 2.0,
111as published by the Free Software Foundation.
112
113This program is also distributed with certain software (including
114but not limited to OpenSSL) that is licensed under separate terms,
115as designated in a particular file or component or in included license
116documentation.  The authors of MySQL hereby grant you an additional
117permission to link the program and your derivative works with the
118separately licensed software that they have included with MySQL.
119
120This program is distributed in the hope that it will be useful,
121but WITHOUT ANY WARRANTY; without even the implied warranty of
122MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
123GNU General Public License, version 2.0, for more details.
124
125You should have received a copy of the GNU General Public License
126along with this program; if not, write to the Free Software
127Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA
128
129