tarantool / tt

Command-line utility to manage Tarantool applications
Other
101 stars 12 forks source link

Different commands identify instances in a different ways #976

Open elhimov opened 1 month ago

elhimov commented 1 month ago
$ tt start replicaset_example
   • Starting an instance [replicaset_example:master]...
   • Starting an instance [replicaset_example:replica]...
$ tt start replicaset_example
   • The instance replicaset_example:replica (PID = 772688) is already running.
   • The instance replicaset_example:master (PID = 772687) is already running.
$ tt restart -y replicaset_example
   • The Instance replicaset_example:master (PID = 772687) has been terminated.
   • The Instance replicaset_example:replica (PID = 772688) has been terminated.
   • Starting an instance [replicaset_example:master]...
   • Starting an instance [replicaset_example:replica]...
$ tt logrotate replicaset_example
   • replicaset_example:master: logs has been rotated. PID: 777002.
   • replicaset_example:replica: logs has been rotated. PID: 777003.
$ tt clean replicaset_example
   • instance `master` must be stopped
   • instance `replica` must be stopped
$ tt stop replicaset_example
   • The Instance replicaset_example:master (PID = 777002) has been terminated.
   • The Instance replicaset_example:replica (PID = 777003) has been terminated.
$ tt clean -f replicaset_example
   • List of files to delete:

   • /var/log/tarantool/sys_env/replicaset_example/replica/tt.log
   • /var/lib/tarantool/sys_env/replicaset_example/replica/00000000000000000009.snap
   • /var/lib/tarantool/sys_env/replicaset_example/replica/00000000000000000009.xlog
   • replica: cleaning...   [OK]
   • List of files to delete:

   • /var/log/tarantool/sys_env/replicaset_example/master/tt.log
   • /var/lib/tarantool/sys_env/replicaset_example/master/00000000000000000000.snap
   • /var/lib/tarantool/sys_env/replicaset_example/master/00000000000000000000.xlog
   • /var/lib/tarantool/sys_env/replicaset_example/master/00000000000000000009.xlog
   • master: cleaning...    [OK] 
$ tt start replicaset_example
   • Starting an instance [replicaset_example:master]...
   • Starting an instance [replicaset_example:replica]...
$ tt kill -f replicaset_example
   • The instance replicaset_example:master (PID = 805812) has been killed.
   • The instance replicaset_example:replica (PID = 805813) has been killed.
$ tt kill -f replicaset_example
   • failed to kill the processes: can't get pid of running process: can't "stat" the PID file. Error: stat /var/run/tarantool/sys_env/replicaset_example/master/tt.pid: no such file or directory
   • failed to kill the processes: can't get pid of running process: can't "stat" the PID file. Error: stat /var/run/tarantool/sys_env/replicaset_example/replica/tt.pid: no such file or directory
$ tt logrotate replicaset_example
   ⨯ NOT RUNNING

In the above output various formats of instances can be found:

Instances should be identified uniformly, for example in [app:instance] format.