Install tntapi standalone¶
Install and configure the tntapi
component as follows:
Install
tntapi
. Tarantool will be installed automatically along with it.sudo apt-get update sudo apt-get install findface-tarantool-server
Disable the Tarantool example service autostart and stop the service.
sudo systemctl disable tarantool@example && sudo systemctl stop tarantool@example
For a small-scale project, the
tntapi
shard created by default (tarantool@FindFace
) would suffice as 1 shard can handle up to 10,000,000 faces. Configuration settings of the default shard are defined in the file/etc/tarantool/instances.enabled/FindFace.lua
. We strongly recommend you not to add or edit anything in this file, except the maximum memory usage (memtx_memory
), the NTLS IP address required for thetntapi
licensing, and the remote access setting. The maximum memory usage should be set in bytes, depending on the number of faces the shard handles, at the rate roughly 1280 byte per face.Open the configuration file:
sudo vi /etc/tarantool/instances.enabled/FindFace.lua
Edit the value due to the number of faces the shard handles. The value
1.2*1024*1024*1024
corresponds to 1,000,000 faces:memtx_memory = 1.2 * 1024 * 1024 * 1024,
Specify the NTLS IP address if NTLS is remote:
FindFace.start(“127.0.0.1”, 8001, {license_ntls_server=“192.168.113.2:3133”})
With standalone deployment, you can access Tarantool by default only locally (
127.0.0.1
). If you want to access Tarantool from a remote host, either specify the remote host IP address in theFindFace.start
section, or change127.0.0.1
to0.0.0.0
there to allow access to Tarantool from any IP address. In the case-study below, you allow access only from192.168.113.10
:FindFace.start("192.168.113.10", 8001, {license_ntls_server=“192.168.113.2:3133”})
Now you allow access from any IP address:
FindFace.start("0.0.0.0", 8001, {license_ntls_server=“192.168.113.2:3133”})
Configure the
tntapi
shard to autostart and start the shard.sudo systemctl enable tarantool@FindFace && sudo systemctl start tarantool@FindFace
Retrieve the shard status. The command will return a service description, a status (should be Active), path and running time.
sudo systemctl status tarantool@FindFace
The
tntapi.json
file containing the tntapi shard parameters is automatically installed along withtntapi
into the/etc/
folder.Important
You will have to uncomment the path to
tntapi.json
when configuring network.