当前位置: 首页 > news >正文

HugeGraph【部署】Linux单机部署

注: hugegraph从版本1.5.0开始,需要 Java11 运行时环境

一、安装JDK11

1.下载JDK11

https://www.oracle.com/java/technologies/downloads/#java11

2.解压缩包

tar -zxvf jdk-11.0.27_linux-x64_bin.tar.gz

3.修改/etc/profile环境变量

export JAVA_HOME=/usr/local/jdk-11.0.27 export JRE_HOME=${JAVA_HOME}/jre export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib:$CLASSPATH export JAVA_PATH=${JAVA_HOME}/bin:${JRE_HOME}/bin export PATH=$PATH:${JAVA_PATH}

4.文件生效

source /etc/profile

二、安装hugegraph-Server

1.下载

https://downloads.apache.org/incubator/hugegraph/1.5.0/apache-hugegraph-incubating-1.5.0.tar.gz

2.解压缩包

tar -zxvf apache-hugegraph-incubating-1.5.0.tar.gz

3.以mysql为数据源进行配置

3.1下载mysql驱动

https://repo1.maven.org/maven2/mysql/mysql-connector-java/8.0.30/mysql-connector-java-8.0.30.jar

比如 mysql-connector-java-8.0.30.jar,并放入 HugeGraph-Server 的 lib 目录下

3.2修改mysql配置

vim /apache-hugegraph-incubating-1.5.0/conf/graphs/hugegraph.properties

store 是数据库名,如果没有会被自动创建

backend=mysql serializer=mysql store=hugegraph # mysql backend config jdbc.driver=com.mysql.cj.jdbc.Driver jdbc.url=jdbc:mysql://127.0.0.1:3306 jdbc.username= jdbc.password= jdbc.reconnect_max_times=3 jdbc.reconnect_interval=3 jdbc.ssl_mode=false

3.3配置账号密码(可以跳过)

配置gremlin-server.yaml文件

vim conf/gremlin-server.yaml #最下面添加 authentication: { authenticator: org.apache.hugegraph.auth.StandardAuthenticator, authenticationHandler: org.apache.hugegraph.auth.WsAndHttpBasicAuthHandler, config: {tokens: conf/rest-server.properties} }

配置rest-server.properties文件

vim conf/rest-server.properties #最下面添加 auth.authenticator=org.apache.hugegraph.auth.StandardAuthenticator auth.graph_store=hugegraph

配置hugegraph.properties文件

vim conf/graphs/hugegraph.properties #替换掉第一行的内容 #gremlin.graph=org.apache.hugegraph.HugeFactory gremlin.graph=org.apache.hugegraph.auth.HugeFactoryAuthProxy

3.4初始化数据库

初始化数据库(如果配置了3.3,此时会让你添加密码,手动输入密码,未配置则是无账号密码

bin/init-store.sh

测试密码: curl -u admin:passwd http://localhost:8080/graphs/hugegraph/schema/vertexlabels

注意事项:官方的init-store.sh脚本写的不够健壮,可能会判断1.9>jdk11,请强制赋值

需要单独把这行拿出来:DEFAULT_JAVA_OPTIONS="--add-exports=java.base/jdk.internal.reflect=ALL-UNNAMED"

3.5修改访问ip配置

conf下的rest-server.properties修改restserver.url=http://0.0.0.0:8080

如果不想配置账号密码,也可以配置多个ip白名单

restserver.urls=http://0.0.0.0:8080,http://192.168.1.100:8080,http://10.0.0.5:8080

4.启动

4.1启动 server

bin/start-hugegraph.sh Starting HugeGraphServer... Connecting to HugeGraphServer (http://127.0.0.1:8080/graphs)....OK

4.2启动 server--创建示例图

bin/start-hugegraph.sh -p true Starting HugeGraphServer in daemon mode... Connecting to HugeGraphServer (http://127.0.0.1:8080/graphs)......OK

使用 RESTful API 请求 HugeGraphServer 如果得到如下结果,则表示部署成功

> curl "http://localhost:8080/graphs/hugegraph/graph/vertices" | gunzip {"vertices":[{"id":"2:lop","label":"software","type":"vertex","properties":{"name":"lop","lang":"java","price":328}},{"id":"1:josh","label":"person","type":"vertex","properties":{"name":"josh","age":32,"city":"Beijing"}},{"id":"1:marko","label":"person","type":"vertex","properties":{"name":"marko","age":29,"city":"Beijing"}},{"id":"1:peter","label":"person","type":"vertex","properties":{"name":"peter","age":35,"city":"Shanghai"}},{"id":"1:vadas","label":"person","type":"vertex","properties":{"name":"vadas","age":27,"city":"Hongkong"}},{"id":"2:ripple","label":"software","type":"vertex","properties":{"name":"ripple","lang":"java","price":199}}]}

三、 安装Hubble可视化界面

1.下载

https://downloads.apache.org/incubator/hugegraph/1.5.0/apache-hugegraph-toolchain-incubating-1.5.0.tar.gz

2.解压缩包

tar -xvf apache-hugegraph-toolchain-incubating-1.5.0.tar.gz

3.启动

进入Hubber 的 bin 目录,并执行 start-hubble.sh 脚本

bash start-hubble.sh

4.访问

127.0.0.1:8088
http://www.cnnetsun.cn/news/3587368.html

相关文章:

  • 【AI写作生产力跃迁指南】:20年内容架构师亲授观点提炼×逻辑强化×风格定制三重实战法
  • 问卷调查设计:从基础到高级的数据收集技巧
  • DM642 EVM视频处理系统迁移:FVID驱动与内存优化实战
  • TI MCU PMM电源管理模块寄存器级编程与低功耗设计实战
  • C2000 ERAD模块实战:硬件级系统监控与实时诊断技术解析
  • Windows server安装nginx详细教程,包教包会
  • TC3_Check function定位出错代码
  • 从Bing Copilot到私有化部署:全球TOP10 AI搜索架构拆解(含开源vs商用、云原生vs边缘部署的12项硬指标对比)
  • 5步实现Windows自动化部署:unattend-generator让IT运维效率提升300%
  • 中国电子多项AI创新成果入选国资央企人工智能典型案例
  • 【Python课程设计/毕业设计】基于Python的便民智慧医疗问诊预约管理系统设计 数字化医疗预约与辅助诊疗信息系统【附源码、数据库、万字文档】
  • 【Python课程设计/毕业设计】基于 Python Web 的医院门诊预约系统 高校 / 社区医院预约挂号服务系统设计 智能门诊预约与医生排班管理系统【附源码、数据库、万字文档】
  • 上海温州老旧房改造:上门出方案的几家服务商解析
  • P1049 [NOIP 2001 普及组] 装箱问题
  • Ajax异步请求解析,打通前后端,看这一篇就够了
  • AIGC率能不能降到个位数?讲清原理实测降到合格
  • namae背后的技术:React组件设计与多平台API集成原理
  • 基于TI DM642与RF-5框架的MPEG-2实时编解码系统设计与调优
  • 网络热词“那什么的交互“的传播与沟通密码
  • 小白程序员必备:大模型研究助手反查纠错,让报告更可信!
  • 2026年最火爆的就业方向!小白程序员必收藏的Agent学习指南
  • 3分钟快速上手iptv-checker:智能检测你的IPTV播放源
  • Windows系统文件dxtrans.dll丢失找不到问题解决
  • 知网AIGC检测报告怎么看?段落分布图和逐段标注读懂了降AI效率翻倍
  • Trampoline RTOS任务管理实战:优先级调度与资源共享最佳实践
  • 基于Java+MySQL+SSM流浪动物救助站
  • 程序员必备工具链:从开发到部署的全栈效率指南
  • 【JAVA毕设源码分享】基于springboot中药材店铺管理系统的设计与实现(程序+文档+代码讲解+一条龙定制)
  • DFS序详解:原理、应用与实现
  • 汉化paraview下载安装包