incubator-hugegraph
incubator-hugegraph copied to clipboard
[Question] 修改 Server 配置参数后,如何查看配置值及是否生效
Expected behavior 期望表现
{type something here...} 服务启动后,能够将关键参数在页面、日志中输出,方便判断参数是否有设置、是否设置成功。 服务启动后,能够将关键参数在页面、日志中输出,方便判断参数是否有设置、是否设置成功。 服务启动后,能够将关键参数在页面、日志中输出,方便判断参数是否有设置、是否设置成功。
Actual behavior 实际表现
{type something here...} 无!
Steps to reproduce the problem 复现步骤
- {step 1}
- {step 2}
- {step 3}
Status of loaded data 数据状态
Vertex/Edge summary 数据量
- loaded vertices amount: {like 10 million}
- loaded edges amount: {like 20 million}
- loaded time: {like 200s}
Vertex/Edge example 数据示例
{type something here...}
Schema(VertexLabel, EdgeLabel, IndexLabel) 元数据结构
{type something here...}
Specifications of environment 环境信息
- hugegraph version: {v0.9.2}
- operating system: {like centos 6.4, 2 CPUs, 4G RAM}
- hugegraph backend: {hbase-1.2.6}
我在设置timeout参数时,只能通过重复一次又一次的执行 g.V().count()来测试timeout参数是否生效,并且还不知道这个参数,部署的版本是否支持,给调试造成了困难。
你说的建议不错, 关键的参数, 的确可在服务启动时或者加载时打印输出一下, 取个平衡. (后续加一下)
另附一下我的查看思路, 这类问题其实不只是图有, 因为一个服务参数可能很多, 在没有日志的情况下, 我常用是 Arthas 动态查看 :
- 参数是普通静态变量(比如整形/字符串), 可以用
sc -df *ClassName
来获取当前类所有静态变量值, 例如sc -df com.baidu.hugegraph.config.ServerOptions | grep thread
(非常简单) - 如果参数是一个复杂对象封装, 比如
Map/Set/Configuration
等, 可以用getstatic *ClassName paramName -x 2
或ognl
查看具体的值 (简单) - 如果是参数是反射获取, 1或2的方式只能获取参数的默认值, 无法获取当前最新值, 再用
watch/ognl
命令去动态获取加载这些参数的类方法的具体值. (中等)
Due to the lack of activity, the current issue is marked as stale and will be closed after 20 days, any update will remove the stale label