Neo4J 图库的集群部署与基础使用
Ned4J 图库的集群部署与基础使用
部署机器
| 名称 | 配置 | IP |
|---|---|---|
| server1 | 8 核 16G | 172.16.0.2 |
| server2 | 8 核 16G | 172.16.0.3 |
| server3 | 8 核 16G | 172.16.0.4 |
| server4 | 8 核 16G | 172.16.0.5 |
# 创建项目目录
mkdir -p /opt/neo4j/
# 环境变量
export USER_ID="$(id -u)"
export GROUP_ID="$(id -g)"
export NEO4J_DOCKER_IMAGE=neo4j:5-community
export NEO4J_EDITION=docker_compose
export EXTENDED_CONF=yes
export NEO4J_ACCEPT_LICENSE_AGREEMENT=yes
export NEO4J_AUTH=neo4j/your_password
neo4j.conf 配置文件
# Setting that specifies how much memory Neo4j is allowed to use for the page cache.
server.memory.pagecache.size=100M
# Setting that specifies the initial JVM heap size.
server.memory.heap.initial_size=100M
# The behavior of the initial discovery is determined by the parameters `dbms.cluster.discovery.resolver_type` and `dbms.cluster.discovery.endpoints`.
# The DNS strategy fetches the IP addresses of the cluster members using the DNS A records.
# ### dbms.cluster.discovery.resolver_type=DNS
# The value of `dbms.cluster.discovery.endpoints` should be set to a single domain name and the port of the discovery service.
# The domain name returns an A record for every server in the cluster when a DNS lookup is performed.
# Each A record returned by DNS should contain the IP address of the server in the cluster.
# The configured server uses all the IP addresses from the A records to join or form a cluster.
# The discovery port must be the same on all servers when using this configuration.
# ### dbms.cluster.discovery.endpoints=neo4j-network:5000
# Address (the public hostname/IP address of the machine)
# and port setting that specifies where this instance advertises for discovery protocol messages from other members of the cluster.
# ### server.discovery.advertised_address=$(hostname -i)
# Address (the public hostname/IP address of the machine)
# and port setting that specifies where this instance advertises for Raft messages within the cluster.
# ### server.cluster.raft.advertised_address=$(hostname)
# Address (the public hostname/IP address of the machine)
# and port setting that specifies where this instance advertises for requests for transactions in the transaction-shipping catchup protocol.
# ### server.cluster.advertised_address=$(hostname)
# Enable server-side routing
# ###dbms.routing.enabled=true
# Use server-side routing for neo4j:// protocol connections.
# ###dbms.routing.default_router=SERVER
# The advertised address for the intra-cluster routing connector.
# ###server.routing.advertised_address=$(hostname)
# HTTP Connector
#
dbms.connector.http.type=HTTP
dbms.connector.http.enabled=true
dbms.connectors.default_listen_address=0.0.0.0
#
#dbms.connector.http.address=0.0.0.0:#{default.http.port}
dbms.connector.http.address=0.0.0.0:7474
dbms.connector.http.listen_address=0.0.0.0:7474
Docker-Compose.yml 文件
version: '3.8'
# Custom top-level network
networks:
neo4j-internal:
services:
server1:
# Docker image to be used
image: ${NEO4J_DOCKER_IMAGE}
# Hostname
hostname: server1
# Service-level network, which specifies the networks, from the list of the top-level networks (in this case only neo4j-internal), that the server will connect to.
# Adds a network alias (used in neo4j.conf when configuring the discovery members)
networks:
neo4j-internal:
aliases:
- neo4j-network
# The ports that will be accessible from outside the container - HTTP (7474) and Bolt (7687).
ports:
- "7474:7474"
- "7687:7687"
# Uncomment the volumes to be mounted to make them accessible from outside the container.
volumes:
- /opt/neo4j/neo4j.conf:/conf/neo4j.conf # This is the main configuration file.
- /opt/neo4j/data/server1:/var/lib/neo4j/data
- /opt/neo4j/logs/server1:/var/lib/neo4j/logs
- /opt/neo4j/conf/server1:/var/lib/neo4j/conf
- /opt/neo4j/import/server1:/var/lib/neo4j/import
#- /opt/neo4j/metrics/server1:/var/lib/neo4j/metrics
#- /opt/neo4j/licenses/server1:/var/lib/neo4j/licenses
#- /opt/neo4j/ssl/server1:/var/lib/neo4j/ssl
# Passes the following environment variables to the container
environment:
- NEO4J_ACCEPT_LICENSE_AGREEMENT
- NEO4J_AUTH
- EXTENDED_CONF
- NEO4J_EDITION
- NEO4J_initial_server_mode__constraint=PRIMARY
# Simple check testing whether the port 7474 is opened.
# If so, the instance running inside the container is considered as "healthy".
# This status can be checked using the "docker ps" command.
healthcheck:
test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider localhost:7474 || exit 1"]
# Set up the user
user: ${USER_ID}:${GROUP_ID}
server2:
image: ${NEO4J_DOCKER_IMAGE}
hostname: server2
networks:
neo4j-internal:
aliases:
- neo4j-network
ports:
- "7475:7474"
- "7688:7687"
volumes:
- /opt/neo4j/neo4j.conf:/conf/neo4j.conf
- /opt/neo4j/data/server2:/var/lib/neo4j/data
- /opt/neo4j/logs/server2:/var/lib/neo4j/logs
- /opt/neo4j/conf/server2:/var/lib/neo4j/conf
- /opt/neo4j/import/server2:/var/lib/neo4j/import
#- /opt/neo4j/metrics/server2:/var/lib/neo4j/metrics
#- /opt/neo4j/licenses/server2:/var/lib/neo4j/licenses
#- /opt/neo4j/ssl/server2:/var/lib/neo4j/ssl
environment:
- NEO4J_ACCEPT_LICENSE_AGREEMENT
- NEO4J_AUTH
- EXTENDED_CONF
- NEO4J_EDITION
- NEO4J_initial_server_mode__constraint=PRIMARY
healthcheck:
test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider localhost:7474 || exit 1"]
user: ${USER_ID}:${GROUP_ID}
server3:
image: ${NEO4J_DOCKER_IMAGE}
hostname: server3
networks:
neo4j-internal:
aliases:
- neo4j-network
ports:
- "7476:7474"
- "7689:7687"
volumes:
- /opt/neo4j/neo4j.conf:/conf/neo4j.conf
- /opt/neo4j/data/server3:/var/lib/neo4j/data
- /opt/neo4j/logs/server3:/var/lib/neo4j/logs
- /opt/neo4j/conf/server3:/var/lib/neo4j/conf
- /opt/neo4j/import/server3:/var/lib/neo4j/import
#- /opt/neo4j/metrics/server3:/var/lib/neo4j/metrics
#- /opt/neo4j/licenses/server3:/var/lib/neo4j/licenses
#- /opt/neo4j/ssl/server3:/var/lib/neo4j/ssl
environment:
- NEO4J_ACCEPT_LICENSE_AGREEMENT
- NEO4J_AUTH
- EXTENDED_CONF
- NEO4J_EDITION
- NEO4J_initial_server_mode__constraint=PRIMARY
healthcheck:
test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider localhost:7474 || exit 1"]
user: ${USER_ID}:${GROUP_ID}
server4:
image: ${NEO4J_DOCKER_IMAGE}
hostname: server4
networks:
neo4j-internal:
aliases:
- neo4j-network
ports:
- "7477:7474"
- "7690:7687"
volumes:
- /opt/neo4j/neo4j.conf:/conf/neo4j.conf
- /opt/neo4j/data/server4:/var/lib/neo4j/data
- /opt/neo4j/logs/server4:/var/lib/neo4j/logs
- /opt/neo4j/conf/server4:/var/lib/neo4j/conf
- /opt/neo4j/import/server4:/var/lib/neo4j/import
#- /opt/neo4j/metrics/server4:/var/lib/neo4j/metrics
#- /opt/neo4j/licenses/server4:/var/lib/neo4j/licenses
#- /opt/neo4j/ssl/server4:/var/lib/neo4j/ssl
environment:
- NEO4J_ACCEPT_LICENSE_AGREEMENT
- NEO4J_AUTH
- EXTENDED_CONF
- NEO4J_EDITION
- NEO4J_initial_server_mode__constraint=SECONDARY
healthcheck:
test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider localhost:7474 || exit 1"]
user: ${USER_ID}:${GROUP_ID}
version: '2'
services:
neo4j:
image: docker.io/bitnami/neo4j:5
ports:
- '7474:7474'
- '7473:7473'
- '7687:7687'
volumes:
- 'neo4j_data:/bitnami'
environment:
- NEO4J_AUTH=neo4j/bitnami1
volumes:
neo4j_data:
driver: local
Neo4J 的基础使用
基于 7474 端口的访问
通过远程配置的IP访问与配置,特别需要注意的就是对应的Auth这块,从而基于对应的外部IP才可以访问 比如 http://192.168.1.217:7474/

参考
Neo4J 图库的集群部署与基础使用的更多相关文章
- HBase集群部署与基础命令
HBase 集群部署 安装 hbase 之前需要先搭建好 hadoop 集群和 zookeeper 集群.hadoop 集群搭建可以参考:https://www.cnblogs.com/javammc ...
- Storm1.0.3集群部署
Storm集群部署 所有集群部署的基本流程都差不多:下载安装包并上传.解压安装包并配置环境变量.修改配置文件.分发安装包.启动集群.查看集群是否部署成功. 1.所有的集群上都要配置hosts vi ...
- Kafka集群部署 (守护进程启动)
1.Kafka集群部署 1.1集群部署的基本流程 下载安装包.解压安装包.修改配置文件.分发安装包.启动集群 1.2集群部署的基础环境准备 安装前的准备工作(zk集群已经部署完毕) 关闭防火墙 c ...
- Storm集群部署及单词技术
1. 集群部署的基本流程 集群部署的流程:下载安装包.解压安装包.修改配置文件.分发安装包.启动集群 注意: 所有的集群上都需要配置hosts vi /etc/hosts 192.168.239.1 ...
- 2.Storm集群部署及单词统计案例
1.集群部署的基本流程 2.集群部署的基础环境准备 3.Storm集群部署 4.Storm集群的进程及日志熟悉 5.Storm集群的常用操作命令 6.Storm源码下载及目录熟悉 7.Storm 单词 ...
- openstack(pike 版)集群部署(一)----基础环境部署
一.环境 1.系统: a.CentOS Linux release 7.4.1708 (Core) b.更新yum源和安装常用软件 # yum -y install epel-release ba ...
- k8s1.9.0安装--基础集群部署
二.基础集群部署 - kubernetes-simple 1. 部署ETCD(主节点) 1.1 简介 kubernetes需要存储很多东西,像它本身的节点信息,组件信息,还有通过kubernetes运 ...
- Dubbo入门到精通学习笔记(二十):MyCat在MySQL主从复制的基础上实现读写分离、MyCat 集群部署(HAProxy + MyCat)、MyCat 高可用负载均衡集群Keepalived
文章目录 MyCat在MySQL主从复制的基础上实现读写分离 一.环境 二.依赖课程 三.MyCat 介绍 ( MyCat 官网:http://mycat.org.cn/ ) 四.MyCat 的安装 ...
- 2.Ceph 基础篇 - 集群部署及故障排查
文章转载自:https://mp.weixin.qq.com/s?__biz=MzI1MDgwNzQ1MQ==&mid=2247485243&idx=1&sn=e425c31a ...
- 理解 OpenStack + Ceph (1):Ceph + OpenStack 集群部署和配置
本系列文章会深入研究 Ceph 以及 Ceph 和 OpenStack 的集成: (1)安装和部署 (2)Ceph RBD 接口和工具 (3)Ceph 物理和逻辑结构 (4)Ceph 的基础数据结构 ...
随机推荐
- crontab使用说明【一文搞懂Linux定时任务Crontab】
1.简介 cron是一个在后台运行调度的守护进程,而crontab是一个设置cron的工具.cron调度的是/etc/crontab文件. 2.centos安装crontab yum install ...
- 逍遥自在学C语言 | 第一个C语言程序 九层之台起于垒土
一.人物简介 第一位闪亮登场,有请今后会一直教我们C语言的老师 -- 自在. 第二位上场的是和我们一起学习的小白程序猿 -- 逍遥. 二.C语言简介 C语言是一种高级语言,运行效率仅次于汇编,支持跨平 ...
- 鼎捷ERP二维码整体解决方案 Tiptop GP条码管理系统 鼎捷ERP移动解决方案 鼎捷条码扫描 鼎捷WMS仓库移动扫码 鼎捷安卓PDA扫码方案 Tiptop 出入库盘点出货条码扫码 提供源码
本人在ERP实施公司做顾问四五年,参与企业实施ERP十多个项目,非常熟悉企业ERP流程,在实施过程遇到众多问题,提出了不少根据企业具体情况的解决方案. 最近定制开发了一套适合企业的条码扫码平台,基于鼎 ...
- 人工智能 deepface 换脸技术 学习
介绍 Deepface是一个轻量级的python人脸识别和人脸属性分析(年龄.性别.情感和种族)框架.它是一种混合人脸识别框架缠绕状态的最先进的模型:VGG-Face,Google FaceNet,O ...
- JMeter-BeanShell预处理程序和BeanShell后置处理程序的应用
一.什么是BeanShell? BeanShell是用Java写成的,一个小型的.免费的.可以下载的.嵌入式的Java源代码解释器,JMeter性能测试工具也充分接纳了BeanShell解释器,封装成 ...
- 【解释器设计模式详解】C/Java/Go/JS/TS/Python不同语言实现
简介 解释器模式(Interpreter Pattern)是一种行为型设计模式.这种模式实现了一个表达式接口,该接口解释一个特定的上下文.这种模式常被用在 SQL 解析.符号处理引擎等. 解释器模式常 ...
- Android事件分发-基础原理和场景分析
作者:京东零售 郭旭锋 1 为什么需要事件分发 和其他平台类似,Android 中 View 的布局是一个树形结构,各个 ViewGroup 和 View 是按树形结构嵌套布局的,从而会出现用户触摸的 ...
- Docker快速部署Hadoop环境
文章目录 安装环境 安装过程 拉取镜像 在Docker中创建网络,方便通信 创建Master节点 创建slave1和slave2节点 分别进入三个容器修改hosts文件 在Master执行集群初始化 ...
- 「学习笔记」2-SAT问题
SAT 是适定性 (Satisfiability) 问题的简称.一般形式为 k - 适定性问题,简称 k-SAT.而当 \(k>2\) 时该问题为 NP 完全的.所以我们只研究 \(k=2\) ...
- 【Redis】Cluster集群
一.Redis Cluster 工作原理 在引入哨兵机制后,解决了Redis主从架构Master故障时的主从切换问题,保证了Redis服务可用性.但依旧无法解决单机节点出现的写入性能瓶颈(网卡速率.单 ...