mirror of https://github.com/tikv/client-java.git
379 lines
20 KiB
HTML
379 lines
20 KiB
HTML
<!DOCTYPE HTML>
|
|
<html lang="en" class="sidebar-visible no-js light">
|
|
<head>
|
|
<!-- Book generated using mdBook -->
|
|
<meta charset="UTF-8">
|
|
<title>Configuration - TiKV Java Client User Documents</title>
|
|
|
|
|
|
|
|
|
|
<!-- Custom HTML head -->
|
|
|
|
|
|
|
|
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
|
|
<meta name="description" content="">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<meta name="theme-color" content="#ffffff" />
|
|
|
|
|
|
<link rel="icon" href="../favicon.svg">
|
|
|
|
|
|
<link rel="shortcut icon" href="../favicon.png">
|
|
|
|
<link rel="stylesheet" href="../css/variables.css">
|
|
<link rel="stylesheet" href="../css/general.css">
|
|
<link rel="stylesheet" href="../css/chrome.css">
|
|
|
|
<link rel="stylesheet" href="../css/print.css" media="print">
|
|
|
|
|
|
<!-- Fonts -->
|
|
<link rel="stylesheet" href="../FontAwesome/css/font-awesome.css">
|
|
|
|
<link rel="stylesheet" href="../fonts/fonts.css">
|
|
|
|
|
|
<!-- Highlight.js Stylesheets -->
|
|
<link rel="stylesheet" href="../highlight.css">
|
|
<link rel="stylesheet" href="../tomorrow-night.css">
|
|
<link rel="stylesheet" href="../ayu-highlight.css">
|
|
|
|
<!-- Custom theme stylesheets -->
|
|
|
|
|
|
|
|
</head>
|
|
<body>
|
|
<!-- Provide site root to javascript -->
|
|
<script type="text/javascript">
|
|
var path_to_root = "../";
|
|
var default_theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "navy" : "light";
|
|
</script>
|
|
|
|
<!-- Work around some values being stored in localStorage wrapped in quotes -->
|
|
<script type="text/javascript">
|
|
try {
|
|
var theme = localStorage.getItem('mdbook-theme');
|
|
var sidebar = localStorage.getItem('mdbook-sidebar');
|
|
|
|
if (theme.startsWith('"') && theme.endsWith('"')) {
|
|
localStorage.setItem('mdbook-theme', theme.slice(1, theme.length - 1));
|
|
}
|
|
|
|
if (sidebar.startsWith('"') && sidebar.endsWith('"')) {
|
|
localStorage.setItem('mdbook-sidebar', sidebar.slice(1, sidebar.length - 1));
|
|
}
|
|
} catch (e) { }
|
|
</script>
|
|
|
|
<!-- Set the theme before any content is loaded, prevents flash -->
|
|
<script type="text/javascript">
|
|
var theme;
|
|
try { theme = localStorage.getItem('mdbook-theme'); } catch(e) { }
|
|
if (theme === null || theme === undefined) { theme = default_theme; }
|
|
var html = document.querySelector('html');
|
|
html.classList.remove('no-js')
|
|
html.classList.remove('light')
|
|
html.classList.add(theme);
|
|
html.classList.add('js');
|
|
</script>
|
|
|
|
<!-- Hide / unhide sidebar before it is displayed -->
|
|
<script type="text/javascript">
|
|
var html = document.querySelector('html');
|
|
var sidebar = 'hidden';
|
|
if (document.body.clientWidth >= 1080) {
|
|
try { sidebar = localStorage.getItem('mdbook-sidebar'); } catch(e) { }
|
|
sidebar = sidebar || 'visible';
|
|
}
|
|
html.classList.remove('sidebar-visible');
|
|
html.classList.add("sidebar-" + sidebar);
|
|
</script>
|
|
|
|
<nav id="sidebar" class="sidebar" aria-label="Table of contents">
|
|
<div class="sidebar-scrollbox">
|
|
<ol class="chapter"><li class="chapter-item expanded "><a href="../introduction/introduction.html"><strong aria-hidden="true">1.</strong> Introduction</a></li><li class="chapter-item expanded "><a href="../production-readiness.html"><strong aria-hidden="true">2.</strong> Production Readiness</a></li><li class="chapter-item expanded "><a href="../examples/introduction.html"><strong aria-hidden="true">3.</strong> Start With Examples</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../examples/quick-start.html"><strong aria-hidden="true">3.1.</strong> Quick Start</a></li><li class="chapter-item expanded "><a href="../examples/rawkv.html"><strong aria-hidden="true">3.2.</strong> Interact with TiKV RawKV API</a></li><li class="chapter-item expanded "><a href="../examples/txnkv.html"><strong aria-hidden="true">3.3.</strong> Interact with TiKV TxnKV API</a></li><li class="chapter-item expanded "><div><strong aria-hidden="true">3.4.</strong> TiKV RawKV Bulk Load</div></li></ol></li><li class="chapter-item expanded "><div><strong aria-hidden="true">4.</strong> Performance</div></li><li><ol class="section"><li class="chapter-item expanded "><div><strong aria-hidden="true">4.1.</strong> YCSB Benchmarks</div></li></ol></li><li class="chapter-item expanded "><a href="../administration/introduction.html"><strong aria-hidden="true">5.</strong> Administration</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../administration/configuration.html" class="active"><strong aria-hidden="true">5.1.</strong> Configuration</a></li><li class="chapter-item expanded "><a href="../administration/monitoring.html"><strong aria-hidden="true">5.2.</strong> Monitoring</a></li></ol></li><li class="chapter-item expanded "><a href="../troubleshooting/introduction.html"><strong aria-hidden="true">6.</strong> Troubleshooting</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../troubleshooting/slow-request.html"><strong aria-hidden="true">6.1.</strong> Slow Request Diagnosis</a></li><li class="chapter-item expanded "><div><strong aria-hidden="true">6.2.</strong> Error Request Diagnosis</div></li></ol></li><li class="chapter-item expanded "><a href="../architecture/introduction.html"><strong aria-hidden="true">7.</strong> Architecture and Internals</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../architecture/request-lifecycle.html"><strong aria-hidden="true">7.1.</strong> The Lifecycle of A Request</a></li><li class="chapter-item expanded "><a href="../architecture/availability.html"><strong aria-hidden="true">7.2.</strong> Backoff and Retry Policy</a></li><li class="chapter-item expanded "><div><strong aria-hidden="true">7.3.</strong> Slow Log and Metrics</div></li><li class="chapter-item expanded "><div><strong aria-hidden="true">7.4.</strong> Region Cache</div></li></ol></li><li class="chapter-item expanded "><a href="../contribution/introduction.html"><strong aria-hidden="true">8.</strong> Contribution Guide</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../contribution/bug-severity-guide.html"><strong aria-hidden="true">8.1.</strong> Bug Severity Guidelines</a></li></ol></li></ol>
|
|
</div>
|
|
<div id="sidebar-resize-handle" class="sidebar-resize-handle"></div>
|
|
</nav>
|
|
|
|
<div id="page-wrapper" class="page-wrapper">
|
|
|
|
<div class="page">
|
|
|
|
<div id="menu-bar-hover-placeholder"></div>
|
|
<div id="menu-bar" class="menu-bar sticky bordered">
|
|
<div class="left-buttons">
|
|
<button id="sidebar-toggle" class="icon-button" type="button" title="Toggle Table of Contents" aria-label="Toggle Table of Contents" aria-controls="sidebar">
|
|
<i class="fa fa-bars"></i>
|
|
</button>
|
|
<button id="theme-toggle" class="icon-button" type="button" title="Change theme" aria-label="Change theme" aria-haspopup="true" aria-expanded="false" aria-controls="theme-list">
|
|
<i class="fa fa-paint-brush"></i>
|
|
</button>
|
|
<ul id="theme-list" class="theme-popup" aria-label="Themes" role="menu">
|
|
<li role="none"><button role="menuitem" class="theme" id="light">Light (default)</button></li>
|
|
<li role="none"><button role="menuitem" class="theme" id="rust">Rust</button></li>
|
|
<li role="none"><button role="menuitem" class="theme" id="coal">Coal</button></li>
|
|
<li role="none"><button role="menuitem" class="theme" id="navy">Navy</button></li>
|
|
<li role="none"><button role="menuitem" class="theme" id="ayu">Ayu</button></li>
|
|
</ul>
|
|
|
|
<button id="search-toggle" class="icon-button" type="button" title="Search. (Shortkey: s)" aria-label="Toggle Searchbar" aria-expanded="false" aria-keyshortcuts="S" aria-controls="searchbar">
|
|
<i class="fa fa-search"></i>
|
|
</button>
|
|
|
|
</div>
|
|
|
|
<h1 class="menu-title">TiKV Java Client User Documents</h1>
|
|
|
|
<div class="right-buttons">
|
|
|
|
<a href="../print.html" title="Print this book" aria-label="Print this book">
|
|
<i id="print-button" class="fa fa-print"></i>
|
|
</a>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div id="search-wrapper" class="hidden">
|
|
<form id="searchbar-outer" class="searchbar-outer">
|
|
<input type="search" id="searchbar" name="searchbar" placeholder="Search this book ..." aria-controls="searchresults-outer" aria-describedby="searchresults-header">
|
|
</form>
|
|
<div id="searchresults-outer" class="searchresults-outer hidden">
|
|
<div id="searchresults-header" class="searchresults-header"></div>
|
|
<ul id="searchresults">
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<!-- Apply ARIA attributes after the sidebar and the sidebar toggle button are added to the DOM -->
|
|
<script type="text/javascript">
|
|
document.getElementById('sidebar-toggle').setAttribute('aria-expanded', sidebar === 'visible');
|
|
document.getElementById('sidebar').setAttribute('aria-hidden', sidebar !== 'visible');
|
|
Array.from(document.querySelectorAll('#sidebar a')).forEach(function(link) {
|
|
link.setAttribute('tabIndex', sidebar === 'visible' ? 0 : -1);
|
|
});
|
|
</script>
|
|
|
|
<div id="content" class="content">
|
|
<main>
|
|
<h2 id="java-client-configuration-parameter"><a class="header" href="#java-client-configuration-parameter">Java Client Configuration Parameter</a></h2>
|
|
<h3 id="jvm-parameter"><a class="header" href="#jvm-parameter">JVM Parameter</a></h3>
|
|
<p>The following includes JVM related parameters.</p>
|
|
<h4 id="tikvpdaddresses"><a class="header" href="#tikvpdaddresses">tikv.pd.addresses</a></h4>
|
|
<ul>
|
|
<li>pd addresses, separated by comma</li>
|
|
<li>default: 127.0.0.1:2379</li>
|
|
</ul>
|
|
<h4 id="tikvgrpctimeout_in_ms"><a class="header" href="#tikvgrpctimeout_in_ms">tikv.grpc.timeout_in_ms</a></h4>
|
|
<ul>
|
|
<li>timeout of grpc request</li>
|
|
<li>default: 600ms</li>
|
|
</ul>
|
|
<h4 id="tikvgrpcscan_timeout_in_ms"><a class="header" href="#tikvgrpcscan_timeout_in_ms">tikv.grpc.scan_timeout_in_ms</a></h4>
|
|
<ul>
|
|
<li>timeout of scan/delete range grpc request</li>
|
|
<li>default: 20s</li>
|
|
</ul>
|
|
<h4 id="tikvimportermax_kv_batch_bytes"><a class="header" href="#tikvimportermax_kv_batch_bytes">tikv.importer.max_kv_batch_bytes</a></h4>
|
|
<ul>
|
|
<li>Maximal package size transporting from clients to TiKV Server (ingest API)</li>
|
|
<li>default: 1048576 (1M)</li>
|
|
</ul>
|
|
<h4 id="tikvimportermax_kv_batch_size"><a class="header" href="#tikvimportermax_kv_batch_size">tikv.importer.max_kv_batch_size</a></h4>
|
|
<ul>
|
|
<li>Maximal batch size transporting from clients to TiKV Server (ingest API)</li>
|
|
<li>default: 32768 (32K)</li>
|
|
</ul>
|
|
<h4 id="tikvscatter_wait_seconds"><a class="header" href="#tikvscatter_wait_seconds">tikv.scatter_wait_seconds</a></h4>
|
|
<ul>
|
|
<li>time to wait for scattering regions</li>
|
|
<li>default: 300 (5min)</li>
|
|
</ul>
|
|
<h4 id="tikvrawkvdefault_backoff_in_ms"><a class="header" href="#tikvrawkvdefault_backoff_in_ms">tikv.rawkv.default_backoff_in_ms</a></h4>
|
|
<ul>
|
|
<li>RawKV default backoff in milliseconds</li>
|
|
<li>default: 20000 (20 seconds)</li>
|
|
</ul>
|
|
<h3 id="metrics-parameter"><a class="header" href="#metrics-parameter">Metrics Parameter</a></h3>
|
|
<h4 id="tikvmetricsenable"><a class="header" href="#tikvmetricsenable">tikv.metrics.enable</a></h4>
|
|
<ul>
|
|
<li>whether to enable metrics exporting</li>
|
|
<li>default: false</li>
|
|
</ul>
|
|
<h4 id="tikvmetricsport"><a class="header" href="#tikvmetricsport">tikv.metrics.port</a></h4>
|
|
<ul>
|
|
<li>the metrics exporting http port</li>
|
|
<li>default: 3140</li>
|
|
</ul>
|
|
<h3 id="threadpool-parameter"><a class="header" href="#threadpool-parameter">ThreadPool Parameter</a></h3>
|
|
<p>The following includes ThreadPool related parameters, which can be passed in through JVM parameters.</p>
|
|
<h4 id="tikvbatch_get_concurrency"><a class="header" href="#tikvbatch_get_concurrency">tikv.batch_get_concurrency</a></h4>
|
|
<ul>
|
|
<li>the thread pool size of batchGet on client side</li>
|
|
<li>default: 20</li>
|
|
</ul>
|
|
<h4 id="tikvbatch_put_concurrency"><a class="header" href="#tikvbatch_put_concurrency">tikv.batch_put_concurrency</a></h4>
|
|
<ul>
|
|
<li>the thread pool size of batchPut on client side</li>
|
|
<li>default: 20</li>
|
|
</ul>
|
|
<h4 id="tikvbatch_delete_concurrency"><a class="header" href="#tikvbatch_delete_concurrency">tikv.batch_delete_concurrency</a></h4>
|
|
<ul>
|
|
<li>the thread pool size of batchDelete on client side</li>
|
|
<li>default: 20</li>
|
|
</ul>
|
|
<h4 id="tikvbatch_scan_concurrency"><a class="header" href="#tikvbatch_scan_concurrency">tikv.batch_scan_concurrency</a></h4>
|
|
<ul>
|
|
<li>the thread pool size of batchScan on client side</li>
|
|
<li>default: 5</li>
|
|
</ul>
|
|
<h4 id="tikvdelete_range_concurrency"><a class="header" href="#tikvdelete_range_concurrency">tikv.delete_range_concurrency</a></h4>
|
|
<ul>
|
|
<li>the thread pool size of deleteRange on client side</li>
|
|
<li>default: 20</li>
|
|
</ul>
|
|
<h4 id="tikvenable_atomic_for_cas"><a class="header" href="#tikvenable_atomic_for_cas">tikv.enable_atomic_for_cas</a></h4>
|
|
<ul>
|
|
<li>whether to enable <code>Compare And Set</code>, set true if using <code>RawKVClient.compareAndSet</code> or <code>RawKVClient.putIfAbsent</code></li>
|
|
<li>default: false</li>
|
|
</ul>
|
|
<h3 id="tls"><a class="header" href="#tls">TLS</a></h3>
|
|
<h4 id="tikvtls_enable"><a class="header" href="#tikvtls_enable">tikv.tls_enable</a></h4>
|
|
<ul>
|
|
<li>whether to enable TLS</li>
|
|
<li>default: false</li>
|
|
</ul>
|
|
<h4 id="tikvtrust_cert_collection"><a class="header" href="#tikvtrust_cert_collection">tikv.trust_cert_collection</a></h4>
|
|
<ul>
|
|
<li>Trusted certificates for verifying the remote endpoint's certificate, e.g. /home/tidb/ca.pem. The file should contain an X.509 certificate collection in PEM format.</li>
|
|
<li>default: null</li>
|
|
</ul>
|
|
<h4 id="tikvkey_cert_chain"><a class="header" href="#tikvkey_cert_chain">tikv.key_cert_chain</a></h4>
|
|
<ul>
|
|
<li>an X.509 certificate chain file in PEM format, e.g. /home/tidb/client.pem.</li>
|
|
<li>default: null</li>
|
|
</ul>
|
|
<h4 id="tikvkey_file"><a class="header" href="#tikvkey_file">tikv.key_file</a></h4>
|
|
<ul>
|
|
<li>a PKCS#8 private key file in PEM format. e.g. /home/tidb/client-key.pem.</li>
|
|
<li>default: null</li>
|
|
</ul>
|
|
<h4 id="tikvtlsreload_interval"><a class="header" href="#tikvtlsreload_interval">tikv.tls.reload_interval</a></h4>
|
|
<ul>
|
|
<li>The interval in seconds to poll the change of TLS context, if a change is detected, the TLS context will be rebuilded.</li>
|
|
<li>default: <code>"10s"</code>, <code>"0s"</code> means disable TLS context reload.</li>
|
|
</ul>
|
|
<h4 id="tikvconnrecycle_time"><a class="header" href="#tikvconnrecycle_time">tikv.conn.recycle_time</a></h4>
|
|
<ul>
|
|
<li>After a TLS context reloading, the old connections will be forced to shutdown after <code>tikv.conn.recycle_time</code> to prevent channel leak.</li>
|
|
<li>default: <code>"60s"</code>.</li>
|
|
</ul>
|
|
<h4 id="tikvrawkvread_timeout_in_ms"><a class="header" href="#tikvrawkvread_timeout_in_ms">tikv.rawkv.read_timeout_in_ms</a></h4>
|
|
<ul>
|
|
<li>RawKV read timeout in milliseconds. This parameter controls the timeout of <code>get</code> <code>getKeyTTL</code>.</li>
|
|
<li>default: 2000 (2 seconds)</li>
|
|
</ul>
|
|
<h4 id="tikvrawkvwrite_timeout_in_ms"><a class="header" href="#tikvrawkvwrite_timeout_in_ms">tikv.rawkv.write_timeout_in_ms</a></h4>
|
|
<ul>
|
|
<li>RawKV write timeout in milliseconds. This parameter controls the timeout of <code>put</code> <code>putAtomic</code> <code>putIfAbsent</code> <code>delete</code> <code>deleteAtomic</code>.</li>
|
|
<li>default: 2000 (2 seconds)</li>
|
|
</ul>
|
|
<h4 id="tikvrawkvbatch_read_timeout_in_ms"><a class="header" href="#tikvrawkvbatch_read_timeout_in_ms">tikv.rawkv.batch_read_timeout_in_ms</a></h4>
|
|
<ul>
|
|
<li>RawKV batch read timeout in milliseconds. This parameter controls the timeout of <code>batchGet</code>.</li>
|
|
<li>default: 2000 (2 seconds)</li>
|
|
</ul>
|
|
<h4 id="tikvrawkvbatch_write_timeout_in_ms"><a class="header" href="#tikvrawkvbatch_write_timeout_in_ms">tikv.rawkv.batch_write_timeout_in_ms</a></h4>
|
|
<ul>
|
|
<li>RawKV batch write timeout in milliseconds. This parameter controls the timeout of <code>batchPut</code> <code>batchDelete</code> <code>batchDeleteAtomic</code>.</li>
|
|
<li>default: 2000 (2 seconds)</li>
|
|
</ul>
|
|
<h4 id="tikvrawkvscan_timeout_in_ms"><a class="header" href="#tikvrawkvscan_timeout_in_ms">tikv.rawkv.scan_timeout_in_ms</a></h4>
|
|
<ul>
|
|
<li>RawKV scan timeout in milliseconds. This parameter controls the timeout of <code>batchScan</code> <code>scan</code> <code>scanPrefix</code>.</li>
|
|
<li>default: 10000 (10 seconds)</li>
|
|
</ul>
|
|
<h4 id="tikvrawkvclean_timeout_in_ms"><a class="header" href="#tikvrawkvclean_timeout_in_ms">tikv.rawkv.clean_timeout_in_ms</a></h4>
|
|
<ul>
|
|
<li>RawKV clean timeout in milliseconds. This parameter controls the timeout of <code>deleteRange</code> <code>deletePrefix</code>.</li>
|
|
<li>default: 600000 (10 minutes)</li>
|
|
</ul>
|
|
|
|
</main>
|
|
|
|
<nav class="nav-wrapper" aria-label="Page navigation">
|
|
<!-- Mobile navigation buttons -->
|
|
|
|
<a rel="prev" href="../administration/introduction.html" class="mobile-nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
|
|
<i class="fa fa-angle-left"></i>
|
|
</a>
|
|
|
|
|
|
|
|
<a rel="next" href="../administration/monitoring.html" class="mobile-nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
|
|
<i class="fa fa-angle-right"></i>
|
|
</a>
|
|
|
|
|
|
<div style="clear: both"></div>
|
|
</nav>
|
|
</div>
|
|
</div>
|
|
|
|
<nav class="nav-wide-wrapper" aria-label="Page navigation">
|
|
|
|
<a rel="prev" href="../administration/introduction.html" class="nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
|
|
<i class="fa fa-angle-left"></i>
|
|
</a>
|
|
|
|
|
|
|
|
<a rel="next" href="../administration/monitoring.html" class="nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
|
|
<i class="fa fa-angle-right"></i>
|
|
</a>
|
|
|
|
</nav>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
window.playground_copyable = true;
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<script src="../elasticlunr.min.js" type="text/javascript" charset="utf-8"></script>
|
|
<script src="../mark.min.js" type="text/javascript" charset="utf-8"></script>
|
|
<script src="../searcher.js" type="text/javascript" charset="utf-8"></script>
|
|
|
|
|
|
<script src="../clipboard.min.js" type="text/javascript" charset="utf-8"></script>
|
|
<script src="../highlight.js" type="text/javascript" charset="utf-8"></script>
|
|
<script src="../book.js" type="text/javascript" charset="utf-8"></script>
|
|
|
|
<!-- Custom JS scripts -->
|
|
|
|
|
|
|
|
|
|
</body>
|
|
</html>
|