Installing a module


Документация находится в процессе перевода и может отставать от английской версии.

Installing a module

Modules in Lua and C that come from Tarantool developers and community contributors are available in the following locations:

  • Tarantool modules repository, and
  • Tarantool deb/rpm repositories.

Installing a module from a repository

See README in tarantool/rocks repository for detailed instructions.

Installing a module from deb/rpm

Follow these steps:

  1. Install Tarantool as recommended on the download page.

  2. Install the module you need. Look up the module’s name on Tarantool rocks page and put the prefix «tarantool-» before the module name to avoid ambiguity:

    $ # for Ubuntu/Debian:
    $ sudo apt-get install tarantool-<module-name>
    $ # for RHEL/CentOS/Amazon:
    $ sudo yum install tarantool-<module-name>

    For example, to install the module shard on Ubuntu, say:

    $ sudo apt-get install tarantool-shard

Теперь можно:

  • load any module with

    tarantool> name = require('module-name')

    for example:

    tarantool> shard = require('shard')
  • search locally for installed modules using package.path (Lua) or package.cpath (C):

    tarantool> package.path
    - ./?.lua;./?/init.lua; /usr/local/share/tarantool/?.lua;/usr/local/share/
    tarantool> package.cpath
    - ./?.so;/usr/local/lib/x86_64-linux-gnu/tarantool/?.so;/usr/lib/x86_64-li


    Question-marks stand for the module name that was specified earlier when saying require('module-name').