Connecting to a Tarantool instance | Tarantool
Документация на русском языке
поддерживается сообществом
Справочники tt CLI utility Commands Connecting to a Tarantool instance

Connecting to a Tarantool instance

tt connect URI|INSTANCE_NAME [flags]

tt connect connects to a Tarantool instance by its URI or name specified during its startup (tt start).

-u

--username

Username

-p

--password

Password

-f

--file

Connect and evaluate the script from a file.

- – read the script from stdin.

To connect to an instance, tt typically needs its URI – the host name or IP address and the port.

You can also connect to instances in the same tt environment (that is, those that use the same configuration file and Tarantool installation) by their instance names.

If authentication is required, specify the username and the password using the -u (--username) and -p (--password) options.

By default, tt connect opens an interactive Tarantool console. Alternatively, you can open a connection to evaluate a Lua script from a file or stdin. To do this, pass the file path in the -f (--file) option or use -f - to take the script from stdin.

  • Connect to the app instance in the same environment:

    tt connect app
    
  • Connect to the 192.168.10.10 host on port 3301 with authentication:

    tt connect 192.168.10.10:3301 -u myuser -p p4$$w0rD
    
  • Connect to the app instance and evaluate the code from the test.lua file:

    tt connect app -f test.lua
    
  • Connect to the app instance and evaluate the code from stdin:

    echo "function test() return 1 end" | tt connect app -f - # Create the test() function
    echo "test()" | tt connect app -f -                       # Call this function
    
Нашли ответ на свой вопрос?
Обратная связь