安装 Neo4j 集群服务器

要使所有内容在 Kubernetes 中正常工作,需要特定的 K8s 对象具有在别处引用的特定名称。每个 Neo4j 实例都是一个 Helm “发布”(release),并拥有一个发布名称。发布名称必须由小写字母数字字符、-. 组成,并且必须以字母数字字符开头和结尾。

以下安装示例使用 server-1server-2server-3 作为集群成员的发布名称。

  1. 使用在创建 Helm 部署值文件中创建的 server-<num>.values.yaml 文件和 neo4j/neo4j Helm chart 分别安装每个服务器。

    1. 创建一个 neo4j 命名空间并将其配置为在当前上下文中使用

      kubectl create namespace neo4j
      kubectl config set-context --current --namespace=neo4j
    2. 安装 server-1

      helm install server-1 neo4j/neo4j --namespace neo4j -f server-1.values.yaml
      输出示例
      NAME: server-1
      LAST DEPLOYED: Wed Oct 26 11:50:41 2022
      NAMESPACE: neo4j
      STATUS: deployed
      REVISION: 1
      TEST SUITE: None
      NOTES:
      Thank you for installing neo4j.
      
      Your release "server-1" has been installed in namespace "neo4j".
      
      The neo4j user's password has been set to "my-password".
      
      This release creates a single member of a Neo4j cluster. It will not become ready until it is able to form a working Neo4j cluster by joining other Neo4j servers. To create a working cluster at least 3 servers are required.
      
      Once you have a working Neo4j cluster, you can access the Neo4j browser using the IP address of the my-cluster-lb-neo4j service
      eg. http://[SERVICE_IP]:7474
      
      Graphs are everywhere!
    3. 安装 server-2

      helm install server-2 neo4j/neo4j --namespace neo4j -f server-2.values.yaml
      输出示例
      NAME: server-2
      LAST DEPLOYED: Wed Oct 26 11:51:27 2022
      NAMESPACE: neo4j
      STATUS: deployed
      REVISION: 1
      TEST SUITE: None
      NOTES:
      Thank you for installing neo4j.
      
      Your release "server-2" has been installed in namespace "neo4j".
      
      The neo4j user's password has been set to "my-password".
      
      This release creates a single member of a Neo4j cluster. It will not become ready until it is able to form a working Neo4j cluster by joining other Neo4j servers. To create a working cluster at least 3 servers are required.
      
      Once you have a working Neo4j cluster, you can access the Neo4j browser using the IP address of the my-cluster-lb-neo4j service
      eg. http://[SERVICE_IP]:7474
      
      Graphs are everywhere!
    4. 安装 server-3

      helm install server-3 neo4j/neo4j --namespace neo4j -f server-3.values.yaml
      输出示例
      NAME: server-3
      LAST DEPLOYED: Wed Oct 26 11:52:02 2022
      NAMESPACE: neo4j
      STATUS: deployed
      REVISION: 1
      TEST SUITE: None
      NOTES:
      Thank you for installing neo4j.
      
      Your release "server-3" has been installed in namespace "neo4j".
      
      The neo4j user's password has been set to "my-password".
      
      This release creates a single member of a Neo4j cluster. It will not become ready until it is able to form a working Neo4j cluster by joining other Neo4j servers. To create a working cluster at least 3 servers are required.
      
      Once you have a working Neo4j cluster, you can access the Neo4j browser using the IP address of the my-cluster-lb-neo4j service
      eg. http://[SERVICE_IP]:7474
      
      Graphs are everywhere!

      如果您没有为 neo4j 用户传递密码,Neo4j Helm chart 已为您自动生成了一个密码。所有集群成员的密码均相同。您可以在 Helm 安装输出中找到它。请记下该密码。

  2. 验证已安装的服务器是否已形成集群。请参阅下一节验证 Neo4j 集群形成