Repository navigation
Configuration
For configuration take a look at the self-documented config file:
https://github.com/tezc/resql/blob/master/bin/resql.ini
Any configuration in the resql.ini can be given via the command line. Command-line arguments have higher precedence. If an option exists in the file and also given via the command line, the command line value will be used.
e.g
-----
[node]
name = node0
[advanced]
fsync = true
-----
./resql --node-name=localnode0 --advanced-fsync=false
Resql provides a configuration function, resql() which can be executed either from a client or CLI.
- To add a node, after you start the new node, you should add it to the cluster :
SELECT resql('add-node','node3@127.0.0.1:7603'); - To remove a node :
SELECT resql('remove-node','node3'); - Shutdown a node gracefully :
SELECT resql('shutdown', 'node0'); - Shutdown all nodes gracefully :
SELECT resql('shutdown', '*'); - Set max database size, e.g ~500 mb :
max-size option accepts bytes. When database size reaches this value, write operations will fail until you delete some data and make the database size less than max-size bytes.
SELECT resql('max-size', 500000000);
If you want to start a cluster, you can copy resql/bin folder to two separate directories. e.g to /tmp/node0 /tmp/node1. After that, you can edit the configuration for each node and start nodes. To make your nodes discover each other, you can set "cluster - nodes" config :
[cluster]
nodes = tcp://node0@127.0.0.1:7600 tcp://node1@127.0.0.1:7601
1 - Start node0:
./resql --node-name=node0 --node-directory=/tmp/node0 --node-bind-url=tcp://node0@127.0.0.1:7600 --node-advertise-url=tcp://node0@127.0.0.1:7600 --cluster-nodes="tcp://node0@127.0.0.1:7600 tcp://node1@127.0.0.1:7601"
2 - Start node1:
./resql --node-name=node1 --node-directory=/tmp/node1 --node-bind-url=tcp://node1@127.0.0.1:7601 --node-advertise-url=tcp://node1@127.0.0.1:7601 --cluster-nodes="tcp://node0@127.0.0.1:7600 tcp://node1@127.0.0.1:7601"
3 - Add another node, node2:
- Start node2
./resql --node-name=node2 --node-directory=/tmp/node2 --node-bind-url=tcp://node2@127.0.0.1:7602 --node-advertise-url=tcp://node2@127.0.0.1:7602 --cluster-nodes="tcp://node0@127.0.0.1:7600 tcp://node1@127.0.0.1:7601"
- Tell other nodes that node2 can join :
./resql-cli -c="SELECT resql('add-node','tcp://node2@127.0.0.1:7602');
4 - Remove a node:
./resql-cli -c="SELECT resql('remove-node','node2');"
- Get Started
- Administration
- Clients