./bin/teaweb -h./bin/teaweb -v启动服务并在后台运行:
./bin/teaweb start如果要在前端启动服务,并阻塞当前进程,可以使用:
./bin/teaweb./bin/teaweb stop./bin/teaweb restartv0.1以后支持
./bin/teaweb reloadv0.0.8以后支持
./bin/teaweb resetv0.1以后支持
./bin/teaweb status从v0.1.7开始,可以使用以下命令开启pprof模式,用来监控TeaWeb运行性能信息:
./bin/teaweb pprof默认pprof地址为:6060
启动后可以在浏览器上访问这个地址,比如 http://127.0.0.1:6060/debug/pprof/ ,或者使用go tool pprof命令来查看,比如查看所有alloc的heap信息:
go tool pprof -alloc_space "http://127.0.0.1:6060/debug/pprof/heap"查看正在使用的内存空间:
go tool pprof -inuse_space "http://127.0.0.1:6060/debug/pprof/heap"查看CPU调用信息:
go tool pprof "http://127.0.0.1:6060/debug/pprof/profile"还有更多的示例可以参考 https://jvns.ca/blog/2017/09/24/profiling-go-with-pprof/。
你可以指定别的地址:
./bin/teaweb pprof 127.0.0.1:8888从v0.1.8开始,可以使用以下命令跟集群同步:
./bin/teaweb sync如果是Master节点,则会自动将本地的配置同步到集群,同步时,只要在configs/下的配置文件都会被同步,所以你可以在configs/下加入自己的配置文件,以便利用集群同步到其他节点。
如果是Slave节点,则自动从集群同步配置到本地。
可以以系统服务的方式管理TeaWeb。
从v0.1.6开始,Linux和Windows支持:
./bin/service-install在Linux上,此命令需要使用root分组的用户操作,所以你可能需要切换到root账号,或者使用sudo ...来运行。
从v0.1.6开始,Linux和Windows支持:
./bin/service-uninstall在Linux上,此命令需要使用root分组的用户操作,所以你可能需要切换到root账号,或者使用sudo ...来运行。