ytyou / ticktock

TickTockDB is an OpenTSDB-like time series database, with much better performance.
GNU General Public License v3.0
76 stars 9 forks source link

change config has no effect on log location #30

Closed mzy2240 closed 1 year ago

mzy2240 commented 1 year ago

log still points to /var/log/ticktock.log even after changing to other location in the config. version 0.10.2

mzy2240 commented 1 year ago

this is the command I am using to run: bin/tt -c conf/tt.conf tt.conf has been modified in advance

ylin30 commented 1 year ago

What does the output of 'bin/tt -c conf/tt.conf' say? E.g.,

ticktock@tt-dev:~/ticktock$ ./bin/tt -c conf/tt.conf &
[1] 531
ticktock@tt-dev:~/ticktock$  TickTock v0.10.2,  Maintained by
 Yongtao You (yongtao.you@gmail.com) and Yi Lin (ylin30@gmail.com).
 This program comes with ABSOLUTELY NO WARRANTY. It is free software,
 and you are welcome to redistribute it under certain conditions.
 For details, see <https://www.gnu.org/licenses/>.
Writing to log file: /home/ticktock/tmp/log/ticktock.log

ticktock@tt-dev:~/ticktock$

You can try this cmd. Any config which are not default will be printed out.

ticktock@tt-dev:~/ticktock$ ./admin/config.sh
{
  "append.log.dir": "/home/ticktock/tmp/append",
  "http.listener.count": "4",
  "log.file": "/home/ticktock/tmp/log/ticktock.log",
  "log.level": "INFO",
  "tcp.buffer.size": "128kb",
  "tcp.listener.count": "4",
  "tsdb.compact.frequency": "0sec",
  "tsdb.compressor.version": "3",
  "tsdb.data.dir": "/home/ticktock/tmp/data",
  "tsdb.flush.frequency": "1min",
  "tsdb.gc.frequency": "5min",
  "tsdb.page.count": "655360",
  "tsdb.page.size": "128b",
  "tsdb.self_meter.enabled": "false",
  "tsdb.thrashing.threshold": "2min"
}
ticktock@tt-dev:~/ticktock$
mzy2240 commented 1 year ago
 TickTock v0.10.2,  Maintained by
 Yongtao You (yongtao.you@gmail.com) and Yi Lin (ylin30@gmail.com).
 This program comes with ABSOLUTELY NO WARRANTY. It is free software,
 and you are welcome to redistribute it under certain conditions.
 For details, see <https://www.gnu.org/licenses/>.
Failed to open file /var/log/ticktock.log for writing: 13
2023-01-20 19:49:38.785 [INFO] [main] TickTock version: 0.10.2, on khadas-vim3, pid: 30739
mzy2240 commented 1 year ago

ticktock@tt-dev:~/ticktock$ ./admin/config.sh

Nothing returns

ylin30 commented 1 year ago

hm, looks like that your conf/tt.conf is the original one. Can you send me your copy?

mzy2240 commented 1 year ago

I can confirm data is received by db and could query the data out from db. So it is working as expected with home assistant. The only issue left is the log.

ylin30 commented 1 year ago

Can you do a git status and git diff? It may show what has been changed in your config.

mzy2240 commented 1 year ago

Screen Shot 2023-01-20 at 7 58 48 PM

ylin30 commented 1 year ago

oh, you have a ';' in the front of "log.file=/home/khadas/....".

Remove the ';' (it means commenting out). It will work.

ylin30 commented 1 year ago

Still puzzling me what your cmd './admin/config.sh' returns nothing?

mzy2240 commented 1 year ago

oh, you have a ';' in the front of "log.file=/home/khadas/....".

Remove the ';' (it means commenting out). It will work.

Now no any error occurs.

mzy2240 commented 1 year ago

Still puzzling me what your cmd './admin/config.sh' returns nothing?

khadas@khadas-vim3:~/ticktock$ ./admin/config.sh

khadas@khadas-vim3:~/ticktock$

ylin30 commented 1 year ago

hm. Looks like your TT process is dead. Can you do './admin/ping.sh'? It is supposed to return a 'pong' if alive.

Look at the output below. Ping.sh returned nothing at the first cmd since TT is not started yet. After TT started, Ping.sh returned 'pong'.

ticktock@tt-dev:~/ticktock$ ./admin/ping.sh

ticktock@tt-dev:~/ticktock$ ./bin/tt -c conf/tt.conf &
[1] 594
ticktock@tt-dev:~/ticktock$  TickTock v0.10.2,  Maintained by
 Yongtao You (yongtao.you@gmail.com) and Yi Lin (ylin30@gmail.com).
 This program comes with ABSOLUTELY NO WARRANTY. It is free software,
 and you are welcome to redistribute it under certain conditions.
 For details, see <https://www.gnu.org/licenses/>.
Writing to log file: /home/ticktock/tmp/log/ticktock.log

ticktock@tt-dev:~/ticktock$ ./admin/ping.sh
pong
ticktock@tt-dev:~/ticktock$
mzy2240 commented 1 year ago

./admin/ping.sh

Still nothing returned.

mzy2240 commented 1 year ago

NVM. I figured it out. I am running ticktock from a live ssh session, and everytime when I ran ./admin/ping.sh or ./admin/config.sh, I always stop the ticktock instance first ...