栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

1-hugegraph源码学习-idea启动hugegraph-server

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

1-hugegraph源码学习-idea启动hugegraph-server

1.源码&文档地址
  1. hugegraph-server源码下载地址:https://github.com/apache/incubator-hugegraph-doc/blob/master/download.md
  2. hugegraph官方文档:https://hugegraph.apache.org/cn/docs/
2.环境准备
  1. jdk:1.8+
  2. mysql:8.0.x
  3. hugegraph-server:0.12.0
  4. 操作系统:windows
3.环境搭建(单图) 3.1将下载好的源码导入idea 3.2修改配置文件 3.2.1修改gremlin-server.yaml

gremlin-server.yaml位于hugegraph-distsrcassemblystaticconf下

  • 由于win的路径问题,默认配置files: [conf/empty-sample.groovy]会找不到empty-sample.groovy这个文件,这里有两种解决办法
    1. 将files: [conf/empty-sample.groovy]注释掉
    2. 将empty-sample.groovy文件copy到/下,并修改file为files: [empty-sample.groovy]
3.2.2修改rest-server.properties

rest-server.properties位于hugegraph-distsrcassemblystaticconf下

  1. 如果要对外访问,将restserver.url的host修改为0.0.0.0
  2. 将graphs的值改为graphs包的绝对路径
3.2.3修改hugegraph.properties

hugegraph.properties位于hugegraph-distsrcassemblystaticconfgraphs下

gremlin.graph=com.baidu.hugegraph.HugeFactory

vertex.cache_type=l2
edge.cache_type=l2

# schema illegal name template
#schema.illegal_name_regex=s+|~.*

#vertex.default_label=vertex

backend=mysql
serializer=mysql

store=hugegraph

raft.mode=false
raft.safe_read=false
raft.use_snapshot=false
raft.endpoint=127.0.0.1:8281
raft.group_peers=127.0.0.1:8281,127.0.0.1:8282,127.0.0.1:8283
raft.path=./raft-log
raft.use_replicator_pipeline=true
raft.election_timeout=10000
raft.snapshot_interval=3600
raft.backend_threads=48
raft.read_index_threads=8
raft.read_strategy=ReadOnlyLeaseBased
raft.queue_size=16384
raft.queue_publish_timeout=60
raft.apply_batch=1
raft.rpc_threads=80
raft.rpc_connect_timeout=5000
raft.rpc_timeout=60000

search.text_analyzer=jieba
search.text_analyzer_mode=INDEX

# rocksdb backend config
#rocksdb.data_path=/path/to/disk
#rocksdb.wal_path=/path/to/disk


# cassandra backend config
#cassandra.host=localhost
#cassandra.port=9042
#cassandra.username=
#cassandra.password=
#cassandra.connect_timeout=5
#cassandra.read_timeout=20
#cassandra.keyspace.strategy=SimpleStrategy
#cassandra.keyspace.replication=3

# hbase backend config
#hbase.hosts=localhost
#hbase.port=2181
#hbase.znode_parent=/hbase
#hbase.threads_max=64

# mysql backend config
jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306
jdbc.username=root
jdbc.password=root
jdbc.reconnect_max_times=3
jdbc.reconnect_interval=3
jdbc.sslmode=false

# postgresql & cockroachdb backend config
#jdbc.driver=org.postgresql.Driver
#jdbc.url=jdbc:postgresql://localhost:5432/
#jdbc.username=postgres
#jdbc.password=
#jdbc.postgresql.connect_database=template1

# palo backend config
#palo.host=127.0.0.1
#palo.poll_interval=10
#palo.temp_dir=./palo-data
#palo.file_limit_size=32

  • 当后端存储选用mysql时,backend和serializer都要配置为mysql
    • backend=mysql
    • serializer=mysql
3.3初始化数据库(仅第一次启动前需要)




6,program arguments应填写rest-server.properties文件的绝对路径

启动后控制台出现如下日志则初始化成功

3.4启动hugegraph-server




6,program arguments应填写gremlin-server.yaml和rest-server.properties文件的绝对路径,中间用空格隔开,这里注意先后顺序,gremlin-server.yaml应在前

启动后控制台出现如下日志则启动成功

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/975331.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号