A simple command-line application to showcase typesense examples.
The configuration of the client can be updated to reflect your setup. The included example emulates a multi-node cluster, following steps are required to run it as is:
- Download Typesense server binary (link).
- The file typesense-server-nodes contains a list of comma-separated values representing the peer nodes and the port on which they accept peer communication. For example, in
192.168.43.11:8107:8108
the node192.168.43.11:8107
accepts peer communication at port8108
. Update these CSV's to reflect your setup. - Create separate
data directories
for each of the nodes, for example:
mkdir /tmp/typesense-server-data-7108
Similarly for typesense-server-data-8108
and typesense-server-data-9108
. Update the respective config files if using some other directory.
- Spin up three instances of the server following the pattern:
./typesense-server --config=[path to node7108.ini] --nodes=[path to typesense-server-nodes]
.
Similarly for node8108.ini
and node9108.ini
. These files are present in server_configuration/
.
To know more about command line arguments, follow this link.
After all three nodes are running, change current directory to typesense-dart/example/console-simple/
and issue the following command:
dart bin/main.dart
or
dart example/console-simple/bin/main.dart
if still in root.