Apache Geode 加载已有的配置文件到集群配置中

      为了加载已有的cache.xml 或 gemfire.properties配置文件到一个新的集群中,在启动定位器时使用--load-cluster-configuration-from-dir参数。

      你可以使用这个技术迁移一个单独的服务器配置到集群配置服务。为了加载一个已有的 cache.xml文件或是集群配置到集群,按以下步骤操作:

  1. 确保定位器此时不在运行。
  2. 在定位器的工作目录,如果不存在cluster_config/cluster目录,那么创建它。
  3. 考贝需要的配置文件 (cache.xml 或 gemfire.properties,或两者)到cluster_config/cluster目录。
  4. 按如下重命名配置文件:

    • 将cache.xml 重命名为 cluster.xml
    • gemfire.properties 重命名为 cluster.properties
  5. 按如下gfsh命令启动定位器:

gfsh>start locator --name=<locator_name> --enable-cluster-configuration=true --load-cluster-configuration-from-dir=true

    在成功启动之后,定位器应该报告 “ Cluster configuration service is up and running.”任何加入这个集群的并用--use-cluster-configuration设为true的服务器将会使用这些配置文件。

注意:  如果你对cluster.xml或cluster.properties(or group_name.xml 或 group_name.properties)文件作了任何的手动修改,你必须停止定位器然后使用--load-cluster-configuration-from-dir参数重启定位器。在没有重启的情况下直接修改文件是不会被集群配置服务采用的。

猜你喜欢

转载自bewithme.iteye.com/blog/2325056
今日推荐