blob: 30e280fd90f83c7aafb96b64f777d02afbb41415 [file] [log] [blame]
<!doctype html>
<html lang="en" class="no-js">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="generator" content="Hugo 0.95.0" />
<link rel="canonical" type="text/html" href="/docs/config/">
<link rel="alternate" type="application/rss&#43;xml" href="/docs/config/index.xml">
<meta name="robots" content="noindex, nofollow">
<link rel="shortcut icon" href="/favicons/favicon.ico" >
<link rel="apple-touch-icon" href="/favicons/apple-touch-icon-180x180.png" sizes="180x180">
<link rel="icon" type="image/png" href="/favicons/favicon-16x16.png" sizes="16x16">
<link rel="icon" type="image/png" href="/favicons/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="/favicons/android-36x36.png" sizes="36x36">
<link rel="icon" type="image/png" href="/favicons/android-48x48.png" sizes="48x48">
<link rel="icon" type="image/png" href="/favicons/android-72x72.png" sizes="72x72">
<link rel="icon" type="image/png" href="/favicons/android-96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="/favicons/android-144x144.png" sizes="144x144">
<link rel="icon" type="image/png" href="/favicons/android-192x192.png" sizes="192x192">
<title>Config | HugeGraph</title>
<meta name="description" content="">
<meta property="og:title" content="Config" />
<meta property="og:description" content="Apache HugeGraph site" />
<meta property="og:type" content="website" />
<meta property="og:url" content="/docs/config/" /><meta property="og:site_name" content="HugeGraph" />
<meta itemprop="name" content="Config">
<meta itemprop="description" content="Apache HugeGraph site"><meta name="twitter:card" content="summary"/>
<meta name="twitter:title" content="Config"/>
<meta name="twitter:description" content="Apache HugeGraph site"/>
<link rel="preload" href="/scss/main.min.0dc89c707c94a8edbf7722b8ffab87c78b14c4c3e2532e1f45bd6d12c3ccf83b.css" as="style">
<link href="/scss/main.min.0dc89c707c94a8edbf7722b8ffab87c78b14c4c3e2532e1f45bd6d12c3ccf83b.css" rel="stylesheet" integrity="">
<script
src="https://code.jquery.com/jquery-3.5.1.min.js"
integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0="
crossorigin="anonymous"></script>
<link rel="stylesheet" href="/css/prism.css"/>
<script type="application/javascript">
var doNotTrack = false;
if (!doNotTrack) {
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
ga('create', 'UA-00000000-0', 'auto');
ga('send', 'pageview');
}
</script>
<script async src='https://www.google-analytics.com/analytics.js'></script>
</head>
<body class="td-section">
<header>
<nav class="js-navbar-scroll navbar navbar-expand navbar-dark flex-column flex-md-row td-navbar">
<a class="navbar-brand" href="/">
<span class="navbar-logo"><svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 16 16"><defs><style>.cls-1{fill:none;stroke:#fff;stroke-miterlimit:10;stroke-width:.5px;opacity:.3}.cls-2{fill:#229efa}.cls-3{fill:#9948f7}.cls-4{fill:#33bc7a}.cls-5{fill:url(#未命名的渐变_3)}.cls-6{fill:url(#未命名的渐变_13)}.cls-7{fill:url(#未命名的渐变_11)}</style><linearGradient id="未命名的渐变_3" x1="6.16" y1="14.63" x2="6.16" y2="6.01" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#2e3192"/><stop offset="0" stop-color="#229efa"/><stop offset=".44" stop-color="#239cf8"/><stop offset=".6" stop-color="#2795f2"/><stop offset=".71" stop-color="#2d8ae8"/><stop offset=".81" stop-color="#3679d9"/><stop offset=".89" stop-color="#4263c6"/><stop offset=".95" stop-color="#5048af"/><stop offset="1" stop-color="#5c319b"/></linearGradient><linearGradient id="未命名的渐变_13" x1="10.75" y1="8.2" x2="4.49" y2="1.94" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#991146"/><stop offset="0" stop-color="#326b4e"/><stop offset=".02" stop-color="#3a685c"/><stop offset=".07" stop-color="#506180"/><stop offset=".13" stop-color="#645aa0"/><stop offset=".19" stop-color="#7554bc"/><stop offset=".26" stop-color="#8250d2"/><stop offset=".35" stop-color="#8d4ce3"/><stop offset=".45" stop-color="#944aee"/><stop offset=".6" stop-color="#9848f5"/><stop offset="1" stop-color="#9948f7"/></linearGradient><linearGradient id="未命名的渐变_11" x1="15.34" y1="6.67" x2="7.88" y2="10.98" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#33bc7a"/><stop offset=".45" stop-color="#32ba7a"/><stop offset=".61" stop-color="#2fb37c"/><stop offset=".73" stop-color="#29a87e"/><stop offset=".82" stop-color="#219782"/><stop offset=".9" stop-color="#168186"/><stop offset=".97" stop-color="#09668b"/><stop offset="1" stop-color="#03598e"/></linearGradient></defs><title>logo</title><rect class="cls-1" x="-143.14" y="-373.46" width="597.8" height="424.44"/><circle class="cls-2" cx="12.02" cy="1.83" r="1.33"/><circle class="cls-3" cx="12.02" cy="14.17" r="1.33"/><circle class="cls-4" cx="1.33" cy="8" r="1.33"/><path class="cls-5" d="M7.91 10h0a2.65 2.65.0 01-.23-3.74A1.75 1.75.0 017.91 6h0A2.66 2.66.0 014.4 6h0a1.81 1.81.0 01.24.24A2.65 2.65.0 014.4 10h0a2.62 2.62.0 00-.89 2 2.65 2.65.0 104.4-2z"/><path class="cls-6" d="M12.19 5.49a2.78 2.78.0 01-.5.11A2.64 2.64.0 018.76 3.5h0a2.65 2.65.0 10-2.6 3.17A2.6 2.6.0 007 6.53H7a2.65 2.65.0 013.44 2 2.94 2.94.0 010-.51 2.65 2.65.0 011.75-2.53z"/><path class="cls-7" d="M13 5.35a2.64 2.64.0 00-2.59 2.12h0a3 3 0 01-.08.32A2.65 2.65.0 017.54 9.58a2.86 2.86.0 00.37.41h0a2.63 2.63.0 01.9 2 2.84 2.84.0 01-.05.51 2.64 2.64.0 013.12-2.06l.32.08h0a2.6 2.6.0 00.84.14 2.65 2.65.0 100-5.3z"/></svg></span><span class="font-weight-bold">HugeGraph</span>
</a>
<div class="td-navbar-nav-scroll ml-md-auto" id="main_navbar">
<ul class="navbar-nav mt-2 mt-lg-0">
<li class="nav-item mr-4 mb-2 mb-lg-0">
<a class="nav-link" href="/docs/" ><i class='fas fa-book pr-2'></i><span>Documentation</span></a>
</li>
<li class="nav-item mr-4 mb-2 mb-lg-0">
<a class="nav-link" href="https://github.com/apache/incubator-hugegraph" target="_blank" ><i class='fab fa-github pr-2'></i><span>GitHub</span></a>
</li>
<li class="nav-item mr-4 mb-2 mb-lg-0">
<a class="nav-link" href="/community/" ><span>Community</span></a>
</li>
<li class="nav-item dropdown mr-4 d-none d-lg-block">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
English
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
<a class="dropdown-item" href="/cn/docs/config/">中文</a>
</div>
</li>
</ul>
</div>
<div class="navbar-nav d-none d-lg-block"></div>
</nav>
</header>
<div class="container-fluid td-outer">
<div class="td-main">
<div class="row flex-xl-nowrap">
<main class="col-12 col-md-9 col-xl-8 pl-md-5" role="main">
<div class="td-content">
<div class="pageinfo pageinfo-primary d-print-none">
<p>
This is the multi-page printable view of this section.
<a href="#" onclick="print();return false;">Click here to print</a>.
</p><p>
<a href="/docs/config/">Return to the regular view of this page</a>.
</p>
</div>
<h1 class="title">Config</h1>
<ul>
<li>1: <a href="#pg-af7e8f1dc385b255c4f38b3cbafe224a">HugeGraph 配置</a></li>
<li>2: <a href="#pg-6bfbb2db4e1f281942d741cef305e724">HugeGraph 配置项</a></li>
<li>3: <a href="#pg-7d189549d4201521c83e0d93a2474a2d">HugeGraph 内置用户权限与扩展权限配置及使用</a></li>
<li>4: <a href="#pg-7e400260398a18d0be72b1fe5a73f419">配置 HugeGraphServer 使用 https 协议</a></li>
</ul>
<div class="content">
</div>
</div>
<div class="td-content" style="">
<h1 id="pg-af7e8f1dc385b255c4f38b3cbafe224a">1 - HugeGraph 配置</h1>
<h3 id="1-概述">1 概述</h3>
<p>配置文件的目录为 hugegraph-release/conf,所有关于服务和图本身的配置都在此目录下。</p>
<p>主要的配置文件包括:gremlin-server.yaml、rest-server.properties 和 hugegraph.properties</p>
<p>HugeGraphServer 内部集成了 GremlinServer 和 RestServer,而 gremlin-server.yaml 和 rest-server.properties 就是用来配置这两个Server的。</p>
<ul>
<li><a href="http://tinkerpop.apache.org/docs/3.2.3/reference/#gremlin-server">GremlinServer</a>:GremlinServer接受用户的gremlin语句,解析后转而调用Core的代码。</li>
<li>RestServer:提供RESTful API,根据不同的HTTP请求,调用对应的Core API,如果用户请求体是gremlin语句,则会转发给GremlinServer,实现对图数据的操作。</li>
</ul>
<p>下面对这三个配置文件逐一介绍。</p>
<h3 id="2-gremlin-serveryaml">2 gremlin-server.yaml</h3>
<p>gremlin-server.yaml 文件默认的内容如下:</p>
<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-yaml" data-lang="yaml"><span style="display:flex;"><span><span style="color:#8f5902;font-style:italic"># host and port of gremlin server, need to be consistent with host and port in rest-server.properties</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#8f5902;font-style:italic">#host: 127.0.0.1</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#8f5902;font-style:italic">#port: 8182</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#8f5902;font-style:italic"># timeout in ms of gremlin query</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">scriptEvaluationTimeout</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#0000cf;font-weight:bold">30000</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">channelizer</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">org.apache.tinkerpop.gremlin.server.channel.WsAndHttpChannelizer</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">graphs</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span>{<span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">hugegraph</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">conf/hugegraph.properties</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"></span>}<span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">scriptEngines</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span>{<span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">gremlin-groovy</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span>{<span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">plugins</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span>{<span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">com.baidu.hugegraph.plugin.HugeGraphGremlinPlugin</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span>{}<span style="color:#000;font-weight:bold">,</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">org.apache.tinkerpop.gremlin.server.jsr223.GremlinServerGremlinPlugin</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span>{}<span style="color:#000;font-weight:bold">,</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span>{<span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">classImports</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000;font-weight:bold">[</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">java.lang.Math,</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">com.baidu.hugegraph.backend.id.IdGenerator,</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">com.baidu.hugegraph.type.define.Directions,</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">com.baidu.hugegraph.type.define.NodeRole,</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">com.baidu.hugegraph.traversal.algorithm.CustomizePathsTraverser,</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">com.baidu.hugegraph.traversal.algorithm.CustomizedCrosspointsTraverser,</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">com.baidu.hugegraph.traversal.algorithm.FusiformSimilarityTraverser,</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">com.baidu.hugegraph.traversal.algorithm.HugeTraverser,</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">com.baidu.hugegraph.traversal.algorithm.NeighborRankTraverser,</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">com.baidu.hugegraph.traversal.algorithm.PathsTraverser,</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">com.baidu.hugegraph.traversal.algorithm.PersonalRankTraverser,</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">com.baidu.hugegraph.traversal.algorithm.ShortestPathTraverser,</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">com.baidu.hugegraph.traversal.algorithm.SubGraphTraverser,</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">com.baidu.hugegraph.traversal.optimize.Text,</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">com.baidu.hugegraph.traversal.optimize.TraversalUtil,</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">com.baidu.hugegraph.util.DateUtil</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000;font-weight:bold">],</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">methodImports</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000;font-weight:bold">[</span><span style="color:#000">java.lang.Math#*]</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span>}<span style="color:#000;font-weight:bold">,</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span>{<span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">files</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000;font-weight:bold">[</span><span style="color:#000">scripts/empty-sample.groovy]</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span>}<span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span>}<span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span>}<span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"></span>}<span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">serializers</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span>- {<span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">className</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">org.apache.tinkerpop.gremlin.driver.ser.GraphBinaryMessageSerializerV1,</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">config</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span>{<span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">serializeResultToString</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">false</span><span style="color:#000;font-weight:bold">,</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">ioRegistries</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000;font-weight:bold">[</span><span style="color:#000">com.baidu.hugegraph.io.HugeGraphIoRegistry]</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span>}<span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span>}<span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span>- {<span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">className</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0,</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">config</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span>{<span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">serializeResultToString</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">false</span><span style="color:#000;font-weight:bold">,</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">ioRegistries</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000;font-weight:bold">[</span><span style="color:#000">com.baidu.hugegraph.io.HugeGraphIoRegistry]</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span>}<span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span>}<span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span>- {<span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">className</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV2d0,</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">config</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span>{<span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">serializeResultToString</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">false</span><span style="color:#000;font-weight:bold">,</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">ioRegistries</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000;font-weight:bold">[</span><span style="color:#000">com.baidu.hugegraph.io.HugeGraphIoRegistry]</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span>}<span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span>}<span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span>- {<span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">className</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0,</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">config</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span>{<span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">serializeResultToString</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">false</span><span style="color:#000;font-weight:bold">,</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">ioRegistries</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000;font-weight:bold">[</span><span style="color:#000">com.baidu.hugegraph.io.HugeGraphIoRegistry]</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span>}<span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span>}<span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metrics</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span>{<span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">consoleReporter</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span>{<span style="color:#204a87;font-weight:bold">enabled: false, interval</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#0000cf;font-weight:bold">180000</span>}<span style="color:#000;font-weight:bold">,</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">csvReporter</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span>{<span style="color:#204a87;font-weight:bold">enabled: false, interval: 180000, fileName</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">./metrics/gremlin-server-metrics.csv},</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">jmxReporter</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span>{<span style="color:#204a87;font-weight:bold">enabled</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">false</span>}<span style="color:#000;font-weight:bold">,</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">slf4jReporter</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span>{<span style="color:#204a87;font-weight:bold">enabled: false, interval</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#0000cf;font-weight:bold">180000</span>}<span style="color:#000;font-weight:bold">,</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">gangliaReporter</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span>{<span style="color:#204a87;font-weight:bold">enabled: false, interval: 180000, addressingMode</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">MULTICAST},</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">graphiteReporter</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span>{<span style="color:#204a87;font-weight:bold">enabled: false, interval</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#0000cf;font-weight:bold">180000</span>}<span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"></span>}<span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">maxInitialLineLength</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#0000cf;font-weight:bold">4096</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">maxHeaderSize</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#0000cf;font-weight:bold">8192</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">maxChunkSize</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#0000cf;font-weight:bold">8192</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">maxContentLength</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#0000cf;font-weight:bold">65536</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">maxAccumulationBufferComponents</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#0000cf;font-weight:bold">1024</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">resultIterationBatchSize</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#0000cf;font-weight:bold">64</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">writeBufferLowWaterMark</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#0000cf;font-weight:bold">32768</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">writeBufferHighWaterMark</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#0000cf;font-weight:bold">65536</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">ssl</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span>{<span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">enabled</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">false</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"></span>}<span style="color:#f8f8f8;text-decoration:underline">
</span></span></span></code></pre></div><p>上面的配置项很多,但目前只需要关注如下几个配置项:channelizer 和 graphs。</p>
<ul>
<li>graphs:GremlinServer 启动时需要打开的图,该项是一个 map 结构,key 是图的名字,value 是该图的配置文件路径;</li>
<li>channelizer:GremlinServer 与客户端有两种通信方式,分别是 WebSocket 和 HTTP(默认)。如果选择 WebSocket,
用户可以通过 <a href="/clients/gremlin-console.html">Gremlin-Console</a> 快速体验 HugeGraph 的特性,但是不支持大规模数据导入,
推荐使用 HTTP 的通信方式,HugeGraph 的外围组件都是基于 HTTP 实现的;</li>
</ul>
<p>默认GremlinServer是服务在 localhost:8182,如果需要修改,配置 host、port 即可</p>
<ul>
<li>host:部署 GremlinServer 机器的机器名或 IP,目前 HugeGraphServer 不支持分布式部署,且GremlinServer不直接暴露给用户;</li>
<li>port:部署 GremlinServer 机器的端口;</li>
</ul>
<p>同时需要在 rest-server.properties 中增加对应的配置项 gremlinserver.url=http://host:port</p>
<h3 id="3-rest-serverproperties">3 rest-server.properties</h3>
<p>rest-server.properties 文件的默认内容如下:</p>
<pre tabindex="0"><code class="language-properties" data-lang="properties"># bind url
restserver.url=http://127.0.0.1:8080
# gremlin server url, need to be consistent with host and port in gremlin-server.yaml
#gremlinserver.url=http://127.0.0.1:8182
# graphs list with pair NAME:CONF_PATH
graphs=[hugegraph:conf/hugegraph.properties]
# authentication
#auth.authenticator=
#auth.admin_token=
#auth.user_tokens=[]
server.id=server-1
server.role=master
</code></pre><ul>
<li>restserver.url:RestServer 提供服务的 url,根据实际环境修改;</li>
<li>graphs:RestServer 启动时也需要打开图,该项为 map 结构,key 是图的名字,value 是该图的配置文件路径;</li>
</ul>
<blockquote>
<p>注意:gremlin-server.yaml 和 rest-server.properties 都包含 graphs 配置项,而 <code>init-store</code> 命令是根据 gremlin-server.yaml 的 graphs 下的图进行初始化的。</p>
</blockquote>
<blockquote>
<p>配置项 gremlinserver.url 是 GremlinServer 为 RestServer 提供服务的 url,该配置项默认为 http://localhost:8182,如需修改,需要和 gremlin-server.yaml 中的 host 和 port 相匹配;</p>
</blockquote>
<h3 id="4-hugegraphproperties">4 hugegraph.properties</h3>
<p>hugegraph.properties 是一类文件,因为如果系统存在多个图,则会有多个相似的文件。该文件用来配置与图存储和查询相关的参数,文件的默认内容如下:</p>
<pre tabindex="0"><code class="language-properties" data-lang="properties"># gremlin entrence to create graph
gremlin.graph=com.baidu.hugegraph.HugeFactory
# cache config
#schema.cache_capacity=100000
# vertex-cache default is 1000w, 10min expired
#vertex.cache_capacity=10000000
#vertex.cache_expire=600
# edge-cache default is 100w, 10min expired
#edge.cache_capacity=1000000
#edge.cache_expire=600
# schema illegal name template
#schema.illegal_name_regex=\s+|~.*
#vertex.default_label=vertex
backend=rocksdb
serializer=binary
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.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://127.0.0.1:3306
#jdbc.username=root
#jdbc.password=
#jdbc.reconnect_max_times=3
#jdbc.reconnect_interval=3
#jdbc.sslmode=false
# postgresql &amp; cockroachdb backend config
#jdbc.driver=org.postgresql.Driver
#jdbc.url=jdbc:postgresql://localhost:5432/
#jdbc.username=postgres
#jdbc.password=
# palo backend config
#palo.host=127.0.0.1
#palo.poll_interval=10
#palo.temp_dir=./palo-data
#palo.file_limit_size=32
</code></pre><p>重点关注未注释的几项:</p>
<ul>
<li>gremlin.graph:GremlinServer 的启动入口,用户不要修改此项;</li>
<li>backend:使用的后端存储,可选值有 memory、cassandra、scylladb 和 rocksdb;</li>
<li>serializer:主要为内部使用,用于将 schema、vertex 和 edge 序列化到后端,对应的可选值为 text、cassandra、scylladb 和 binary;(注:rocksdb后端值需是binary,其他后端backend与serializer值需保持一致,如hbase后端该值为hbase)</li>
<li>store:图存储到后端使用的数据库名,在 cassandra 和 scylladb 中就是 keyspace 名,此项的值与 GremlinServer 和 RestServer 中的图名并无关系,但是出于直观考虑,建议仍然使用相同的名字;</li>
<li>cassandra.host:backend 为 cassandra 或 scylladb 时此项才有意义,cassandra/scylladb 集群的 seeds;</li>
<li>cassandra.port:backend 为 cassandra 或 scylladb 时此项才有意义,cassandra/scylladb 集群的 native port;</li>
<li>rocksdb.data_path:backend 为 rocksdb 时此项才有意义,rocksdb 的数据目录</li>
<li>rocksdb.wal_path:backend 为 rocksdb 时此项才有意义,rocksdb 的日志目录</li>
<li>admin.token: 通过一个token来获取服务器的配置信息,例如:<a href="http://localhost:8080/graphs/hugegraph/conf?token=162f7848-0b6d-4faf-b557-3a0797869c55">http://localhost:8080/graphs/hugegraph/conf?token=162f7848-0b6d-4faf-b557-3a0797869c55</a></li>
</ul>
<h3 id="5-多图配置">5 多图配置</h3>
<p>我们的系统是可以存在多个图的,并且各个图的后端可以不一样,比如图 hugegraph 和 hugegraph1,其中 hugegraph 以 cassandra 作为后端,hugegraph1 以 rocksdb作为后端。</p>
<p>配置方法也很简单:</p>
<p><strong>修改 gremlin-server.yaml</strong></p>
<p>在 gremlin-server.yaml 的 graphs 域中添加一个键值对,键为图的名字,值为图的配置文件路径,比如:</p>
<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-yaml" data-lang="yaml"><span style="display:flex;"><span><span style="color:#204a87;font-weight:bold">graphs</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span>{<span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">hugegraph</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">conf/hugegraph.properties,</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">hugegraph1</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">conf/hugegraph1.properties</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"></span>}<span style="color:#f8f8f8;text-decoration:underline">
</span></span></span></code></pre></div><p><strong>修改 rest-server.properties</strong></p>
<p>在 rest-server.properties 的 graphs 域中添加一个键值对,键为图的名字,值为图的配置文件路径,比如:</p>
<pre tabindex="0"><code class="language-properties" data-lang="properties">graphs=[hugegraph:conf/hugegraph.properties, hugegraph1:conf/hugegraph1.properties]
</code></pre><p><strong>添加 hugegraph1.properties</strong></p>
<p>拷贝 hugegraph.properties,命名为 hugegraph1.properties,修改图对应的数据库名以及关于后端部分的参数,比如:</p>
<pre tabindex="0"><code class="language-properties" data-lang="properties">store=hugegraph1
...
backend=rocksdb
serializer=binary
</code></pre><p><strong>停止 Server,初始化执行 init-store.sh(为新的图创建数据库),重新启动 Server</strong></p>
<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>$ bin/stop-hugegraph.sh
</span></span><span style="display:flex;"><span>$ bin/init-store.sh
</span></span><span style="display:flex;"><span>$ bin/start-hugegraph.sh
</span></span></code></pre></div>
</div>
<div class="td-content" style="page-break-before: always">
<h1 id="pg-6bfbb2db4e1f281942d741cef305e724">2 - HugeGraph 配置项</h1>
<h3 id="gremlin-server-配置项">Gremlin Server 配置项</h3>
<p>对应配置文件<code>gremlin-server.yaml</code></p>
<table>
<thead>
<tr>
<th>config option</th>
<th>default value</th>
<th>descrition</th>
</tr>
</thead>
<tbody>
<tr>
<td>host</td>
<td>127.0.0.1</td>
<td>The host or ip of Gremlin Server.</td>
</tr>
<tr>
<td>port</td>
<td>8182</td>
<td>The listening port of Gremlin Server.</td>
</tr>
<tr>
<td>graphs</td>
<td>hugegraph: conf/hugegraph.properties</td>
<td>The map of graphs with name and config file path.</td>
</tr>
<tr>
<td>scriptEvaluationTimeout</td>
<td>30000</td>
<td>The timeout for gremlin script execution(millisecond).</td>
</tr>
<tr>
<td>channelizer</td>
<td>org.apache.tinkerpop.gremlin.server.channel.HttpChannelizer</td>
<td>Indicates the protocol which the Gremlin Server provides service.</td>
</tr>
<tr>
<td>authentication</td>
<td>authenticator: com.baidu.hugegraph.auth.StandardAuthenticator, config: {tokens: conf/rest-server.properties}</td>
<td>The authenticator and config(contains tokens path) of authentication mechanism.</td>
</tr>
</tbody>
</table>
<h3 id="rest-server--api-配置项">Rest Server &amp; API 配置项</h3>
<p>对应配置文件<code>rest-server.properties</code></p>
<table>
<thead>
<tr>
<th>config option</th>
<th>default value</th>
<th>descrition</th>
</tr>
</thead>
<tbody>
<tr>
<td>graphs</td>
<td>[hugegraph:conf/hugegraph.properties]</td>
<td>The map of graphs&rsquo; name and config file.</td>
</tr>
<tr>
<td>server.id</td>
<td>server-1</td>
<td>The id of rest server, used for license verification.</td>
</tr>
<tr>
<td>server.role</td>
<td>master</td>
<td>The role of nodes in the cluster, available types are [master, worker, computer]</td>
</tr>
<tr>
<td>restserver.url</td>
<td>http://127.0.0.1:8080</td>
<td>The url for listening of rest server.</td>
</tr>
<tr>
<td>ssl.keystore_file</td>
<td>server.keystore</td>
<td>The path of server keystore file used when https protocol is enabled.</td>
</tr>
<tr>
<td>ssl.keystore_password</td>
<td></td>
<td>The password of the path of the server keystore file used when the https protocol is enabled.</td>
</tr>
<tr>
<td>restserver.max_worker_threads</td>
<td>2 * CPUs</td>
<td>The maximum worker threads of rest server.</td>
</tr>
<tr>
<td>restserver.min_free_memory</td>
<td>64</td>
<td>The minimum free memory(MB) of rest server, requests will be rejected when the available memory of system is lower than this value.</td>
</tr>
<tr>
<td>restserver.request_timeout</td>
<td>30</td>
<td>The time in seconds within which a request must complete, -1 means no timeout.</td>
</tr>
<tr>
<td>restserver.connection_idle_timeout</td>
<td>30</td>
<td>The time in seconds to keep an inactive connection alive, -1 means no timeout.</td>
</tr>
<tr>
<td>restserver.connection_max_requests</td>
<td>256</td>
<td>The max number of HTTP requests allowed to be processed on one keep-alive connection, -1 means unlimited.</td>
</tr>
<tr>
<td>gremlinserver.url</td>
<td>http://127.0.0.1:8182</td>
<td>The url of gremlin server.</td>
</tr>
<tr>
<td>gremlinserver.max_route</td>
<td>8</td>
<td>The max route number for gremlin server.</td>
</tr>
<tr>
<td>gremlinserver.timeout</td>
<td>30</td>
<td>The timeout in seconds of waiting for gremlin server.</td>
</tr>
<tr>
<td>batch.max_edges_per_batch</td>
<td>500</td>
<td>The maximum number of edges submitted per batch.</td>
</tr>
<tr>
<td>batch.max_vertices_per_batch</td>
<td>500</td>
<td>The maximum number of vertices submitted per batch.</td>
</tr>
<tr>
<td>batch.max_write_ratio</td>
<td>50</td>
<td>The maximum thread ratio for batch writing, only take effect if the batch.max_write_threads is 0.</td>
</tr>
<tr>
<td>batch.max_write_threads</td>
<td>0</td>
<td>The maximum threads for batch writing, if the value is 0, the actual value will be set to batch.max_write_ratio * restserver.max_worker_threads.</td>
</tr>
<tr>
<td>auth.authenticator</td>
<td></td>
<td>The class path of authenticator implemention. e.g., com.baidu.hugegraph.auth.StandardAuthenticator, or com.baidu.hugegraph.auth.ConfigAuthenticator.</td>
</tr>
<tr>
<td>auth.admin_token</td>
<td>162f7848-0b6d-4faf-b557-3a0797869c55</td>
<td>Token for administrator operations, only for com.baidu.hugegraph.auth.ConfigAuthenticator.</td>
</tr>
<tr>
<td>auth.graph_store</td>
<td>hugegraph</td>
<td>The name of graph used to store authentication information, like users, only for com.baidu.hugegraph.auth.StandardAuthenticator.</td>
</tr>
<tr>
<td>auth.user_tokens</td>
<td>[hugegraph:9fd95c9c-711b-415b-b85f-d4df46ba5c31]</td>
<td>The map of user tokens with name and password, only for com.baidu.hugegraph.auth.ConfigAuthenticator.</td>
</tr>
<tr>
<td>auth.audit_log_rate</td>
<td>1000.0</td>
<td>The max rate of audit log output per user, default value is 1000 records per second.</td>
</tr>
<tr>
<td>auth.cache_capacity</td>
<td>10240</td>
<td>The max cache capacity of each auth cache item.</td>
</tr>
<tr>
<td>auth.cache_expire</td>
<td>600</td>
<td>The expiration time in seconds of vertex cache.</td>
</tr>
<tr>
<td>auth.remote_url</td>
<td></td>
<td>If the address is empty, it provide auth service, otherwise it is auth client and also provide auth service through rpc forwarding. The remote url can be set to multiple addresses, which are concat by &lsquo;,&rsquo;.</td>
</tr>
<tr>
<td>auth.token_expire</td>
<td>86400</td>
<td>The expiration time in seconds after token created</td>
</tr>
<tr>
<td>auth.token_secret</td>
<td>FXQXbJtbCLxODc6tGci732pkH1cyf8Qg</td>
<td>Secret key of HS256 algorithm.</td>
</tr>
<tr>
<td>exception.allow_trace</td>
<td>false</td>
<td>Whether to allow exception trace stack.</td>
</tr>
</tbody>
</table>
<h3 id="基本配置项">基本配置项</h3>
<p>基本配置项及后端配置项对应配置文件:{graph-name}.properties,如<code>hugegraph.properties</code></p>
<table>
<thead>
<tr>
<th>config option</th>
<th>default value</th>
<th>descrition</th>
</tr>
</thead>
<tbody>
<tr>
<td>gremlin.graph</td>
<td>com.baidu.hugegraph.HugeFactory</td>
<td>Gremlin entrance to create graph.</td>
</tr>
<tr>
<td>backend</td>
<td>rocksdb</td>
<td>The data store type, available values are [memory, rocksdb, cassandra, scylladb, hbase, mysql].</td>
</tr>
<tr>
<td>serializer</td>
<td>binary</td>
<td>The serializer for backend store, available values are [text, binary, cassandra, hbase, mysql].</td>
</tr>
<tr>
<td>store</td>
<td>hugegraph</td>
<td>The database name like Cassandra Keyspace.</td>
</tr>
<tr>
<td>store.connection_detect_interval</td>
<td>600</td>
<td>The interval in seconds for detecting connections, if the idle time of a connection exceeds this value, detect it and reconnect if needed before using, value 0 means detecting every time.</td>
</tr>
<tr>
<td>store.graph</td>
<td>g</td>
<td>The graph table name, which store vertex, edge and property.</td>
</tr>
<tr>
<td>store.schema</td>
<td>m</td>
<td>The schema table name, which store meta data.</td>
</tr>
<tr>
<td>store.system</td>
<td>s</td>
<td>The system table name, which store system data.</td>
</tr>
<tr>
<td>schema.illegal_name_regex</td>
<td>.<em>\s+$|~.</em></td>
<td>The regex specified the illegal format for schema name.</td>
</tr>
<tr>
<td>schema.cache_capacity</td>
<td>10000</td>
<td>The max cache size(items) of schema cache.</td>
</tr>
<tr>
<td>vertex.cache_type</td>
<td>l2</td>
<td>The type of vertex cache, allowed values are [l1, l2].</td>
</tr>
<tr>
<td>vertex.cache_capacity</td>
<td>10000000</td>
<td>The max cache size(items) of vertex cache.</td>
</tr>
<tr>
<td>vertex.cache_expire</td>
<td>600</td>
<td>The expire time in seconds of vertex cache.</td>
</tr>
<tr>
<td>vertex.check_customized_id_exist</td>
<td>false</td>
<td>Whether to check the vertices exist for those using customized id strategy.</td>
</tr>
<tr>
<td>vertex.default_label</td>
<td>vertex</td>
<td>The default vertex label.</td>
</tr>
<tr>
<td>vertex.tx_capacity</td>
<td>10000</td>
<td>The max size(items) of vertices(uncommitted) in transaction.</td>
</tr>
<tr>
<td>vertex.check_adjacent_vertex_exist</td>
<td>false</td>
<td>Whether to check the adjacent vertices of edges exist.</td>
</tr>
<tr>
<td>vertex.lazy_load_adjacent_vertex</td>
<td>true</td>
<td>Whether to lazy load adjacent vertices of edges.</td>
</tr>
<tr>
<td>vertex.part_edge_commit_size</td>
<td>5000</td>
<td>Whether to enable the mode to commit part of edges of vertex, enabled if commit size &gt; 0, 0 means disabled.</td>
</tr>
<tr>
<td>vertex.encode_primary_key_number</td>
<td>true</td>
<td>Whether to encode number value of primary key in vertex id.</td>
</tr>
<tr>
<td>vertex.remove_left_index_at_overwrite</td>
<td>false</td>
<td>Whether remove left index at overwrite.</td>
</tr>
<tr>
<td>edge.cache_type</td>
<td>l2</td>
<td>The type of edge cache, allowed values are [l1, l2].</td>
</tr>
<tr>
<td>edge.cache_capacity</td>
<td>1000000</td>
<td>The max cache size(items) of edge cache.</td>
</tr>
<tr>
<td>edge.cache_expire</td>
<td>600</td>
<td>The expiration time in seconds of edge cache.</td>
</tr>
<tr>
<td>edge.tx_capacity</td>
<td>10000</td>
<td>The max size(items) of edges(uncommitted) in transaction.</td>
</tr>
<tr>
<td>query.page_size</td>
<td>500</td>
<td>The size of each page when querying by paging.</td>
</tr>
<tr>
<td>query.batch_size</td>
<td>1000</td>
<td>The size of each batch when querying by batch.</td>
</tr>
<tr>
<td>query.ignore_invalid_data</td>
<td>true</td>
<td>Whether to ignore invalid data of vertex or edge.</td>
</tr>
<tr>
<td>query.index_intersect_threshold</td>
<td>1000</td>
<td>The maximum number of intermediate results to intersect indexes when querying by multiple single index properties.</td>
</tr>
<tr>
<td>query.ramtable_edges_capacity</td>
<td>20000000</td>
<td>The maximum number of edges in ramtable, include OUT and IN edges.</td>
</tr>
<tr>
<td>query.ramtable_enable</td>
<td>false</td>
<td>Whether to enable ramtable for query of adjacent edges.</td>
</tr>
<tr>
<td>query.ramtable_vertices_capacity</td>
<td>10000000</td>
<td>The maximum number of vertices in ramtable, generally the largest vertex id is used as capacity.</td>
</tr>
<tr>
<td>query.optimize_aggregate_by_index</td>
<td>false</td>
<td>Whether to optimize aggregate query(like count) by index.</td>
</tr>
<tr>
<td>oltp.concurrent_depth</td>
<td>10</td>
<td>The min depth to enable concurrent oltp algorithm.</td>
</tr>
<tr>
<td>oltp.concurrent_threads</td>
<td>10</td>
<td>Thread number to concurrently execute oltp algorithm.</td>
</tr>
<tr>
<td>oltp.collection_type</td>
<td>EC</td>
<td>The implementation type of collections used in oltp algorithm.</td>
</tr>
<tr>
<td>rate_limit.read</td>
<td>0</td>
<td>The max rate(times/s) to execute query of vertices/edges.</td>
</tr>
<tr>
<td>rate_limit.write</td>
<td>0</td>
<td>The max rate(items/s) to add/update/delete vertices/edges.</td>
</tr>
<tr>
<td>task.wait_timeout</td>
<td>10</td>
<td>Timeout in seconds for waiting for the task to complete,such as when truncating or clearing the backend.</td>
</tr>
<tr>
<td>task.input_size_limit</td>
<td>16777216</td>
<td>The job input size limit in bytes.</td>
</tr>
<tr>
<td>task.result_size_limit</td>
<td>16777216</td>
<td>The job result size limit in bytes.</td>
</tr>
<tr>
<td>task.sync_deletion</td>
<td>false</td>
<td>Whether to delete schema or expired data synchronously.</td>
</tr>
<tr>
<td>task.ttl_delete_batch</td>
<td>1</td>
<td>The batch size used to delete expired data.</td>
</tr>
<tr>
<td>computer.config</td>
<td>/conf/computer.yaml</td>
<td>The config file path of computer job.</td>
</tr>
<tr>
<td>search.text_analyzer</td>
<td>ikanalyzer</td>
<td>Choose a text analyzer for searching the vertex/edge properties, available type are [word, ansj, hanlp, smartcn, jieba, jcseg, mmseg4j, ikanalyzer].</td>
</tr>
<tr>
<td>search.text_analyzer_mode</td>
<td>smart</td>
<td>Specify the mode for the text analyzer, the available mode of analyzer are {word: [MaximumMatching, ReverseMaximumMatching, MinimumMatching, ReverseMinimumMatching, BidirectionalMaximumMatching, BidirectionalMinimumMatching, BidirectionalMaximumMinimumMatching, FullSegmentation, MinimalWordCount, MaxNgramScore, PureEnglish], ansj: [BaseAnalysis, IndexAnalysis, ToAnalysis, NlpAnalysis], hanlp: [standard, nlp, index, nShort, shortest, speed], smartcn: [], jieba: [SEARCH, INDEX], jcseg: [Simple, Complex], mmseg4j: [Simple, Complex, MaxWord], ikanalyzer: [smart, max_word]}.</td>
</tr>
<tr>
<td>snowflake.datecenter_id</td>
<td>0</td>
<td>The datacenter id of snowflake id generator.</td>
</tr>
<tr>
<td>snowflake.force_string</td>
<td>false</td>
<td>Whether to force the snowflake long id to be a string.</td>
</tr>
<tr>
<td>snowflake.worker_id</td>
<td>0</td>
<td>The worker id of snowflake id generator.</td>
</tr>
<tr>
<td>raft.mode</td>
<td>false</td>
<td>Whether the backend storage works in raft mode.</td>
</tr>
<tr>
<td>raft.safe_read</td>
<td>false</td>
<td>Whether to use linearly consistent read.</td>
</tr>
<tr>
<td>raft.use_snapshot</td>
<td>false</td>
<td>Whether to use snapshot.</td>
</tr>
<tr>
<td>raft.endpoint</td>
<td>127.0.0.1:8281</td>
<td>The peerid of current raft node.</td>
</tr>
<tr>
<td>raft.group_peers</td>
<td>127.0.0.1:8281,127.0.0.1:8282,127.0.0.1:8283</td>
<td>The peers of current raft group.</td>
</tr>
<tr>
<td>raft.path</td>
<td>./raft-log</td>
<td>The log path of current raft node.</td>
</tr>
<tr>
<td>raft.use_replicator_pipeline</td>
<td>true</td>
<td>Whether to use replicator line, when turned on it multiple logs can be sent in parallel, and the next log doesn&rsquo;t have to wait for the ack message of the current log to be sent.</td>
</tr>
<tr>
<td>raft.election_timeout</td>
<td>10000</td>
<td>Timeout in milliseconds to launch a round of election.</td>
</tr>
<tr>
<td>raft.snapshot_interval</td>
<td>3600</td>
<td>The interval in seconds to trigger snapshot save.</td>
</tr>
<tr>
<td>raft.backend_threads</td>
<td>current CPU vcores</td>
<td>The thread number used to apply task to bakcend.</td>
</tr>
<tr>
<td>raft.read_index_threads</td>
<td>8</td>
<td>The thread number used to execute reading index.</td>
</tr>
<tr>
<td>raft.apply_batch</td>
<td>1</td>
<td>The apply batch size to trigger disruptor event handler.</td>
</tr>
<tr>
<td>raft.queue_size</td>
<td>16384</td>
<td>The disruptor buffers size for jraft RaftNode, StateMachine and LogManager.</td>
</tr>
<tr>
<td>raft.queue_publish_timeout</td>
<td>60</td>
<td>The timeout in second when publish event into disruptor.</td>
</tr>
<tr>
<td>raft.rpc_threads</td>
<td>80</td>
<td>The rpc threads for jraft RPC layer.</td>
</tr>
<tr>
<td>raft.rpc_connect_timeout</td>
<td>5000</td>
<td>The rpc connect timeout for jraft rpc.</td>
</tr>
<tr>
<td>raft.rpc_timeout</td>
<td>60000</td>
<td>The rpc timeout for jraft rpc.</td>
</tr>
<tr>
<td>raft.rpc_buf_low_water_mark</td>
<td>10485760</td>
<td>The ChannelOutboundBuffer&rsquo;s low water mark of netty, when buffer size less than this size, the method ChannelOutboundBuffer.isWritable() will return true, it means that low downstream pressure or good network.</td>
</tr>
<tr>
<td>raft.rpc_buf_high_water_mark</td>
<td>20971520</td>
<td>The ChannelOutboundBuffer&rsquo;s high water mark of netty, only when buffer size exceed this size, the method ChannelOutboundBuffer.isWritable() will return false, it means that the downstream pressure is too great to process the request or network is very congestion, upstream needs to limit rate at this time.</td>
</tr>
<tr>
<td>raft.read_strategy</td>
<td>ReadOnlyLeaseBased</td>
<td>The linearizability of read strategy.</td>
</tr>
</tbody>
</table>
<h3 id="rpc-server-配置">RPC server 配置</h3>
<table>
<thead>
<tr>
<th>config option</th>
<th>default value</th>
<th>descrition</th>
</tr>
</thead>
<tbody>
<tr>
<td>rpc.client_connect_timeout</td>
<td>20</td>
<td>The timeout(in seconds) of rpc client connect to rpc server.</td>
</tr>
<tr>
<td>rpc.client_load_balancer</td>
<td>consistentHash</td>
<td>The rpc client uses a load-balancing algorithm to access multiple rpc servers in one cluster. Default value is &lsquo;consistentHash&rsquo;, means forwording by request parameters.</td>
</tr>
<tr>
<td>rpc.client_read_timeout</td>
<td>40</td>
<td>The timeout(in seconds) of rpc client read from rpc server.</td>
</tr>
<tr>
<td>rpc.client_reconnect_period</td>
<td>10</td>
<td>The period(in seconds) of rpc client reconnect to rpc server.</td>
</tr>
<tr>
<td>rpc.client_retries</td>
<td>3</td>
<td>Failed retry number of rpc client calls to rpc server.</td>
</tr>
<tr>
<td>rpc.config_order</td>
<td>999</td>
<td>Sofa rpc configuration file loading order, the larger the more later loading.</td>
</tr>
<tr>
<td>rpc.logger_impl</td>
<td>com.alipay.sofa.rpc.log.SLF4JLoggerImpl</td>
<td>Sofa rpc log implementation class.</td>
</tr>
<tr>
<td>rpc.protocol</td>
<td>bolt</td>
<td>Rpc communication protocol, client and server need to be specified the same value.</td>
</tr>
<tr>
<td>rpc.remote_url</td>
<td></td>
<td>The remote urls of rpc peers, it can be set to multiple addresses, which are concat by &lsquo;,&rsquo;, empty value means not enabled.</td>
</tr>
<tr>
<td>rpc.server_adaptive_port</td>
<td>false</td>
<td>Whether the bound port is adaptive, if it&rsquo;s enabled, when the port is in use, automatically +1 to detect the next available port. Note that this process is not atomic, so there may still be port conflicts.</td>
</tr>
<tr>
<td>rpc.server_host</td>
<td></td>
<td>The hosts/ips bound by rpc server to provide services, empty value means not enabled.</td>
</tr>
<tr>
<td>rpc.server_port</td>
<td>8090</td>
<td>The port bound by rpc server to provide services.</td>
</tr>
<tr>
<td>rpc.server_timeout</td>
<td>30</td>
<td>The timeout(in seconds) of rpc server execution.</td>
</tr>
</tbody>
</table>
<h3 id="cassandra-后端配置项">Cassandra 后端配置项</h3>
<table>
<thead>
<tr>
<th>config option</th>
<th>default value</th>
<th>descrition</th>
</tr>
</thead>
<tbody>
<tr>
<td>backend</td>
<td></td>
<td>Must be set to <code>cassandra</code>.</td>
</tr>
<tr>
<td>serializer</td>
<td></td>
<td>Must be set to <code>cassandra</code>.</td>
</tr>
<tr>
<td>cassandra.host</td>
<td>localhost</td>
<td>The seeds hostname or ip address of cassandra cluster.</td>
</tr>
<tr>
<td>cassandra.port</td>
<td>9042</td>
<td>The seeds port address of cassandra cluster.</td>
</tr>
<tr>
<td>cassandra.connect_timeout</td>
<td>5</td>
<td>The cassandra driver connect server timeout(seconds).</td>
</tr>
<tr>
<td>cassandra.read_timeout</td>
<td>20</td>
<td>The cassandra driver read from server timeout(seconds).</td>
</tr>
<tr>
<td>cassandra.keyspace.strategy</td>
<td>SimpleStrategy</td>
<td>The replication strategy of keyspace, valid value is SimpleStrategy or NetworkTopologyStrategy.</td>
</tr>
<tr>
<td>cassandra.keyspace.replication</td>
<td>[3]</td>
<td>The keyspace replication factor of SimpleStrategy, like &lsquo;[3]&rsquo;.Or replicas in each datacenter of NetworkTopologyStrategy, like &lsquo;[dc1:2,dc2:1]&rsquo;.</td>
</tr>
<tr>
<td>cassandra.username</td>
<td></td>
<td>The username to use to login to cassandra cluster.</td>
</tr>
<tr>
<td>cassandra.password</td>
<td></td>
<td>The password corresponding to cassandra.username.</td>
</tr>
<tr>
<td>cassandra.compression_type</td>
<td>none</td>
<td>The compression algorithm of cassandra transport: none/snappy/lz4.</td>
</tr>
<tr>
<td>cassandra.jmx_port=7199</td>
<td>7199</td>
<td>The port of JMX API service for cassandra.</td>
</tr>
<tr>
<td>cassandra.aggregation_timeout</td>
<td>43200</td>
<td>The timeout in seconds of waiting for aggregation.</td>
</tr>
</tbody>
</table>
<h3 id="scylladb-后端配置项">ScyllaDB 后端配置项</h3>
<table>
<thead>
<tr>
<th>config option</th>
<th>default value</th>
<th>descrition</th>
</tr>
</thead>
<tbody>
<tr>
<td>backend</td>
<td></td>
<td>Must be set to <code>scylladb</code>.</td>
</tr>
<tr>
<td>serializer</td>
<td></td>
<td>Must be set to <code>scylladb</code>.</td>
</tr>
</tbody>
</table>
<p>其它与 Cassandra 后端一致。</p>
<h3 id="rocksdb-后端配置项">RocksDB 后端配置项</h3>
<table>
<thead>
<tr>
<th>config option</th>
<th>default value</th>
<th>descrition</th>
</tr>
</thead>
<tbody>
<tr>
<td>backend</td>
<td></td>
<td>Must be set to <code>rocksdb</code>.</td>
</tr>
<tr>
<td>serializer</td>
<td></td>
<td>Must be set to <code>binary</code>.</td>
</tr>
<tr>
<td>rocksdb.data_disks</td>
<td>[]</td>
<td>The optimized disks for storing data of RocksDB. The format of each element: <code>STORE/TABLE: /path/disk</code>.Allowed keys are [g/vertex, g/edge_out, g/edge_in, g/vertex_label_index, g/edge_label_index, g/range_int_index, g/range_float_index, g/range_long_index, g/range_double_index, g/secondary_index, g/search_index, g/shard_index, g/unique_index, g/olap]</td>
</tr>
<tr>
<td>rocksdb.data_path</td>
<td>rocksdb-data</td>
<td>The path for storing data of RocksDB.</td>
</tr>
<tr>
<td>rocksdb.wal_path</td>
<td>rocksdb-data</td>
<td>The path for storing WAL of RocksDB.</td>
</tr>
<tr>
<td>rocksdb.allow_mmap_reads</td>
<td>false</td>
<td>Allow the OS to mmap file for reading sst tables.</td>
</tr>
<tr>
<td>rocksdb.allow_mmap_writes</td>
<td>false</td>
<td>Allow the OS to mmap file for writing.</td>
</tr>
<tr>
<td>rocksdb.block_cache_capacity</td>
<td>8388608</td>
<td>The amount of block cache in bytes that will be used by RocksDB, 0 means no block cache.</td>
</tr>
<tr>
<td>rocksdb.bloom_filter_bits_per_key</td>
<td>-1</td>
<td>The bits per key in bloom filter, a good value is 10, which yields a filter with ~ 1% false positive rate, -1 means no bloom filter.</td>
</tr>
<tr>
<td>rocksdb.bloom_filter_block_based_mode</td>
<td>false</td>
<td>Use block based filter rather than full filter.</td>
</tr>
<tr>
<td>rocksdb.bloom_filter_whole_key_filtering</td>
<td>true</td>
<td>True if place whole keys in the bloom filter, else place the prefix of keys.</td>
</tr>
<tr>
<td>rocksdb.bottommost_compression</td>
<td>NO_COMPRESSION</td>
<td>The compression algorithm for the bottommost level of RocksDB, allowed values are none/snappy/z/bzip2/lz4/lz4hc/xpress/zstd.</td>
</tr>
<tr>
<td>rocksdb.bulkload_mode</td>
<td>false</td>
<td>Switch to the mode to bulk load data into RocksDB.</td>
</tr>
<tr>
<td>rocksdb.cache_index_and_filter_blocks</td>
<td>false</td>
<td>Indicating if we&rsquo;d put index/filter blocks to the block cache.</td>
</tr>
<tr>
<td>rocksdb.compaction_style</td>
<td>LEVEL</td>
<td>Set compaction style for RocksDB: LEVEL/UNIVERSAL/FIFO.</td>
</tr>
<tr>
<td>rocksdb.compression</td>
<td>SNAPPY_COMPRESSION</td>
<td>The compression algorithm for compressing blocks of RocksDB, allowed values are none/snappy/z/bzip2/lz4/lz4hc/xpress/zstd.</td>
</tr>
<tr>
<td>rocksdb.compression_per_level</td>
<td>[NO_COMPRESSION, NO_COMPRESSION, SNAPPY_COMPRESSION, SNAPPY_COMPRESSION, SNAPPY_COMPRESSION, SNAPPY_COMPRESSION, SNAPPY_COMPRESSION]</td>
<td>The compression algorithms for different levels of RocksDB, allowed values are none/snappy/z/bzip2/lz4/lz4hc/xpress/zstd.</td>
</tr>
<tr>
<td>rocksdb.delayed_write_rate</td>
<td>16777216</td>
<td>The rate limit in bytes/s of user write requests when need to slow down if the compaction gets behind.</td>
</tr>
<tr>
<td>rocksdb.log_level</td>
<td>INFO</td>
<td>The info log level of RocksDB.</td>
</tr>
<tr>
<td>rocksdb.max_background_jobs</td>
<td>8</td>
<td>Maximum number of concurrent background jobs, including flushes and compactions.</td>
</tr>
<tr>
<td>rocksdb.level_compaction_dynamic_level_bytes</td>
<td>false</td>
<td>Whether to enable level_compaction_dynamic_level_bytes, if it&rsquo;s enabled we give max_bytes_for_level_multiplier a priority against max_bytes_for_level_base, the bytes of base level is dynamic for a more predictable LSM tree, it is useful to limit worse case space amplification. Turning this feature on/off for an existing DB can cause unexpected LSM tree structure so it&rsquo;s not recommended.</td>
</tr>
<tr>
<td>rocksdb.max_bytes_for_level_base</td>
<td>536870912</td>
<td>The upper-bound of the total size of level-1 files in bytes.</td>
</tr>
<tr>
<td>rocksdb.max_bytes_for_level_multiplier</td>
<td>10.0</td>
<td>The ratio between the total size of level (L+1) files and the total size of level L files for all L.</td>
</tr>
<tr>
<td>rocksdb.max_open_files</td>
<td>-1</td>
<td>The maximum number of open files that can be cached by RocksDB, -1 means no limit.</td>
</tr>
<tr>
<td>rocksdb.max_subcompactions</td>
<td>4</td>
<td>The value represents the maximum number of threads per compaction job.</td>
</tr>
<tr>
<td>rocksdb.max_write_buffer_number</td>
<td>6</td>
<td>The maximum number of write buffers that are built up in memory.</td>
</tr>
<tr>
<td>rocksdb.max_write_buffer_number_to_maintain</td>
<td>0</td>
<td>The total maximum number of write buffers to maintain in memory.</td>
</tr>
<tr>
<td>rocksdb.min_write_buffer_number_to_merge</td>
<td>2</td>
<td>The minimum number of write buffers that will be merged together.</td>
</tr>
<tr>
<td>rocksdb.num_levels</td>
<td>7</td>
<td>Set the number of levels for this database.</td>
</tr>
<tr>
<td>rocksdb.optimize_filters_for_hits</td>
<td>false</td>
<td>This flag allows us to not store filters for the last level.</td>
</tr>
<tr>
<td>rocksdb.optimize_mode</td>
<td>true</td>
<td>Optimize for heavy workloads and big datasets.</td>
</tr>
<tr>
<td>rocksdb.pin_l0_filter_and_index_blocks_in_cache</td>
<td>false</td>
<td>Indicating if we&rsquo;d put index/filter blocks to the block cache.</td>
</tr>
<tr>
<td>rocksdb.sst_path</td>
<td></td>
<td>The path for ingesting SST file into RocksDB.</td>
</tr>
<tr>
<td>rocksdb.target_file_size_base</td>
<td>67108864</td>
<td>The target file size for compaction in bytes.</td>
</tr>
<tr>
<td>rocksdb.target_file_size_multiplier</td>
<td>1</td>
<td>The size ratio between a level L file and a level (L+1) file.</td>
</tr>
<tr>
<td>rocksdb.use_direct_io_for_flush_and_compaction</td>
<td>false</td>
<td>Enable the OS to use direct read/writes in flush and compaction.</td>
</tr>
<tr>
<td>rocksdb.use_direct_reads</td>
<td>false</td>
<td>Enable the OS to use direct I/O for reading sst tables.</td>
</tr>
<tr>
<td>rocksdb.write_buffer_size</td>
<td>134217728</td>
<td>Amount of data in bytes to build up in memory.</td>
</tr>
<tr>
<td>rocksdb.max_manifest_file_size</td>
<td>104857600</td>
<td>The max size of manifest file in bytes.</td>
</tr>
<tr>
<td>rocksdb.skip_stats_update_on_db_open</td>
<td>false</td>
<td>Whether to skip statistics update when opening the database, setting this flag true allows us to not update statistics.</td>
</tr>
<tr>
<td>rocksdb.max_file_opening_threads</td>
<td>16</td>
<td>The max number of threads used to open files.</td>
</tr>
<tr>
<td>rocksdb.max_total_wal_size</td>
<td>0</td>
<td>Total size of WAL files in bytes. Once WALs exceed this size, we will start forcing the flush of column families related, 0 means no limit.</td>
</tr>
<tr>
<td>rocksdb.db_write_buffer_size</td>
<td>0</td>
<td>Total size of write buffers in bytes across all column families, 0 means no limit.</td>
</tr>
<tr>
<td>rocksdb.delete_obsolete_files_period</td>
<td>21600</td>
<td>The periodicity in seconds when obsolete files get deleted, 0 means always do full purge.</td>
</tr>
<tr>
<td>rocksdb.hard_pending_compaction_bytes_limit</td>
<td>274877906944</td>
<td>The hard limit to impose on pending compaction in bytes.</td>
</tr>
<tr>
<td>rocksdb.level0_file_num_compaction_trigger</td>
<td>2</td>
<td>Number of files to trigger level-0 compaction.</td>
</tr>
<tr>
<td>rocksdb.level0_slowdown_writes_trigger</td>
<td>20</td>
<td>Soft limit on number of level-0 files for slowing down writes.</td>
</tr>
<tr>
<td>rocksdb.level0_stop_writes_trigger</td>
<td>36</td>
<td>Hard limit on number of level-0 files for stopping writes.</td>
</tr>
<tr>
<td>rocksdb.soft_pending_compaction_bytes_limit</td>
<td>68719476736</td>
<td>The soft limit to impose on pending compaction in bytes.</td>
</tr>
</tbody>
</table>
<h3 id="hbase-后端配置项">HBase 后端配置项</h3>
<table>
<thead>
<tr>
<th>config option</th>
<th>default value</th>
<th>descrition</th>
</tr>
</thead>
<tbody>
<tr>
<td>backend</td>
<td></td>
<td>Must be set to <code>hbase</code>.</td>
</tr>
<tr>
<td>serializer</td>
<td></td>
<td>Must be set to <code>hbase</code>.</td>
</tr>
<tr>
<td>hbase.hosts</td>
<td>localhost</td>
<td>The hostnames or ip addresses of HBase zookeeper, separated with commas.</td>
</tr>
<tr>
<td>hbase.port</td>
<td>2181</td>
<td>The port address of HBase zookeeper.</td>
</tr>
<tr>
<td>hbase.threads_max</td>
<td>64</td>
<td>The max threads num of hbase connections.</td>
</tr>
<tr>
<td>hbase.znode_parent</td>
<td>/hbase</td>
<td>The znode parent path of HBase zookeeper.</td>
</tr>
<tr>
<td>hbase.zk_retry</td>
<td>3</td>
<td>The recovery retry times of HBase zookeeper.</td>
</tr>
<tr>
<td>hbase.aggregation_timeout</td>
<td>43200</td>
<td>The timeout in seconds of waiting for aggregation.</td>
</tr>
<tr>
<td>hbase.kerberos_enable</td>
<td>false</td>
<td>Is Kerberos authentication enabled for HBase.</td>
</tr>
<tr>
<td>hbase.kerberos_keytab</td>
<td></td>
<td>The HBase&rsquo;s key tab file for kerberos authentication.</td>
</tr>
<tr>
<td>hbase.kerberos_principal</td>
<td></td>
<td>The HBase&rsquo;s principal for kerberos authentication.</td>
</tr>
<tr>
<td>hbase.krb5_conf</td>
<td>etc/krb5.conf</td>
<td>Kerberos configuration file, including KDC IP, default realm, etc.</td>
</tr>
<tr>
<td>hbase.hbase_site</td>
<td>/etc/hbase/conf/hbase-site.xml</td>
<td>The HBase&rsquo;s configuration file</td>
</tr>
</tbody>
</table>
<h3 id="mysql--postgresql-后端配置项">MySQL &amp; PostgreSQL 后端配置项</h3>
<table>
<thead>
<tr>
<th>config option</th>
<th>default value</th>
<th>descrition</th>
</tr>
</thead>
<tbody>
<tr>
<td>backend</td>
<td></td>
<td>Must be set to <code>mysql</code>.</td>
</tr>
<tr>
<td>serializer</td>
<td></td>
<td>Must be set to <code>mysql</code>.</td>
</tr>
<tr>
<td>jdbc.driver</td>
<td>com.mysql.jdbc.Driver</td>
<td>The JDBC driver class to connect database.</td>
</tr>
<tr>
<td>jdbc.url</td>
<td>jdbc:mysql://127.0.0.1:3306</td>
<td>The url of database in JDBC format.</td>
</tr>
<tr>
<td>jdbc.username</td>
<td>root</td>
<td>The username to login database.</td>
</tr>
<tr>
<td>jdbc.password</td>
<td>******</td>
<td>The password corresponding to jdbc.username.</td>
</tr>
<tr>
<td>jdbc.ssl_mode</td>
<td>false</td>
<td>The SSL mode of connections with database.</td>
</tr>
<tr>
<td>jdbc.reconnect_interval</td>
<td>3</td>
<td>The interval(seconds) between reconnections when the database connection fails.</td>
</tr>
<tr>
<td>jdbc.reconnect_max_times</td>
<td>3</td>
<td>The reconnect times when the database connection fails.</td>
</tr>
<tr>
<td>jdbc.storage_engine</td>
<td>InnoDB</td>
<td>The storage engine of backend store database, like InnoDB/MyISAM/RocksDB for MySQL.</td>
</tr>
<tr>
<td>jdbc.postgresql.connect_database</td>
<td>template1</td>
<td>The database used to connect when init store, drop store or check store exist.</td>
</tr>
</tbody>
</table>
<h3 id="postgresql-后端配置项">PostgreSQL 后端配置项</h3>
<table>
<thead>
<tr>
<th>config option</th>
<th>default value</th>
<th>descrition</th>
</tr>
</thead>
<tbody>
<tr>
<td>backend</td>
<td></td>
<td>Must be set to <code>postgresql</code>.</td>
</tr>
<tr>
<td>serializer</td>
<td></td>
<td>Must be set to <code>postgresql</code>.</td>
</tr>
</tbody>
</table>
<p>其它与 MySQL 后端一致。</p>
<blockquote>
<p>PostgreSQL 后端的 driver 和 url 应该设置为:</p>
<ul>
<li><code>jdbc.driver=org.postgresql.Driver</code></li>
<li><code>jdbc.url=jdbc:postgresql://localhost:5432/</code></li>
</ul>
</blockquote>
</div>
<div class="td-content" style="page-break-before: always">
<h1 id="pg-7d189549d4201521c83e0d93a2474a2d">3 - HugeGraph 内置用户权限与扩展权限配置及使用</h1>
<h3 id="概述">概述</h3>
<p>HugeGraph 为了方便不同用户场景下的鉴权使用,目前内置了两套权限模式:</p>
<ol>
<li>简单的<code>ConfigAuthenticator</code>模式,通过本地配置文件存储用户名和密码 (仅支持单 GraphServer)</li>
<li>完备的<code>StandardAuthenticator</code>模式,支持多用户认证、以及细粒度的权限访问控制,采用基于 “用户-用户组-操作-资源” 的 4 层设计,灵活控制用户角色与权限 (支持多 GraphServer)</li>
</ol>
<p>其中 <code>StandardAuthenticator</code> 模式的几个核心设计:</p>
<ul>
<li>初始化时创建超级管理员 (<code>admin</code>) 用户,后续通过超级管理员创建其它用户,新创建的用户被分配足够权限后,可以创建或管理更多的用户</li>
<li>支持动态创建用户、用户组、资源,支持动态分配或取消权限</li>
<li>用户可以属于一个或多个用户组,每个用户组可以拥有对任意个资源的操作权限,操作类型包括:读、写、删除、执行等种类</li>
<li>&ldquo;资源&rdquo; 描述了图数据库中的数据,比如符合某一类条件的顶点,每一个资源包括 <code>type</code><code>label</code><code>properties</code>三个要素,共有 18 种类型、任意 label、任意 properties 可组合形成的资源,一个资源的内部条件是且关系,多个资源之间的条件是或关系</li>
</ul>
<p>举例说明:</p>
<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span><span style="color:#8f5902;font-style:italic">// 场景:某用户只有北京地区的数据读取权限
</span></span></span><span style="display:flex;"><span><span style="color:#8f5902;font-style:italic"></span><span style="color:#000">user</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#000">name</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#000">xx</span><span style="color:#ce5c00;font-weight:bold">)</span> <span style="color:#ce5c00;font-weight:bold">-</span><span style="color:#000">belong</span><span style="color:#ce5c00;font-weight:bold">-&gt;</span> <span style="color:#000">group</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#000">name</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#000">xx</span><span style="color:#ce5c00;font-weight:bold">)</span> <span style="color:#ce5c00;font-weight:bold">-</span><span style="color:#000">access</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#000">read</span><span style="color:#ce5c00;font-weight:bold">)-&gt;</span> <span style="color:#000">target</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#000">graph</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#000">graph1</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#000">resource</span><span style="color:#ce5c00;font-weight:bold">={</span><span style="color:#000">label</span><span style="color:#ce5c00;font-weight:bold">:</span> <span style="color:#000">person</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#000">city</span><span style="color:#ce5c00;font-weight:bold">:</span> <span style="color:#000">Beijing</span><span style="color:#ce5c00;font-weight:bold">})</span>
</span></span></code></pre></div><h3 id="配置用户认证">配置用户认证</h3>
<p>HugeGraph 默认<strong>不启用</strong>用户认证功能,需通过修改配置文件来启用该功能。内置实现了<code>StandardAuthenticator</code><code>ConfigAuthenticator</code>两种模式,<code>StandardAuthenticator</code>模式支持多用户认证与细粒度权限控制,<code>ConfigAuthenticator</code>模式支持简单的用户权限认证。此外,开发者可以自定义实现<code>HugeAuthenticator</code>接口来对接自身的权限系统。</p>
<p>用户认证方式均采用 <a href="https://zh.wikipedia.org/wiki/HTTP%E5%9F%BA%E6%9C%AC%E8%AE%A4%E8%AF%81">HTTP Basic Authentication</a> ,简单说就是在发送 HTTP 请求时在 <code>Authentication</code> 设置选择 <code>Basic</code> 然后输入对应的用户名和密码,对应 HTTP 明文如下所示 :</p>
<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-http" data-lang="http"><span style="display:flex;"><span><span style="color:#a40000">GET http://localhost:8080/graphs/hugegraph/schema/vertexlabels
</span></span></span><span style="display:flex;"><span><span style="color:#a40000">Authorization: Basic admin xxxx
</span></span></span></code></pre></div><h4 id="standardauthenticator模式">StandardAuthenticator模式</h4>
<p><code>StandardAuthenticator</code>模式是通过在数据库后端存储用户信息来支持用户认证和权限控制,该实现基于数据库存储的用户的名称与密码进行认证(密码已被加密),基于用户的角色来细粒度控制用户权限。下面是具体的配置流程(重启服务生效):</p>
<p>在配置文件<code>gremlin-server.yaml</code>中配置<code>authenticator</code>及其<code>rest-server</code>文件路径:</p>
<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-yaml" data-lang="yaml"><span style="display:flex;"><span><span style="color:#204a87;font-weight:bold">authentication</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span>{<span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">authenticator</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">com.baidu.hugegraph.auth.StandardAuthenticator,</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">authenticationHandler</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">com.baidu.hugegraph.auth.WsAndHttpBasicAuthHandler,</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">config</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span>{<span style="color:#204a87;font-weight:bold">tokens</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">conf/rest-server.properties}</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"></span>}<span style="color:#f8f8f8;text-decoration:underline">
</span></span></span></code></pre></div><p>在配置文件<code>rest-server.properties</code>中配置<code>authenticator</code>及其<code>graph_store</code>信息:</p>
<pre tabindex="0"><code class="language-properties" data-lang="properties">auth.authenticator=com.baidu.hugegraph.auth.StandardAuthenticator
auth.graph_store=hugegraph
# auth client config
# 如果是分开部署 GraphServer 和 AuthServer, 还需要指定下面的配置, 地址填写 AuthServer 的 IP:RPC 端口
#auth.remote_url=127.0.0.1:8899,127.0.0.1:8898,127.0.0.1:8897
</code></pre><p>其中,<code>graph_store</code>配置项是指使用哪一个图来存储用户信息,如果存在多个图的话,选取任意一个均可。</p>
<p>在配置文件<code>hugegraph{n}.properties</code>中配置<code>gremlin.graph</code>信息:</p>
<pre tabindex="0"><code class="language-properties" data-lang="properties">gremlin.graph=com.baidu.hugegraph.auth.HugeFactoryAuthProxy
</code></pre><p>然后详细的权限 API 调用和说明请参考 <a href="/docs/clients/restful-api/auth">Authentication-API</a> 文档</p>
<h4 id="configauthenticator模式">ConfigAuthenticator模式</h4>
<p><code>ConfigAuthenticator</code>模式是通过预先在配置文件中设置用户信息来支持用户认证,该实现是基于配置好的静态<code>tokens</code>来验证用户是否合法。下面是具体的配置流程(重启服务生效):</p>
<p>在配置文件<code>gremlin-server.yaml</code>中配置<code>authenticator</code>及其<code>rest-server</code>文件路径:</p>
<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-yaml" data-lang="yaml"><span style="display:flex;"><span><span style="color:#204a87;font-weight:bold">authentication</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span>{<span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">authenticator</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">com.baidu.hugegraph.auth.ConfigAuthenticator,</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">authenticationHandler</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">com.baidu.hugegraph.auth.WsAndHttpBasicAuthHandler,</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">config</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span>{<span style="color:#204a87;font-weight:bold">tokens</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">conf/rest-server.properties}</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"></span>}<span style="color:#f8f8f8;text-decoration:underline">
</span></span></span></code></pre></div><p>在配置文件<code>rest-server.properties</code>中配置<code>authenticator</code>及其<code>tokens</code>信息:</p>
<pre tabindex="0"><code class="language-properties" data-lang="properties">auth.authenticator=com.baidu.hugegraph.auth.ConfigAuthenticator
auth.admin_token=token-value-a
auth.user_tokens=[hugegraph1:token-value-1, hugegraph2:token-value-2]
</code></pre><p>在配置文件<code>hugegraph{n}.properties</code>中配置<code>gremlin.graph</code>信息:</p>
<pre tabindex="0"><code class="language-properties" data-lang="properties">gremlin.graph=com.baidu.hugegraph.auth.HugeFactoryAuthProxy
</code></pre><h3 id="自定义用户认证系统">自定义用户认证系统</h3>
<p>如果需要支持更加灵活的用户系统,可自定义authenticator进行扩展,自定义authenticator实现接口<code>com.baidu.hugegraph.auth.HugeAuthenticator</code>即可,然后修改配置文件中<code>authenticator</code>配置项指向该实现。</p>
</div>
<div class="td-content" style="page-break-before: always">
<h1 id="pg-7e400260398a18d0be72b1fe5a73f419">4 - 配置 HugeGraphServer 使用 https 协议</h1>
<h3 id="概述">概述</h3>
<p>HugeGraphServer 默认使用的是 http 协议,如果用户对请求的安全性有要求,可以配置成 https。</p>
<h3 id="服务端配置">服务端配置</h3>
<p>修改 conf/rest-server.properties 配置文件,将 restserver.url 的 schema 部分改为 https。</p>
<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-ini" data-lang="ini"><span style="display:flex;"><span><span style="color:#8f5902;font-style:italic"># 将协议设置为 https</span>
</span></span><span style="display:flex;"><span><span style="color:#c4a000">restserver.url</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#4e9a06">https://127.0.0.1:8080</span>
</span></span><span style="display:flex;"><span><span style="color:#8f5902;font-style:italic"># 服务端 keystore 文件路径,当协议为 https 时该默认值自动生效,可按需修改此项</span>
</span></span><span style="display:flex;"><span><span style="color:#c4a000">ssl.keystore_file</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#4e9a06">conf/hugegraph-server.keystore</span>
</span></span><span style="display:flex;"><span><span style="color:#8f5902;font-style:italic"># 服务端 keystore 文件密码,当协议为 https 时该默认值自动生效,可按需修改此项</span>
</span></span><span style="display:flex;"><span><span style="color:#c4a000">ssl.keystore_password</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#4e9a06">******</span>
</span></span></code></pre></div><p>服务端的 conf 目录下已经给出了一个 keystore 文件<code>hugegraph-server.keystore</code>,该文件的密码为<code>hugegraph</code>
这两项都是在开启了 https 协议时的默认值,用户可以生成自己的 keystore 文件及密码,然后修改<code>ssl.keystore_file</code><code>ssl.keystore_password</code>的值。</p>
<h3 id="客户端配置">客户端配置</h3>
<h4 id="在-hugegraph-client-中使用-https">在 HugeGraph-Client 中使用 https</h4>
<p>在构造 HugeClient 时传入 https 相关的配置,代码示例:</p>
<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span><span style="color:#000">String</span> <span style="color:#000">url</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#4e9a06">&#34;https://localhost:8080&#34;</span><span style="color:#ce5c00;font-weight:bold">;</span>
</span></span><span style="display:flex;"><span><span style="color:#000">String</span> <span style="color:#000">graphName</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#4e9a06">&#34;hugegraph&#34;</span><span style="color:#ce5c00;font-weight:bold">;</span>
</span></span><span style="display:flex;"><span><span style="color:#000">HugeClientBuilder</span> <span style="color:#000">builder</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#000">HugeClient</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">builder</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#000">url</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#000">graphName</span><span style="color:#ce5c00;font-weight:bold">);</span>
</span></span><span style="display:flex;"><span><span style="color:#8f5902;font-style:italic">// 客户端 keystore 文件路径
</span></span></span><span style="display:flex;"><span><span style="color:#8f5902;font-style:italic"></span><span style="color:#000">String</span> <span style="color:#000">trustStoreFilePath</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#4e9a06">&#34;hugegraph.truststore&#34;</span><span style="color:#ce5c00;font-weight:bold">;</span>
</span></span><span style="display:flex;"><span><span style="color:#8f5902;font-style:italic">// 客户端 keystore 密码
</span></span></span><span style="display:flex;"><span><span style="color:#8f5902;font-style:italic"></span><span style="color:#000">String</span> <span style="color:#000">trustStorePassword</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#4e9a06">&#34;******&#34;</span><span style="color:#ce5c00;font-weight:bold">;</span>
</span></span><span style="display:flex;"><span><span style="color:#000">builder</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">configSSL</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#000">trustStoreFilePath</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#000">trustStorePassword</span><span style="color:#ce5c00;font-weight:bold">);</span>
</span></span><span style="display:flex;"><span><span style="color:#000">HugeClient</span> <span style="color:#000">hugeClient</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#000">builder</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">build</span><span style="color:#ce5c00;font-weight:bold">();</span>
</span></span></code></pre></div><blockquote>
<p>注意:HugeGraph-Client 在 1.9.0 版本以前是直接以 new 的方式创建,并且不支持 https 协议,在 1.9.0 版本以后改成以 builder 的方式创建,并支持配置 https 协议。</p>
</blockquote>
<h4 id="在-hugegraph-loader-中使用-https">在 HugeGraph-Loader 中使用 https</h4>
<p>启动导入任务时,在命令行中添加如下选项:</p>
<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span><span style="color:#8f5902;font-style:italic"># https</span>
</span></span><span style="display:flex;"><span>--protocol https
</span></span><span style="display:flex;"><span><span style="color:#8f5902;font-style:italic"># 客户端证书文件路径,当指定 --protocol 为 https 时,默认值 conf/hugegraph.truststore 自动生效,可按需修改</span>
</span></span><span style="display:flex;"><span>--trust-store-file <span style="color:#ce5c00;font-weight:bold">{</span>file<span style="color:#ce5c00;font-weight:bold">}</span>
</span></span><span style="display:flex;"><span><span style="color:#8f5902;font-style:italic"># 客户端证书文件密码,当指定 --protocol 为 https 时,默认值 hugegraph 自动生效,可按需修改</span>
</span></span><span style="display:flex;"><span>--trust-store-password <span style="color:#ce5c00;font-weight:bold">{</span>password<span style="color:#ce5c00;font-weight:bold">}</span>
</span></span></code></pre></div><p>hugegraph-loader 的 conf 目录下已经放了一个默认的客户端证书文件 hugegraph.truststore,其密码是 hugegraph。</p>
<h4 id="在-hugegraph-tools-中使用-https">在 HugeGraph-Tools 中使用 https</h4>
<p>执行命令时,在命令行中添加如下选项:</p>
<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span><span style="color:#8f5902;font-style:italic"># 客户端证书文件路径,当 url 中使用 https 协议时,默认值 conf/hugegraph.truststore 自动生效,可按需修改</span>
</span></span><span style="display:flex;"><span>--trust-store-file <span style="color:#ce5c00;font-weight:bold">{</span>file<span style="color:#ce5c00;font-weight:bold">}</span>
</span></span><span style="display:flex;"><span><span style="color:#8f5902;font-style:italic"># 客户端证书文件密码,当 url 中使用 https 协议时,默认值 hugegraph 自动生效,可按需修改</span>
</span></span><span style="display:flex;"><span>--trust-store-password <span style="color:#ce5c00;font-weight:bold">{</span>password<span style="color:#ce5c00;font-weight:bold">}</span>
</span></span><span style="display:flex;"><span><span style="color:#8f5902;font-style:italic"># 执行迁移命令时,当 --target-url 中使用 https 协议时,默认值 conf/hugegraph.truststore 自动生效,可按需修改</span>
</span></span><span style="display:flex;"><span>--target-trust-store-file <span style="color:#ce5c00;font-weight:bold">{</span>target-file<span style="color:#ce5c00;font-weight:bold">}</span>
</span></span><span style="display:flex;"><span><span style="color:#8f5902;font-style:italic"># 执行迁移命令时,当 --target-url 中使用 https 协议时,默认值 hugegraph 自动生效,可按需修改</span>
</span></span><span style="display:flex;"><span>--target-trust-store-password <span style="color:#ce5c00;font-weight:bold">{</span>target-password<span style="color:#ce5c00;font-weight:bold">}</span>
</span></span></code></pre></div><p>hugegraph-tools 的 conf 目录下已经放了一个默认的客户端证书文件 hugegraph.truststore,其密码是 hugegraph。</p>
<h3 id="如何生成证书文件">如何生成证书文件</h3>
<p>本部分给出生成证书的示例,如果默认的证书已经够用,或者已经知晓如何生成,可跳过。</p>
<h4 id="服务端">服务端</h4>
<ol>
<li>⽣成服务端私钥,并且导⼊到服务端 keystore ⽂件中,server.keystore 是给服务端⽤的,其中保存着⾃⼰的私钥</li>
</ol>
<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>keytool -genkey -alias serverkey -keyalg RSA -keystore server.keystore
</span></span></code></pre></div><p>过程中根据需求填写描述信息,默认证书的描述信息如下:</p>
<pre tabindex="0"><code>名字和姓⽒:hugegraph
组织单位名称:hugegraph
组织名称:hugegraph
城市或区域名称:BJ
州或省份名称:BJ
国家代码:CN
</code></pre><ol start="2">
<li>根据服务端私钥,导出服务端证书</li>
</ol>
<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>keytool -export -alias serverkey -keystore server.keystore -file server.crt
</span></span></code></pre></div><p>server.crt 就是服务端的证书</p>
<h4 id="客户端">客户端</h4>
<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>keytool -import -alias serverkey -file server.crt -keystore client.truststore
</span></span></code></pre></div><p>client.truststore 是给客户端⽤的,其中保存着受信任的证书</p>
</div>
</main>
</div>
</div>
<footer class="bg-dark py-3 row d-print-none">
<div class="footer-container">
<div class="row">
<div class="col-1"></div>
<div class="col-4 text-center container-center">
<div class="footer-row">
<a href="https://www.apache.org">
<div class="footer-apache-logo">
<svg id="Layer_2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 7127.6 2890" enable-background="new 0 0 7127.6 2890"><path fill="#6d6e71" d="M7104.7 847.8c15.3 15.3 22.9 33.7 22.9 55.2s-7.6 39.9-22.9 55.4c-15.3 15.4-33.8 23.1-55.6 23.1s-40.2-7.6-55.4-22.9c-15.1-15.3-22.7-33.7-22.7-55.2s7.6-39.9 22.9-55.4c15.3-15.4 33.7-23.1 55.4-23.1C7070.9 824.9 7089.4 832.5 7104.7 847.8zM7098.1 951.9c13.3-13.6 20-29.8 20-48.7s-6.6-35-19.8-48.5c-13.2-13.4-29.4-20.1-48.6-20.1-19.2.0-35.4 6.7-48.7 20.2s-19.9 29.7-19.9 48.7 6.6 35.2 19.7 48.6c13.1 13.4 29.3 20.1 48.5 20.1S7084.7 965.4 7098.1 951.9zm-11-63.8c0 14-6.1 22.8-18.4 26.4l22.5 30.5H7073l-20.3-28.3h-18.6V945h-14.7v-84.6h31.8c12.8.0 22 2.2 27.6 6.6C7084.4 871.4 7087.1 878.4 7087.1 888.1zM7068.2 9e2c3-2.4 4.4-6.5 4.4-12s-1.5-9.4-4.5-11.6-8.4-3.2-16-3.2h-18v30.5h17.5C7059.7 903.6 7065.3 902.4 7068.2 9e2z"/><path fill="#6d6e71" d="M1803.6 499.8v155.4h-20V499.8h-56.8v-19.2h133.9v19.2H1803.6z"/><path fill="#6d6e71" d="M2082.2 655.2v-76.9H1977v76.9h-20V480.5h20v78.9h105.2v-78.9h20v174.7h-20z"/><path fill="#6d6e71" d="M2241.4 499.8v57.4h88.1v19.2h-88.1v59.8h101.8v19h-121.8V480.5H2340v19.2H2241.4z"/><path fill="#d22128" d="M1574.5 1852.4l417.3-997.6h80.1l417.3 997.6h-105.4l-129.3-311.9h-448.2l-127.9 311.9H1574.5zM2032.6 970l-205.1 493.2h404.7L2032.6 970z"/><path fill="#d22128" d="M2596.9 1852.4V854.8H3010c171.4.0 295.1 158.8 295.1 313.3.0 163-115.2 316.1-286.6 316.1h-324.6v368.1h-97zm97-455.3h318.9c118 0 193.9-108.2 193.9-229 0-125.1-92.7-226.2-202.3-226.2h-310.5v455.2z"/><path fill="#d22128" d="M3250.5 1852.4l417.3-997.6h80.1l417.3 997.6h-105.4l-129.3-311.9h-448.2l-127.9 311.9H3250.5zM3708.6 970l-205.1 493.2h404.7L3708.6 970z"/><path fill="#d22128" d="M4637.3 849.1c177 0 306.3 89.9 368.1 217.8l-78.7 47.8c-63.2-132.1-186.9-177-295.1-177-238.9.0-369.5 213.6-369.5 414.5.0 220.6 161.6 420.1 373.7 420.1 112.4.0 244.5-56.2 307.7-185.5l81.5 42.1c-64.6 148.9-241.7 231.8-394.8 231.8-274 0-466.5-261.3-466.5-514.2C4163.8 1106.3 4336.6 849.1 4637.3 849.1z"/><path fill="#d22128" d="M5949.1 854.8v997.6h-98.4v-466.5h-591.5v466.5h-96.9V854.8h96.9v444h591.5v-444H5949.1z"/><path fill="#d22128" d="M6844.6 1765.2v87.1h-670.2V854.8H6832v87.1h-560.6v359.7h489v82.9h-489v380.8H6844.6z"/><path fill="#6d6e71" d="M1667.6 2063.6c11.8 3.5 22.2 8.3 31 14.2l-10.3 22.6c-9-6-18.6-10.4-28.9-13.4-10.2-2.9-20-4.4-29.2-4.4-13.6.0-24.5 2.4-32.6 7.3s-12.2 11.8-12.2 20.7c0 7.6 2.3 14 6.8 19s10.2 8.9 17 11.7c6.8 2.8 16.1 6 28 9.6 14.4 4.6 26 8.9 34.7 12.9 8.8 4 16.3 9.9 22.5 17.8 6.2 7.8 9.3 18.2 9.3 31 0 11.7-3.2 21.8-9.5 30.6-6.3 8.7-15.3 15.5-26.8 20.3-11.6 4.8-24.9 7.2-40 7.2s-29.7-2.9-43.9-8.7c-14.2-5.8-26.4-13.6-36.6-23.4l10.7-21.6c9.6 9.4 20.7 16.7 33.3 21.9 12.6 5.2 24.8 7.8 36.8 7.8 15.3.0 27.3-3 36.1-8.9s13.2-13.9 13.2-23.9c0-7.8-2.3-14.3-6.9-19.4-4.6-5.1-10.3-9-17.1-11.9-6.8-2.8-16.1-6-28-9.6-14.2-4.2-25.7-8.3-34.6-12.2-8.9-3.9-16.4-9.7-22.5-17.5-6.1-7.7-9.2-17.9-9.2-30.6.0-10.9 3-20.4 9-28.6s14.6-14.6 25.6-19.1c11.1-4.5 23.8-6.8 38.2-6.8C1643.8 2058.3 1655.7 2060.1 1667.6 2063.6z"/><path fill="#6d6e71" d="M1980.1 2072.8c16.8 9.4 30.2 22.3 40 38.4 9.8 16.2 14.8 33.9 14.8 53.3.0 19.5-4.9 37.4-14.8 53.6-9.8 16.3-23.2 29.1-40 38.6s-35.3 14.3-55.2 14.3c-20.3.0-38.8-4.7-55.7-14.3-16.8-9.5-30.2-22.4-40-38.6-9.8-16.3-14.8-34.1-14.8-53.6s4.9-37.3 14.8-53.5c9.8-16.2 23.2-29 40-38.3 16.8-9.4 35.4-14 55.7-14C1944.8 2058.6 1963.2 2063.3 1980.1 2072.8zM1881.9 2092.7c-13.1 7.4-23.6 17.5-31.4 30.1-7.8 12.6-11.8 26.5-11.8 41.7.0 15.3 3.9 29.3 11.8 42 7.8 12.7 18.3 22.8 31.4 30.2 13.1 7.4 27.4 11.1 42.9 11.1s29.7-3.7 42.7-11.1 23.3-17.4 31.1-30.2c7.7-12.7 11.6-26.7 11.6-42s-3.9-29.2-11.6-41.8c-7.7-12.6-18.1-22.6-31.1-30s-27.2-11.2-42.6-11.2C1909.4 2081.5 1895.1 2085.2 1881.9 2092.7z"/><path fill="#6d6e71" d="M2186.5 2082.4v74h98.4v23.2h-98.4v90.2h-24.1v-210.6h133.8v23.2H2186.5z"/><path fill="#6d6e71" d="M2491.6 2082.4v187.4h-24.1v-187.4h-68.4v-23.2h161.4v23.2H2491.6z"/><path fill="#6d6e71" d="M2871.8 2269.8l-56.8-177.4-57.6 177.4h-24.5l-70.5-210.6h25.9l57.9 182.7 57.1-182.4 24.1-.3 57.7 182.7 57.1-182.7h25l-70.6 210.6H2871.8z"/><path fill="#6d6e71" d="M3087.3 2216.6l-23.5 53.2h-25.6l94.4-210.6h25l94.1 210.6h-26.1l-23.5-53.2H3087.3zM3144.5 2086.6l-46.9 106.8h94.4l-47.5-106.8z"/><path fill="#6d6e71" d="M3461.1 2202.7c-6 .4-10.7.6-14.1.6h-56v66.5h-24v-210.6h80c26.2.0 46.6 6.2 61.2 18.5 14.5 12.3 21.8 29.8 21.8 52.3.0 17.2-4.1 31.7-12.2 43.3-8.1 11.6-19.8 20-35 25l49.2 71.5h-27.3L3461.1 2202.7zM3491.3 2167.6c10.3-8.4 15.5-20.8 15.5-37 0-15.9-5.2-27.9-15.5-36s-25.1-12.2-44.3-12.2h-56v97.8h56C3466.2 2180.2 3481 2176 3491.3 2167.6z"/><path fill="#6d6e71" d="M3688.3 2082.4v69.2h106.2v23.2h-106.2v72.1h122.8v22.9h-146.9v-210.6h142.9v23.2H3688.3z"/><path fill="#6d6e71" d="M4147 2082.4v74h98.4v23.2H4147v90.2h-24.1v-210.6h133.8v23.2H4147z"/><path fill="#6d6e71" d="M4523.3 2072.8c16.8 9.4 30.2 22.3 40 38.4 9.8 16.2 14.8 33.9 14.8 53.3.0 19.5-4.9 37.4-14.8 53.6-9.8 16.3-23.2 29.1-40 38.6s-35.3 14.3-55.2 14.3c-20.3.0-38.8-4.7-55.7-14.3-16.8-9.5-30.2-22.4-40-38.6-9.8-16.3-14.8-34.1-14.8-53.6s4.9-37.3 14.8-53.5c9.8-16.2 23.2-29 40-38.3 16.8-9.4 35.4-14 55.7-14C4488.1 2058.6 4506.5 2063.3 4523.3 2072.8zM4425.2 2092.7c-13.1 7.4-23.6 17.5-31.4 30.1-7.8 12.6-11.8 26.5-11.8 41.7.0 15.3 3.9 29.3 11.8 42 7.8 12.7 18.3 22.8 31.4 30.2 13.1 7.4 27.4 11.1 42.9 11.1s29.7-3.7 42.7-11.1 23.3-17.4 31.1-30.2c7.7-12.7 11.6-26.7 11.6-42s-3.9-29.2-11.6-41.8c-7.7-12.6-18.1-22.6-31.1-30s-27.2-11.2-42.6-11.2C4452.6 2081.5 4438.3 2085.2 4425.2 2092.7z"/><path fill="#6d6e71" d="M4854.7 2247.7c-15.7 15.5-37.3 23.3-64.8 23.3-27.7.0-49.4-7.8-65.1-23.3-15.7-15.5-23.6-37-23.6-64.6v-124h24.1v124c0 20.3 5.8 36.1 17.3 47.5 11.6 11.4 27.3 17.1 47.3 17.1 20.1.0 35.8-5.7 47.1-17 11.4-11.3 17-27.2 17-47.7v-124h24.1v124C4878.2 2210.7 4870.4 2232.2 4854.7 2247.7z"/><path fill="#6d6e71" d="M5169.5 2269.8l-126.3-169.1v169.1h-24.1v-210.6h25l126.3 169.3v-169.3h23.8v210.6H5169.5z"/><path fill="#6d6e71" d="M5478.4 2073.1c16.4 9.3 29.4 21.9 38.9 37.9 9.6 16 14.3 33.9 14.3 53.5s-4.8 37.6-14.3 53.6c-9.5 16.1-22.6 28.7-39.3 37.9-16.6 9.2-35.2 13.8-55.5 13.8h-84.3v-210.6h85.2C5443.7 2059.2 5462 2063.8 5478.4 2073.1zM5362.3 2246.9h61.4c15.5.0 29.6-3.5 42.3-10.6s22.8-16.9 30.2-29.5c7.4-12.5 11.1-26.5 11.1-42s-3.8-29.4-11.3-41.9-17.7-22.3-30.6-29.6c-12.8-7.2-27-10.9-42.6-10.9h-60.5v164.5z"/><path fill="#6d6e71" d="M5668.6 2216.6l-23.5 53.2h-25.6l94.4-210.6h25l94.1 210.6h-26l-23.5-53.2H5668.6zM5725.8 2086.6l-46.9 106.8h94.4l-47.5-106.8z"/><path fill="#6d6e71" d="M5991 2082.4v187.4h-24v-187.4h-68.4v-23.2H6060v23.2h-69z"/><path fill="#6d6e71" d="M6175.9 2269.8v-210.6h24.1v210.6H6175.9z"/><path fill="#6d6e71" d="M6493.7 2072.8c16.8 9.4 30.2 22.3 40 38.4 9.8 16.2 14.8 33.9 14.8 53.3.0 19.5-4.9 37.4-14.8 53.6-9.8 16.3-23.2 29.1-40 38.6s-35.3 14.3-55.2 14.3c-20.3.0-38.8-4.7-55.7-14.3-16.8-9.5-30.2-22.4-40-38.6-9.8-16.3-14.8-34.1-14.8-53.6s4.9-37.3 14.8-53.5c9.8-16.2 23.2-29 40-38.3 16.8-9.4 35.4-14 55.7-14C6458.5 2058.6 6476.9 2063.3 6493.7 2072.8zM6395.6 2092.7c-13.1 7.4-23.6 17.5-31.4 30.1-7.8 12.6-11.8 26.5-11.8 41.7.0 15.3 3.9 29.3 11.8 42 7.8 12.7 18.3 22.8 31.4 30.2 13.1 7.4 27.4 11.1 42.9 11.1s29.7-3.7 42.7-11.1 23.3-17.4 31.1-30.2c7.7-12.7 11.6-26.7 11.6-42s-3.9-29.2-11.6-41.8c-7.7-12.6-18.1-22.6-31.1-30s-27.2-11.2-42.6-11.2C6423 2081.5 6408.8 2085.2 6395.6 2092.7z"/><path fill="#6d6e71" d="M6826.5 2269.8l-126.3-169.1v169.1h-24.1v-210.6h25l126.3 169.3v-169.3h23.8v210.6H6826.5z"/><linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="-4516.6152" y1="-2338.7222" x2="-4108.4111" y2="-1861.3982" gradientTransform="matrix(0.4226 -0.9063 0.9063 0.4226 5117.8774 -2859.9343)"><stop offset="0" style="stop-color:#F69923"/><stop offset=".3123" style="stop-color:#F79A23"/><stop offset=".8383" style="stop-color:#E97826"/></linearGradient><path fill="url(#SVGID_1_)" d="M1230.1 13.7c-45.3 26.8-120.6 102.5-210.5 212.3l82.6 155.9c58-82.9 116.9-157.5 176.3-221.2 4.6-5.1 7-7.5 7-7.5-2.3 2.5-4.6 5-7 7.5-19.2 21.2-77.5 89.2-165.5 224.4 84.7-4.2 214.9-21.6 321.1-39.7 31.6-177-31-258-31-258S1323.4-41.4 1230.1 13.7z"/><path fill="none" d="M1090.2 903.1c.6-.1 1.2-.2 1.8-.3l-11.9 1.3c-.7.3-1.4.7-2.1 1C1082.1 904.4 1086.2 903.7 1090.2 903.1z"/><path fill="none" d="M1005.9 1182.3c-6.7 1.5-13.7 2.7-20.7 3.7C992.3 1185 999.2 1183.8 1005.9 1182.3z"/><path fill="none" d="M432.9 1808.8c.9-2.3 1.8-4.7 2.6-7 18.2-48 36.2-94.7 54-140.1 20-51 39.8-100.4 59.3-148.3 20.6-50.4 40.9-99.2 60.9-146.3 21-49.4 41.7-97 62-142.8 16.5-37.3 32.8-73.4 48.9-108.3 5.4-11.7 10.7-23.2 16-34.6 10.5-22.7 21-44.8 31.3-66.5 9.5-20 19-39.6 28.3-58.8 3.1-6.4 6.2-12.8 9.3-19.1.5-1 1-2 1.5-3.1l-10.2 1.1-8-15.9c-.8 1.6-1.6 3.1-2.4 4.6-14.5 28.8-28.9 57.9-43.1 87.2-8.2 16.9-16.4 34-24.6 51-22.6 47.4-44.8 95.2-66.6 143.3-22.1 48.6-43.7 97.5-64.9 146.5-20.8 48.1-41.3 96.2-61.2 144.2-20 48-39.5 95.7-58.5 143.2-19.9 49.5-39.2 98.7-58 147.2-4.2 10.9-8.5 21.9-12.7 32.8-15 39.2-29.7 77.8-44 116l12.7 25.1 11.4-1.2c.4-1.1.8-2.3 1.3-3.4C396.7 1905.4 414.9 1856.4 432.9 1808.8z"/><path fill="none" d="M980 1186.8c.1.0.1.0.1-.1C980.1 1186.8 980.1 1186.8 980 1186.8z"/><path fill="#be202e" d="M952.6 1323c-10.6 1.9-21.4 3.8-32.5 5.7-.1.0-.1.1-.2.1 5.6-.8 11.2-1.7 16.6-2.6C942 1325.2 947.3 1324.1 952.6 1323z"/><path opacity=".35" fill="#be202e" d="M952.6 1323c-10.6 1.9-21.4 3.8-32.5 5.7-.1.0-.1.1-.2.1 5.6-.8 11.2-1.7 16.6-2.6C942 1325.2 947.3 1324.1 952.6 1323z"/><path fill="#be202e" d="M980.3 1186.7C980.2 1186.7 980.2 1186.7 980.3 1186.7c-.1.1-.2.1-.2.1 1.8-.2 3.5-.5 5.2-.8 7-1 13.9-2.2 20.7-3.7C997.5 1183.8 989 1185.2 980.3 1186.7z"/><path opacity=".35" fill="#be202e" d="M980.3 1186.7C980.2 1186.7 980.2 1186.7 980.3 1186.7c-.1.1-.2.1-.2.1 1.8-.2 3.5-.5 5.2-.8 7-1 13.9-2.2 20.7-3.7C997.5 1183.8 989 1185.2 980.3 1186.7z"/><linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="-7537.7339" y1="-2391.4075" x2="-4625.4141" y2="-2391.4075" gradientTransform="matrix(0.4226 -0.9063 0.9063 0.4226 5117.8774 -2859.9343)"><stop offset=".3233" style="stop-color:#9E2064"/><stop offset=".6302" style="stop-color:#C92037"/><stop offset=".7514" style="stop-color:#CD2335"/><stop offset="1" style="stop-color:#E97826"/></linearGradient><path fill="url(#SVGID_2_)" d="M858.6 784.7c25.1-46.9 50.5-92.8 76.2-137.4 26.7-46.4 53.7-91.3 80.9-134.7 1.6-2.6 3.2-5.2 4.8-7.7 27-42.7 54.2-83.7 81.6-122.9L1019.5 226c-6.2 7.6-12.5 15.3-18.8 23.2-23.8 29.7-48.6 61.6-73.9 95.5-28.6 38.2-58 78.9-87.8 121.7-27.6 39.5-55.5 80.9-83.5 123.7-23.8 36.5-47.7 74-71.4 112.5-.9 1.4-1.8 2.9-2.6 4.3L789 919.2C811.8 873.6 835.1 828.7 858.6 784.7z"/><linearGradient id="SVGID_3_" gradientUnits="userSpaceOnUse" x1="-7186.1777" y1="-2099.3059" x2="-5450.7183" y2="-2099.3059" gradientTransform="matrix(0.4226 -0.9063 0.9063 0.4226 5117.8774 -2859.9343)"><stop offset="0" style="stop-color:#282662"/><stop offset=".0954839" style="stop-color:#662E8D"/><stop offset=".7882" style="stop-color:#9F2064"/><stop offset=".9487" style="stop-color:#CD2032"/></linearGradient><path fill="url(#SVGID_3_)" d="M369 1981c-14.2 39.1-28.5 78.9-42.9 119.6-.2.6-.4 1.2-.6 1.8-2 5.7-4.1 11.5-6.1 17.2-9.7 27.4-18 52.1-37.3 108.2 31.7 14.5 57.1 52.5 81.1 95.6-2.6-44.7-21-86.6-56.2-119.1 156.1 7 290.6-32.4 360.1-146.6 6.2-10.2 11.9-20.9 17-32.2-31.6 40.1-70.8 57.1-144.5 53-.2.1-.3.1-.5.2.2-.1.3-.1.5-.2 108.6-48.6 163.1-95.3 211.2-172.6 11.4-18.3 22.5-38.4 33.8-60.6-94.9 97.5-205 125.3-320.9 104.2l-86.9 9.5C374.4 1966.3 371.7 1973.6 369 1981z"/><linearGradient id="SVGID_4_" gradientUnits="userSpaceOnUse" x1="-7374.1626" y1="-2418.5454" x2="-4461.8428" y2="-2418.5454" gradientTransform="matrix(0.4226 -0.9063 0.9063 0.4226 5117.8774 -2859.9343)"><stop offset=".3233" style="stop-color:#9E2064"/><stop offset=".6302" style="stop-color:#C92037"/><stop offset=".7514" style="stop-color:#CD2335"/><stop offset="1" style="stop-color:#E97826"/></linearGradient><path fill="url(#SVGID_4_)" d="M409.6 1786.3c18.8-48.5 38.1-97.7 58-147.2 19-47.4 38.5-95.2 58.5-143.2s40.4-96.1 61.2-144.2c21.2-49 42.9-97.8 64.9-146.5 21.8-48.1 44-95.9 66.6-143.3 8.1-17.1 16.3-34.1 24.6-51 14.2-29.3 28.6-58.4 43.1-87.2.8-1.6 1.6-3.1 2.4-4.6L681.4 706.8c-1.8 2.9-3.5 5.8-5.3 8.6-25.1 40.9-50 82.7-74.4 125.4-24.7 43.1-49 87.1-72.7 131.7-20 37.6-39.6 75.6-58.6 113.9-3.8 7.8-7.6 15.5-11.3 23.2-23.4 48.2-44.6 94.8-63.7 139.5-21.7 50.7-40.7 99.2-57.5 145.1-11 30.2-21 59.4-30.1 87.4-7.5 24-14.7 47.9-21.5 71.8-16 56.3-29.9 112.4-41.2 168.3L353 1935.1c14.3-38.1 28.9-76.8 44-116C401.1 1808.2 405.4 1797.3 409.6 1786.3z"/><linearGradient id="SVGID_5_" gradientUnits="userSpaceOnUse" x1="-7161.7642" y1="-2379.1431" x2="-5631.2524" y2="-2379.1431" gradientTransform="matrix(0.4226 -0.9063 0.9063 0.4226 5117.8774 -2859.9343)"><stop offset="0" style="stop-color:#282662"/><stop offset=".0954839" style="stop-color:#662E8D"/><stop offset=".7882" style="stop-color:#9F2064"/><stop offset=".9487" style="stop-color:#CD2032"/></linearGradient><path fill="url(#SVGID_5_)" d="M243.5 1729.4c-13.6 68.2-23.2 136.2-28 203.8-.2 2.4-.4 4.7-.5 7.1-33.7-54-124-106.8-123.8-106.2 64.6 93.7 113.7 186.7 120.9 278-34.6 7.1-82-3.2-136.8-23.3 57.1 52.5 1e2 67 116.7 70.9-52.5 3.3-107.1 39.3-162.1 80.8 80.5-32.8 145.5-45.8 192.1-35.3C148.1 2414.2 74.1 2645 0 2890c22.7-6.7 36.2-21.9 43.9-42.6 13.2-44.4 100.8-335.6 238-718.2 3.9-10.9 7.8-21.8 11.8-32.9 1.1-3 2.2-6.1 3.3-9.2 14.5-40.1 29.5-81.1 45.1-122.9 3.5-9.5 7.1-19 10.7-28.6.1-.2.1-.4.2-.6l-107.9-213.2C244.6 1724.4 244 1726.9 243.5 1729.4z"/><linearGradient id="SVGID_6_" gradientUnits="userSpaceOnUse" x1="-7374.1626" y1="-2117.1309" x2="-4461.8428" y2="-2117.1309" gradientTransform="matrix(0.4226 -0.9063 0.9063 0.4226 5117.8774 -2859.9343)"><stop offset=".3233" style="stop-color:#9E2064"/><stop offset=".6302" style="stop-color:#C92037"/><stop offset=".7514" style="stop-color:#CD2335"/><stop offset="1" style="stop-color:#E97826"/></linearGradient><path fill="url(#SVGID_6_)" d="M805.6 937c-3.1 6.3-6.2 12.7-9.3 19.1-9.3 19.2-18.8 38.8-28.3 58.8-10.3 21.7-20.7 43.9-31.3 66.5-5.3 11.4-10.6 22.9-16 34.6-16.1 35-32.4 71.1-48.9 108.3-20.3 45.8-41 93.4-62 142.8-20 47.1-40.3 95.9-60.9 146.3-19.5 47.9-39.3 97.3-59.3 148.3-17.8 45.4-35.9 92.1-54 140.1-.9 2.3-1.8 4.7-2.6 7-18 47.6-36.2 96.6-54.6 146.8-.4 1.1-.8 2.3-1.3 3.4l86.9-9.5c-1.7-.3-3.5-.5-5.2-.9 103.9-13 242.1-90.6 331.4-186.5 41.1-44.2 78.5-96.3 113-157.3 25.7-45.4 49.8-95.8 72.8-151.5 20.1-48.7 39.4-101.4 58-158.6-23.9 12.6-51.2 21.8-81.4 28.2-5.3 1.1-10.7 2.2-16.1 3.1-5.5 1-11 1.8-16.6 2.6.1.0.1-.1.2-.1 96.9-37.3 158-109.2 202.4-197.4-25.5 17.4-66.9 40.1-116.6 51.1-6.7 1.5-13.7 2.7-20.7 3.7-1.7.3-3.5.6-5.2.8.1.0.1.0.1-.1h.1c33.6-14.1 62-29.8 86.6-48.4 5.3-4 10.4-8.1 15.3-12.3 7.5-6.5 14.7-13.3 21.5-20.5 4.4-4.6 8.6-9.3 12.7-14.2 9.6-11.5 18.7-23.9 27.1-37.3 2.6-4.1 5.1-8.3 7.6-12.6 3.2-6.2 6.3-12.3 9.3-18.3 13.5-27.2 24.4-51.5 33-72.8 4.3-10.6 8.1-20.5 11.3-29.7 1.3-3.7 2.5-7.2 3.7-10.6 3.4-10.2 6.2-19.3 8.4-27.3 3.3-12 5.3-21.5 6.4-28.4-3.3 2.6-7.1 5.2-11.3 7.7-29.3 17.5-79.5 33.4-119.9 40.8l79.8-8.8-79.8 8.8c-.6.1-1.2.2-1.8.3-4 .7-8.1 1.3-12.2 2 .7-.3 1.4-.7 2.1-1l-273 29.9C806.6 935 806.1 936 805.6 937z"/><linearGradient id="SVGID_7_" gradientUnits="userSpaceOnUse" x1="-7554.8232" y1="-2132.0981" x2="-4642.5034" y2="-2132.0981" gradientTransform="matrix(0.4226 -0.9063 0.9063 0.4226 5117.8774 -2859.9343)"><stop offset=".3233" style="stop-color:#9E2064"/><stop offset=".6302" style="stop-color:#C92037"/><stop offset=".7514" style="stop-color:#CD2335"/><stop offset="1" style="stop-color:#E97826"/></linearGradient><path fill="url(#SVGID_7_)" d="M1112.9 385.1c-24.3 37.3-50.8 79.6-79.4 127.5-1.5 2.5-3 5.1-4.5 7.6-24.6 41.5-50.8 87.1-78.3 137-23.8 43.1-48.5 89.3-74.3 139C854 839.5 830.8 885.4 807 934l273-29.9c79.5-36.6 115.1-69.7 149.6-117.6 9.2-13.2 18.4-27 27.5-41.3 28-43.8 55.6-92 80.1-139.9 23.7-46.3 44.7-92.2 60.7-133.5 10.2-26.3 18.4-50.8 24.1-72.3 5-19 8.9-36.9 11.9-54.1C1327.9 363.5 1197.6 380.9 1112.9 385.1z"/><path fill="#be202e" d="M936.5 1326.1c-5.5 1-11 1.8-16.6 2.6C925.5 1328 931 1327.1 936.5 1326.1z"/><path opacity=".35" fill="#be202e" d="M936.5 1326.1c-5.5 1-11 1.8-16.6 2.6C925.5 1328 931 1327.1 936.5 1326.1z"/><linearGradient id="SVGID_8_" gradientUnits="userSpaceOnUse" x1="-7374.1626" y1="-2027.484" x2="-4461.8433" y2="-2027.484" gradientTransform="matrix(0.4226 -0.9063 0.9063 0.4226 5117.8774 -2859.9343)"><stop offset=".3233" style="stop-color:#9E2064"/><stop offset=".6302" style="stop-color:#C92037"/><stop offset=".7514" style="stop-color:#CD2335"/><stop offset="1" style="stop-color:#E97826"/></linearGradient><path fill="url(#SVGID_8_)" d="M936.5 1326.1c-5.5 1-11 1.8-16.6 2.6C925.5 1328 931 1327.1 936.5 1326.1z"/><path fill="#be202e" d="M980 1186.8c1.8-.2 3.5-.5 5.2-.8C983.5 1186.3 981.8 1186.6 980 1186.8z"/><path opacity=".35" fill="#be202e" d="M980 1186.8c1.8-.2 3.5-.5 5.2-.8C983.5 1186.3 981.8 1186.6 980 1186.8z"/><linearGradient id="SVGID_9_" gradientUnits="userSpaceOnUse" x1="-7374.1626" y1="-2037.7417" x2="-4461.8433" y2="-2037.7417" gradientTransform="matrix(0.4226 -0.9063 0.9063 0.4226 5117.8774 -2859.9343)"><stop offset=".3233" style="stop-color:#9E2064"/><stop offset=".6302" style="stop-color:#C92037"/><stop offset=".7514" style="stop-color:#CD2335"/><stop offset="1" style="stop-color:#E97826"/></linearGradient><path fill="url(#SVGID_9_)" d="M980 1186.8c1.8-.2 3.5-.5 5.2-.8C983.5 1186.3 981.8 1186.6 980 1186.8z"/><path fill="#be202e" d="M980.2 1186.7z"/><path opacity=".35" fill="#be202e" d="M980.2 1186.7z"/><linearGradient id="SVGID_10_" gradientUnits="userSpaceOnUse" x1="-5738.0635" y1="-2039.799" x2="-5094.3457" y2="-2039.799" gradientTransform="matrix(0.4226 -0.9063 0.9063 0.4226 5117.8774 -2859.9343)"><stop offset=".3233" style="stop-color:#9E2064"/><stop offset=".6302" style="stop-color:#C92037"/><stop offset=".7514" style="stop-color:#CD2335"/><stop offset="1" style="stop-color:#E97826"/></linearGradient><path fill="url(#SVGID_10_)" d="M980.2 1186.7z"/></svg>
</div>
</a>
<ul class="footer-link">
<li><a class="white" href="http://www.apache.org">Foundation</a></li>
<li><a class="white" href="http://www.apache.org/licenses/">License</a></li>
<li><a class="white" href="https://www.apache.org/security/">Security</a></li>
<li><a class="white" href="http://www.apache.org/events/current-event">Events</a></li>
<li><a class="white" href="http://www.apache.org/foundation/sponsorship.html">Sponsorship</a></li>
<li><a class="white" href="http://www.apache.org/foundation/thanks.html">Thanks</a></li>
</ul>
</div>
</div>
<div class="col-6 text-white text-center container-center">
<p>Copyright &copy; 2022 The Apache Software Foundation, Licensed under the <a class="white" href="https://www.apache.org/licenses/LICENSE-2.0">Apache License Version 2.0</a></p>
<p>Apache and the Apache feather logo are trademarks of The Apache Software Foundation.</p>
</div>
<div class="col-1"></div>
</div>
</div>
</footer>
</div>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js"
integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN"
crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.1/dist/js/bootstrap.min.js"
integrity="sha512-UR25UO94eTnCVwjbXozyeVd6ZqpaAE9naiEUBK/A+QDbfSTQFhPGj5lOR6d8tsgbBk84Ggb5A3EkjsOgPRPcKA=="
crossorigin="anonymous"></script>
<script src='/js/tabpane-persist.js'></script>
<script src="/js/main.min.1a2e43037d7eeb7eb548659ffab8adc920ddeef68063a09913f04392dd3c1f19.js" integrity="sha256-Gi5DA31&#43;6361SGWf&#43;ritySDd7vaAY6CZE/BDkt08Hxk=" crossorigin="anonymous"></script>
<script src='/js/prism.js'></script>
</body>
</html>