manticoresoftware / manticoresearch-backup

Repository for Manticore Search backup scripts
GNU General Public License v3.0
3 stars 1 forks source link

support relative paths #60

Closed sanikolaev closed 1 year ago

sanikolaev commented 1 year ago

config:

root@perf ~/repl/1 # ls -la  
total 140  
drwxr-xr-x 3 root root   4096 Mar 28 05:27 .  
drwxr-xr-x 4 root root   4096 Jan 12 03:53 ..  
drwxr-xr-x 3 root root   4096 Mar 28 05:27 data  
-rw-r--r-- 1 root root    189 Mar 28 05:12 manticore1.conf  
-rw------- 1 root root   1724 Mar 28 05:29 query.log  
-rw------- 1 root root 113924 Mar 28 05:27 searchd.log  
-rw------- 1 root root      6 Mar 28 05:27 searchd.pid  
root@perf ~/repl/1 # manticore-backup --config=manticore1.conf --backup-dir=backup  
Copyright (c) 2023, Manticore Software LTD (https://manticoresearch.com)  

2023-03-28 03:31:41 [Error] Failed to find passed config: manticore1.conf  

backup-dir:

root@perf ~/repl/1 # manticore-backup --config=/root/repl/1/manticore1.conf --backup-dir=backup  
Copyright (c) 2023, Manticore Software LTD (https://manticoresearch.com)  

2023-03-28 03:32:38 [Error] Failed to find backup dir to store backup: backup  
donhardman commented 1 year ago

It should be fixed in the latest main

sanikolaev commented 1 year ago

Still not working correctly:

root@perf ~/repl/1 # ls -la
total 172
drwxr-xr-x  4 root root   4096 Mar 31 13:14 .
drwxr-xr-x  4 root root   4096 Jan 12 03:53 ..
drwxr-xr-x 11 root root   4096 Mar 31 13:10 backup
drwxr-xr-x  3 root root   4096 Mar 31 13:14 data
-rw-r--r--  1 root root    245 Mar 31 13:10 manticore1.conf
-rw-------  1 root root   1986 Mar 31 13:07 query.log
-rw-------  1 root root 140826 Mar 31 13:10 searchd.log
-rw-------  1 root root      8 Mar 31 13:14 searchd.pid
root@perf ~/repl/1 # manticore-backup --config=manticore1.conf --backup-dir=backup
Copyright (c) 2023, Manticore Software LTD (https://manticoresearch.com)

2023-03-31 11:14:59 [Error] Failed to find passed config: manticore1.conf
root@perf ~/repl/1 # apt show manticore-backup
Package: manticore-backup
Version: 0.5.13-23033010-6d287e9
githubmanticore commented 1 year ago

➤ Sergey Nikolaev commented:

Still failing:

root@perf ~/repl/1 # cat manticore1.conf 
searchd { 
    listen = 127.0.0.1:20208:http 
    listen = 127.0.0.1:20201 
    listen = 127.0.0.1:20301:mysql 
    log = searchd.log 
    query_log = query.log 
    pid_file = searchd.pid 
    data_dir = data 
    binlog_path = 
} 

root@perf ~/repl/1 # searchd -c  manticore1.conf 
Manticore 6.0.5 90d9223bc@230404 dev (columnar 2.0.5 1c8c709@230403) (secondary 2.0.5 1c8c709@230403) 
Copyright (c) 2001-2016, Andrew Aksyonoff 
Copyright (c) 2008-2016, Sphinx Technologies Inc (http://sphinxsearch.com) 
Copyright (c) 2017-2023, Manticore Software LTD (https://manticoresearch.com) 

[58:08.864] [1513978] using config file '/root/repl/1/manticore1.conf' (244 chars)... 
starting daemon version '6.0.5 90d9223bc@230404 dev (columnar 2.0.5 1c8c709@230403) (secondary 2.0.5 1c8c709@230403)' ... 
listening on 127.0.0.1:20208 for sphinx and http(s) 
listening on 127.0.0.1:20201 for sphinx and http(s) 
listening on 127.0.0.1:20301 for mysql 
precaching table 't' 
precached 1 tables in 0.002 sec 
root@perf ~/repl/1 # manticore-backup --config=manticore1.conf --backup-dir=backup 
Copyright (c) 2023, Manticore Software LTD (https://manticoresearch.com) 

Manticore config file: /root/repl/1/manticore1.conf 
Tables to backup: all tables 
Backup dir: backup 

Manticore config 
  endpoint =  http://127.0.0.1:20201 

Manticore versions: 
  manticore: 6.0.5 90d9223bc@230404 dev 
  columnar: 2.0.5 1c8c709@230403 
  secondary: 2.0.5 1c8c709@230403 

Manticore versions: 
  manticore: 6.0.5 90d9223bc@230404 dev 
  columnar: 2.0.5 1c8c709@230403 
  secondary: 2.0.5 1c8c709@230403 
2023-04-04 10:58:34 [Info] Starting the backup... 
2023-04-04 10:58:34 [Info] Backing up config files... 
2023-04-04 10:58:34 [Error] Cannot read from source directory - "data  /manticore.json" 
root@perf ~/repl/1 # manticore-backup --config=/root/repl/1/manticore1.conf --backup-dir=backup 
Copyright (c) 2023, Manticore Software LTD (https://manticoresearch.com) 

Manticore config file: /root/repl/1/manticore1.conf 
Tables to backup: all tables 
Backup dir: backup 

Manticore config 
  endpoint =  http://127.0.0.1:20201 

Manticore versions: 
  manticore: 6.0.5 90d9223bc@230404 dev 
  columnar: 2.0.5 1c8c709@230403 
  secondary: 2.0.5 1c8c709@230403 

Manticore versions: 
  manticore: 6.0.5 90d9223bc@230404 dev 
  columnar: 2.0.5 1c8c709@230403 
  secondary: 2.0.5 1c8c709@230403 
2023-04-04 10:58:46 [Info] Starting the backup... 
2023-04-04 10:58:46 [Info] Backing up config files... 
2023-04-04 10:58:46 [Error] Cannot read from source directory - "data  /manticore.json" 
root@perf ~/repl/1 # ls -la data/ 
total 20 
drwxr-xr-x 3 root root 4096 Apr  4 12:58 . 
drwxr-xr-x 4 root root 4096 Apr  4 12:58 .. 
-rw------- 1 root root   84 Apr  4 12:57 manticore.json 
-rw------- 1 root root 3559 Mar 31 13:35 searchd.log 
-rw------- 1 root root    0 Apr  4 12:58 state.sql 
drwx------ 2 root root 4096 Apr  4 12:57 t 
root@perf ~/repl/1 # apt show manticore-backup 
Package: manticore-backup 
Version: 0.5.13-23040406-a7a57c0 

Please test yourself on perf using the above config.

sanikolaev commented 1 year ago

Closing. It works fine now:

root@perf ~/repl/1 # manticore-backup --config=manticore1.conf --backup-dir=backup
Copyright (c) 2023, Manticore Software LTD (https://manticoresearch.com)

Manticore config file: /root/repl/1/manticore1.conf
Tables to backup: all tables
Backup dir: backup

Manticore config
  endpoint =  http://127.0.0.1:20208

Manticore versions:
  manticore: 6.0.5 90d9223bc@230404 dev
  columnar: 2.0.5 1c8c709@230403
  secondary: 2.0.5 1c8c709@230403

Manticore versions:
  manticore: 6.0.5 90d9223bc@230404 dev
  columnar: 2.0.5 1c8c709@230403
  secondary: 2.0.5 1c8c709@230403
2023-04-05 05:45:44 [Info] Starting the backup...
2023-04-05 05:45:44 [Info] Backing up config files...
2023-04-05 05:45:44 [Info]   config files - OK
2023-04-05 05:45:44 [Info] Backing up global state files...
2023-04-05 05:45:44 [Info]   global state files – OK
2023-04-05 05:45:44 [Info] Backing up tables...
2023-04-05 05:45:44 [Info]   t (rt) [512B]...
2023-04-05 05:45:44 [Info]    OK
2023-04-05 05:45:44 [Info] Running sync
2023-04-05 05:45:46 [Info]  OK
2023-04-05 05:45:46 [Info] You can find backup here: /root/repl/1/backup/backup-20230405054544
2023-04-05 05:45:46 [Info] Elapsed time: 1.51s
2023-04-05 05:45:46 [Info] Done