gotoeasy / glogcenter

一个golang实现的日志中心glogcenter,简称GLC,资源占用低,性能高。作为传统ELK的替代方案,上至央企大项目下至本地开发调试,已历经众多案例磨炼,表现稳定出色,达生产级别应用要求。
https://glc.gotoeasy.top
GNU Lesser General Public License v3.0
102 stars 29 forks source link

断电起不来 #52

Closed molixiaoge closed 1 month ago

molixiaoge commented 2 months ago

虚拟机直接重启后,gloc起不来。日志如下:

2024-09-26 17:22:57.572 DEBUG 加载词典: /glogcenter/.dictionary/dict.txt
panic: leveldb: manifest corrupted (field 'comparer'): missing [file=MANIFEST-011864]

goroutine 1 [running]:
glc/ldb/storage/logdata.NewLogDataStorage({0xc006b4d1e0, 0x10})
    /goproject/ldb/storage/logdata/logdata_storage.go:91 +0x5b6
glc/ldb/storage.NewLogDataStorageHandle({0xc006b4d1e0, 0x10})
    /goproject/ldb/storage/storage_handle.go:37 +0x65
glc/ldb.NewDefaultEngine()
    /goproject/ldb/engine.go:37 +0x2a
main.main.Run.func1()
    /goproject/onstart/onstart.go:72 +0x98a
glc/gweb/http.StartHttpServer(0x4?)
    /goproject/gweb/http/start_httpserver.go:9 +0x12
glc/onstart.Run(...)
    /goproject/onstart/onstart.go:17
main.main()
    /goproject/main.go:18 +0x125
2024-09-26 17:24:00.321 DEBUG 加载词典: /glogcenter/.dictionary/dict.txt
panic: leveldb: manifest corrupted (field 'comparer'): missing [file=MANIFEST-011864]

goroutine 1 [running]:
glc/ldb/storage/logdata.NewLogDataStorage({0xc0038a5860, 0x10})
    /goproject/ldb/storage/logdata/logdata_storage.go:91 +0x5b6
glc/ldb/storage.NewLogDataStorageHandle({0xc0038a5860, 0x10})
    /goproject/ldb/storage/storage_handle.go:37 +0x65
glc/ldb.NewDefaultEngine()
    /goproject/ldb/engine.go:37 +0x2a
main.main.Run.func1()
    /goproject/onstart/onstart.go:72 +0x98a
glc/gweb/http.StartHttpServer(0x4?)
    /goproject/gweb/http/start_httpserver.go:9 +0x12
glc/onstart.Run(...)
    /goproject/onstart/onstart.go:17
main.main()
    /goproject/main.go:18 +0x125
2024-09-26 17:25:02.761 DEBUG 加载词典: /glogcenter/.dictionary/dict.txt
panic: leveldb: manifest corrupted (field 'comparer'): missing [file=MANIFEST-011864]

goroutine 1 [running]:
glc/ldb/storage/logdata.NewLogDataStorage({0xc0036d1b50, 0x10})
    /goproject/ldb/storage/logdata/logdata_storage.go:91 +0x5b6
glc/ldb/storage.NewLogDataStorageHandle({0xc0036d1b50, 0x10})
    /goproject/ldb/storage/storage_handle.go:37 +0x65
glc/ldb.NewDefaultEngine()
    /goproject/ldb/engine.go:37 +0x2a
main.main.Run.func1()
    /goproject/onstart/onstart.go:72 +0x98a
glc/gweb/http.StartHttpServer(0x4?)
    /goproject/gweb/http/start_httpserver.go:9 +0x12
glc/onstart.Run(...)
    /goproject/onstart/onstart.go:17
main.main()
    /goproject/main.go:18 +0x125
2024-09-26 17:26:05.341 DEBUG 加载词典: /glogcenter/.dictionary/dict.txt
panic: leveldb: manifest corrupted (field 'comparer'): missing [file=MANIFEST-011864]

goroutine 1 [running]:
glc/ldb/storage/logdata.NewLogDataStorage({0xc003aff840, 0x10})
    /goproject/ldb/storage/logdata/logdata_storage.go:91 +0x5b6
glc/ldb/storage.NewLogDataStorageHandle({0xc003aff840, 0x10})
    /goproject/ldb/storage/storage_handle.go:37 +0x65
glc/ldb.NewDefaultEngine()
    /goproject/ldb/engine.go:37 +0x2a
main.main.Run.func1()
    /goproject/onstart/onstart.go:72 +0x98a
glc/gweb/http.StartHttpServer(0x4?)
    /goproject/gweb/http/start_httpserver.go:9 +0x12
glc/onstart.Run(...)
    /goproject/onstart/onstart.go:17
main.main()
    /goproject/main.go:18 +0x125
gotoeasy commented 2 months ago

虽然程序有退出处理,但这个看似断电时来不及处理完,导致文件有损坏之类问题引起 如果是文件损坏,目前我也不会恢复,备份好,或是换个数据目录重启吧

如果日志非常重要,可以考虑下集群部署

molixiaoge commented 2 months ago

好的,或者发现的时候可以重新扫描么

gotoeasy commented 2 months ago

不懂你的意思,发现什么?扫描什么?

molixiaoge commented 2 months ago

就是发现启动不了,可以重新生成dict.txt么?

gotoeasy commented 2 months ago

dict.txt是默认词典不用关心,没有的话会生成,下个版本不会放出来避免误解

gotoeasy commented 1 month ago

0.17.2不再把词典写出到文件系统