commit | 8701f16be7301760ee44384517ef633fc9c89e57 | [log] [tgz] |
---|---|---|
author | Maxim Muzafarov <maxmuzaf@gmail.com> | Thu Aug 11 14:28:32 2022 +0300 |
committer | Maxim Muzafarov <maxmuzaf@gmail.com> | Thu Aug 11 14:28:32 2022 +0300 |
tree | 61d81cf62b209931556da32e128ede420754e8ca | |
parent | 618d032903b821825417e59eabd535fa4a6c5c38 [diff] |
IGNITE-15759 Replace local affinity function with the custom one
Node.js version 8 or higher is required. Either download the Node.js pre-built binary for the target platform, or install Node.js via package manager.
Once node
and npm
are installed, you can use one of the following installation options.
This is a recommended way for users. Execute the following command to install the Node.js Thin Client package:
npm install -g apache-ignite-client
This way is more suitable for developers or if you install client from zip archive. If you want to install the Thin Client library from Ignite sources, please follow the steps:
nodejs-thin-client
nodejs-thin-client
foldernpm link
commandnpm link apache-ignite-client
commandcd nodejs-thin-client npm install npm run build npm link npm link apache-ignite-client #linking examples (optional)
If you installed GridGain client globally, run the following command:
npm update -g @gridgain/thin-client
If you installed GridGain client locally, follow the following instruction:
nodejs-thin-client
npm update
commandnpm outdated
command. There should not be any outputcd nodejs-thin-client npm update npm outdated
Node.js Client for Apache Ignite contains Jasmine tests to check the behavior of the client. the tests include:
Tests are installed along with the client. Follow the Installation instructions.
Call npm test
command from nodejs-thin-client
folder.
Call npm run test:examples
command from nodejs-thin-client
folder.
Active Ignite server node with non-default configuration is required (authentication and TLS switched on).
If the server runs locally:
keystore.jks
and truststore.jks
certificates from nodejs-thin-client/examples/certs/
folder. Password for the files: 123456
If the server runs remotely, and/or other certificates are required, and/or non-default username/password is required - see this instruction.
Call npm run test:auth_example
command from nodejs-thin-client
folder.
either use pre-generated certificates provided in the examples/certs folder. Password for the files: 123456
. Note, these certificates work for an Ignite server installed locally only.
or obtain other existing certificates applicable for a concrete Ignite server.
or generate new certificates applicable for a concrete Ignite server.
The following files are needed:
Place client.key, client.crt and ca.crt files somewhere locally, eg. into the examples/certs folder.
If needed, modify TLS_KEY_FILE_NAME
, TLS_CERT_FILE_NAME
and TLS_CA_FILE_NAME
constants in the example source file. The default values point to the files in the examples/certs folder.
Setup Ignite server to accept TLS - see appropriate Ignite documentation. Provide the obtained keystore.jks and truststore.jks certificates during the setup.
Switch on and setup authentication in Ignite server - see appropriate Ignite documentation.
If needed, modify USER_NAME
and PASSWORD
constants in the example source file. The default values are the default Ignite username/password.
Start three Ignite server nodes.
If needed, modify ENDPOINT1
, ENDPOINT2
, ENDPOINT2
constants in an example source file - Ignite node endpoints. Default values are localhost:10800
, localhost:10801
, localhost:10802
respectively.
Run an example by calling node FailoverExample.js
.
Shut down the node the client is connected to (you can find it out from the client logs in the console).
From the logs, you will see that the client automatically reconnects to another node which is available.
Shut down all the nodes. You will see the client being stopped after failing to connect to each of the nodes.
It should be done if a public API class/method has been changed.
npm install -g jsdoc
to install jsdoc (https://www.npmjs.com/package/jsdoc)nodejs-thin-client/api_spec
jsdoc -c conf.json --readme index.md
command.Note: nodejs-thin-client/api_spec/conf.json
is a file with jsdoc configuration.
For more information, see Ignite Node.js Thin Client documentation.