JanusGraph数据库配置(官网中文翻译)

版权声明:如果觉得本文对您有用或写得好,还请往左边点个赞哦~~~如有错误欢迎指出哦 https://blog.csdn.net/wzwdcld/article/details/82082760

4配置

有关所有选项的完整列表,请参阅第15章,配置参考

4.3 全局配置

JanusGraph区分本地和全局配置选项。本地配置选项适用于单个JanusGraph实例。全局配置选项适用于群集中的所有实例。更具体地说,JanusGraph区分了以下五个配置选项范围:

  • LOCAL:这些选项仅适用于单个JanusGraph实例,并在初始化JanusGraph实例时提供的配置中指定。
  • MASKABLE:可以通过本地配置文件为单个JanusGraph实例重写这些配置选项。如果本地配置文件未指定该选项,则从全局JanusGraph集群配置中读取其值。
  • GLOBAL:始终从群集配置中读取这些选项,并且不能在实例的基础上重写这些选项。
  • GLOBAL_OFFLINE:与 GLOBAL一样,但更改这些选项需要重新启动群集以确保整个群集中的值相同。
  • FIXED:与 GLOBAL一样,但是一旦初始化JanusGraph集群,就无法更改该值。

When the first JanusGraph instance in a cluster is started, the global configuration options are initialized from the provided local configuration file. Subsequently changing global configuration options is done through JanusGraph’s management API. To access the management API, call g.getManagementSystem() on an open JanusGraph instance handle g. For example, to change the default caching behavior on a JanusGraph cluster:

启动集群中的第一个JanusGraph实例时,将从本地配置文件初始化全局配置选项。随后,通过JanusGraph的管理API完成更改全局配置选项。要访问管理API,请在一个打开的JanusGraph instance handle g.上调用g.getManagementSystem()。例如,要更改JanusGraph集群上的默认缓存行为:

mgmt = graph.openManagement()
mgmt.get('cache.db-cache')
// Prints the current config setting
mgmt.set('cache.db-cache', true)
// Changes option
mgmt.get('cache.db-cache')
// Prints 'true'
mgmt.commit()
// Changes take effect

4.3.1.更改离线配置

Changing configuration options does not affect running instances and only applies to newly started ones. Changing GLOBAL_OFFLINEconfiguration options requires restarting the cluster so that the changes take effect immediately for all instances. To change GLOBAL_OFFLINEoptions follow these steps:

更改配置选项不会影响正在运行的实例,仅适用于新启动的实例。更改GLOBAL_OFFLINE配置选项需要重新启动集群,以使更改立即对所有实例生效。要更改GLOBAL_OFFLINE选项,请按以下步骤操作:

  • 关闭集群中除一个JanusGraph实例外的所有实例
  • 连接到单个实例
  • 确保关闭所有正在运行的事务
  • 确保没有启动新事务(即群集必须脱机)
  • 打开管理API
  • 更改配置选项
  • 调用commit,commit会自动关闭graph实例
  • 重启所有实例

猜你喜欢

转载自blog.csdn.net/wzwdcld/article/details/82082760
今日推荐