1 Star 0 Fork 91

靳小杰 / GoFound

forked from anrubing / GoFound 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
config.md 2.29 KB
一键复制 编辑 原始数据 按行查看 历史
newpanjing 提交于 2022-05-16 22:48 . 优化代码结构

配置

在编译好gofound之后,就可以启动了。

./gofound

参数

./gofound -h

  -addr string
        设置监听地址和端口 (default "0.0.0.0:5678")
  -auth string
        开启认证,例如: admin:123456
  -config string
        配置文件路径,配置此项其他参数忽略
  -data string
        设置数据存储目录 (default "./data")
  -debug
        设置是否开启调试模式 (default true)
  -dictionary string
        设置词典路径 (default "./data/dictionary.txt")
  -enableAdmin
        设置是否开启后台管理 (default true)
  -enableGzip
        是否开启gzip压缩 (default true)
  -gomaxprocs int
        设置GOMAXPROCS (default 20)
  -timeout int
        数据库超时关闭时间() (default 600)

addr

指定要监听的地址和端口。默认为127.0.0.1:5678 监听本地地址。

./gofound --addr=127.0.0.1:5678  
./gofound --addr=:5678  
./gofound --addr=0.0.0.0:5678  
./gofound --addr=192.168.1.1:5678  

auth

设置admin和api接口的用户名密码,采用basic auth

./gofound --auth=admin:123456

data

指定索引数据存储的目录,可以是相对路径,也可以是绝对路径。

相对路径是存在gofound所在目录下的。


```shell
./gofound --data=./data
./gofound --data=/www/data

debug

设置是否开启调试模式。默认为true

./gofound --debug=false

dictionary

设置自定义词典路径。默认为./data/dictionary.txt

./gofound --dictionary=./data/dictionary.txt

enableAdmin

设置是否开启后台管理。默认为true

./gofound --enableAdmin=false

enableGzip

设置是否开启gzip压缩。默认为true

./gofound --enableGzip=false

gomaxprocs

设置GOMAXPROCS。默认为CPU数量X2。

./gofound --gomaxprocs=10

shard

设置文件分片数量。默认为10。分片越多查询会越快,相反的磁盘IO和CPU会越多。

./gofound --shard=10

timeout

单位为秒。默认为600秒。

数据库超时关闭时间,如果设置为-1,表示永不关闭,适合频繁查询的。如果时间过久会造成内存占用过多

./gofound --timeout=600
Go
1
https://gitee.com/quotation-marks/gofound.git
git@gitee.com:quotation-marks/gofound.git
quotation-marks
gofound
GoFound
main

搜索帮助

53164aa7 5694891 3bd8fe86 5694891