北京网站设计首选 新鸿儒,哪些网站可以做问卷调查,长丰网站建设,小程序seo排名文章目录HugeGraph Server1 概述2 依赖2.1 安装JDK-1.83 部署3.1 下载tar包4 安装启动4.1 解压4.2 配置Hbase5 访问Server5.1 服务启动状态校验6 停止Server7 多图配置HugeGraph-Hubble 基于Web的可视化图形界面1.概述2.安装3 使用3.1创建图HugeGraph Server
1 概述
HugeGrap…
文章目录HugeGraph Server1 概述2 依赖2.1 安装JDK-1.83 部署3.1 下载tar包4 安装启动4.1 解压4.2 配置Hbase5 访问Server5.1 服务启动状态校验6 停止Server7 多图配置HugeGraph-Hubble 基于Web的可视化图形界面1.概述2.安装3 使用3.1创建图HugeGraph Server
1 概述
HugeGraph-Server 是 HugeGraph 项目的核心部分包含Core、Backend、API等子模块。
Core模块是Tinkerpop接口的实现Backend模块用于管理数据存储目前支持的后端包括Memory、Cassandra、ScyllaDB以及RocksDBAPI模块提供HTTP Server将Client的HTTP请求转化为对Core的调用。 文档中会大量出现HugeGraph-Server及HugeGraphServer这两种写法其他组件也类似。这两种写法含义上并无大的差异可以这么区分HugeGraph-Server表示服务端相关组件代码HugeGraphServer表示服务进程。 2 依赖
2.1 安装JDK-1.8
HugeGraph-Server 基于jdk-1.8开发代码用到了较多jdk-1.8中的类和方法请用户自行安装配置。
在往下阅读之前务必执行java -version命令查看jdk版本
3 部署
有三种方式可以部署HugeGraph-Server组件
方式1一键部署方式2下载tar包方式3源码编译
这里我们只介绍下载tar包方式其他方式参考官方文档 https://hugegraph.github.io/hugegraph-doc/quickstart/hugegraph-server.html
3.1 下载tar包
wget https://github.com/hugegraph/hugegraph/releases/download/v${version}/hugegraph-${version}.tar.gz
tar -zxvf hugegraph-${version}.tar.gz也可以在 https://hugegraph.github.io/hugegraph-doc/download.html 下载
这里我们使用0.11.2版本安装
4 安装启动
启动分为首次启动和非首次启动这么区分是因为在第一次启动前需要初始化后端数据库然后启动服务。 而在人为停掉服务后或者其他原因需要再次启动服务时因为后端数据库是持久化存在的直接启动服务即可。
HugeGraphServer启动时会连接后端存储并尝试检查后端存储版本号如果未初始化后端或者后端已初始化但版本不匹配时旧版本数据HugeGraphServer会启动失败并给出错误信息。
如果需要外部访问HugeGraphServer请修改rest-server.properties的restserver.url配置项 默认为http://127.0.0.1:8080修改成机器名或IP地址。
由于各种后端所需的配置hugegraph.properties及启动步骤略有不同下面逐一对各后端的配置及启动做介绍。
4.1 解压
tar -zxvf hugegraph-0.11.2.tar.gz 4.2 配置Hbase vim conf/hugegraph.properties backendhbase
serializerhbase
# hbase backend config
hbase.hosts10.8.11.12
hbase.port2181
hbase.znode_parent/hbase-unsecure初始化数据库仅第一次启动时需要
cd hugegraph-${version}
bin/init-store.sh提示如下结果并且无报错则成功
2021-11-02 21:05:37 24754 [Thread-1] [INFO ] com.baidu.hugegraph.HugeGraph [] - HugeGraph is shutting down
Initialization finished.启动server
[hugegraph-0.11.2]# bin/start-hugegraph.sh
Starting HugeGraphServer...
Connecting to HugeGraphServer (http://0.0.0.0:8080/graphs).......OK
Started [pid 14169]5 访问Server
5.1 服务启动状态校验
jps查看服务进程
# jps
6475 HugeGraphServercurl请求RESTfulAPI
echo curl -o /dev/null -s -w %{http_code} http://localhost:8080/graphs/hugegraph/graph/vertices返回结果200代表server启动正常
6 停止Server
$cd hugegraph-${version}
$bin/stop-hugegraph.sh7 多图配置
rest-server.properties配置自己新增的图配置文件jast_graph.properties vim rest-server.properties
# graphs list with pair NAME:CONF_PATH
graphs[hugegraph:conf/hugegraph.properties,jast_graph:conf/jast_graph.properties]创建配置文件jast_graph.properties
# 修改为自己图的名称其他的图配置与之前配置方法相同
storejast_graph修改gremlin-server.yaml vim gremlin-server.yaml
# 新增jast_graph 配置文件
graphs: {jast_graph: conf/jast_graph.properties,hugegraph: conf/hugegraph.properties
}我们这里配置的hbase需要再次执行bin/init-store.sh 重启服务
[rootnode3 hugegraph-0.11.2]# bin/stop-hugegraph.sh
no crontab for root
The HugeGraphServer monitor has been closed
Killing HugeGraphServer(pid 14169)...OK
[rootnode3 hugegraph-0.11.2]# bin/start-hugegraph.sh
Starting HugeGraphServer...
Connecting to HugeGraphServer (http://0.0.0.0:8080/graphs).......OK
Started [pid 25522]HugeGraph-Hubble 基于Web的可视化图形界面
1.概述
HugeGraph-Hubble 是HugeGraph的一站式可视化分析平台平台涵盖了从数据建模到数据快速导入再到数据的在线、离线分析、以及图的统一管理的全过程实现了图应用的全流程向导式操作旨在提升用户的使用流畅度降低用户的使用门槛提供更为高效易用的使用体验。
2.安装
解压hubble包 tar -zxvf hugegraph-hubble-1.5.0.tar.gz 修改配置文件
# vi conf/hugegraph-hubble.propertiesserver.host0.0.0.0
server.port38088gremlin.suffix_limit250
gremlin.vertex_degree_limit100
gremlin.edges_total_limit500
gremlin.batch_query_ids100 启动Hubble
[root hugegraph-hubble-1.5.0]# bin/start-hubble.sh
starting HugeGraphHubble.....OK
logging to /graph/hugegraph-hubble-1.5.0/logs/hugegraph-hubble.log查看Hubble日志
# tailf logs/hugegraph-hubble.log
2021-11-02 21:19:15.319 INFO 33495 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2021-11-02 21:19:15.838 INFO 33495 --- [ main] com.zaxxer.hikari.HikariDataSource : hugegraph-hubble-HikariCP - Starting...
2021-11-02 21:19:16.074 INFO 33495 --- [ main] com.zaxxer.hikari.HikariDataSource : hugegraph-hubble-HikariCP - Start completed.
2021-11-02 21:19:18.913 INFO 33495 --- [ main] com.baidu.hugegraph.HugeGraphHubble : Started HugeGraphHubble in 7.045 seconds (JVM running for 7.543)
2021-11-02 21:19:18.932 INFO 33495 --- [ main] c.b.h.handler.CustomApplicationRunner : The server info has been inited
2021-11-02 21:19:19.006 INFO 33495 --- [ main] java.util.prefs : Created user preferences directory.
2021-11-02 21:19:19.123 INFO 33495 --- [ main] com.baidu.hugegraph.HugeGraphHubble : The license is successfully installed, valid for Sun Sep 01 00:00:00 CST 2019 - Sat Sep 01 00:00:00 CST 2029
2021-11-02 21:19:19.484 INFO 33495 --- [.0-38088-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet dispatcherServlet
CST 2019 - Sat Sep 01 00:00:00 CST 2029
2021-11-02 21:19:19.484 INFO 33495 --- [http-nio-0.0.0.0-38088-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet dispatcherServlet访问hubble http://${ip}:38088/ 出现以下页面可以正式使用了
3 使用
3.1创建图 图ID随意取个值 图名称hugegraph(我们配置的图名称,在gremlin-server.yaml中配置的graphs值) 主机名0.0.0.0 端口号HugeGraph-Server所配置的端口号即${port} 用户名空 密码空 gremlin-server.yaml中我们配置了两个图分别为jast_graph与hugegraph 如果没配置的图创建则会报错,提示没有该图