|
| 1 | +<!doctype html> |
| 2 | +<!--[if lt IE 7]><html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]--> |
| 3 | +<!--[if (IE 7)&!(IEMobile)]><html class="no-js lt-ie9 lt-ie8" lang="en"><![endif]--> |
| 4 | +<!--[if (IE 8)&!(IEMobile)]><html class="no-js lt-ie9" lang="en"><![endif]--> |
| 5 | +<!--[if gt IE 8]><!--> <html class="no-js" lang="en"><!--<![endif]--> |
| 6 | +<head> |
| 7 | +<meta charset="utf-8"> |
| 8 | +<title>docker 中的 ubuntu 使用 Elasticsearch 遇到的错误集合 – 叶子</title> |
| 9 | +<meta name="description" content=""> |
| 10 | +<meta name="keywords" content="docker, ubuntu, Elasticsearch"> |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | +<!-- Open Graph --> |
| 15 | +<meta property="og:locale" content="en_US"> |
| 16 | +<meta property="og:type" content="article"> |
| 17 | +<meta property="og:title" content="docker 中的 ubuntu 使用 Elasticsearch 遇到的错误集合"> |
| 18 | +<meta property="og:description" content=""> |
| 19 | +<meta property="og:url" content="http://localhost:4000/articles/docker-ubuntu%E4%B8%AD%E4%BD%BF%E7%94%A8Elasticsearch%E9%81%87%E5%88%B0%E7%9A%84%E9%94%99%E8%AF%AF%E9%9B%86%E5%90%88/"> |
| 20 | +<meta property="og:site_name" content="叶子"> |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | +<link rel="canonical" href="http://localhost:4000/articles/docker-ubuntu%E4%B8%AD%E4%BD%BF%E7%94%A8Elasticsearch%E9%81%87%E5%88%B0%E7%9A%84%E9%94%99%E8%AF%AF%E9%9B%86%E5%90%88/"> |
| 27 | +<link href="http://localhost:4000/feed.xml" type="application/atom+xml" rel="alternate" title="叶子 Feed"> |
| 28 | + |
| 29 | + |
| 30 | +<!-- http://t.co/dKP3o1e --> |
| 31 | +<meta name="HandheldFriendly" content="True"> |
| 32 | +<meta name="MobileOptimized" content="320"> |
| 33 | +<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| 34 | + |
| 35 | +<!-- For all browsers --> |
| 36 | +<link rel="stylesheet" href="http://localhost:4000/assets/css/main.min.css"> |
| 37 | +<!-- Webfonts --> |
| 38 | +<!--<script src="//use.edgefonts.net/source-sans-pro:n2,i2,n3,i3,n4,i4,n6,i6,n7,i7,n9,i9;source-code-pro:n4,n7;volkhov.js"></script>--> |
| 39 | + |
| 40 | +<meta http-equiv="cleartype" content="on"> |
| 41 | + |
| 42 | +<!-- Load Modernizr --> |
| 43 | +<script src="http://localhost:4000/assets/js/vendor/modernizr-2.6.2.custom.min.js"></script> |
| 44 | + |
| 45 | +<!-- Icons --> |
| 46 | +<!-- 16x16 --> |
| 47 | +<link rel="shortcut icon" href="http://localhost:4000/favicon.ico"> |
| 48 | +<!-- 32x32 --> |
| 49 | +<link rel="shortcut icon" href="http://localhost:4000/favicon.png"> |
| 50 | +<!-- 57x57 (precomposed) for iPhone 3GS, pre-2011 iPod Touch and older Android devices --> |
| 51 | +<link rel="apple-touch-icon-precomposed" href="http://localhost:4000/images/apple-touch-icon-precomposed.png"> |
| 52 | +<!-- 72x72 (precomposed) for 1st generation iPad, iPad 2 and iPad mini --> |
| 53 | +<link rel="apple-touch-icon-precomposed" sizes="72x72" href="http://localhost:4000/images/apple-touch-icon-72x72-precomposed.png"> |
| 54 | +<!-- 114x114 (precomposed) for iPhone 4, 4S, 5 and post-2011 iPod Touch --> |
| 55 | +<link rel="apple-touch-icon-precomposed" sizes="114x114" href="http://localhost:4000/images/apple-touch-icon-114x114-precomposed.png"> |
| 56 | +<!-- 144x144 (precomposed) for iPad 3rd and 4th generation --> |
| 57 | +<link rel="apple-touch-icon-precomposed" sizes="144x144" href="http://localhost:4000/images/apple-touch-icon-144x144-precomposed.png"> |
| 58 | +<script> |
| 59 | +var _hmt = _hmt || []; |
| 60 | +(function() { |
| 61 | + var hm = document.createElement("script"); |
| 62 | + hm.src = "https://hm.baidu.com/hm.js?f3fbccf0789476b80fab0c58359399a5"; |
| 63 | + var s = document.getElementsByTagName("script")[0]; |
| 64 | + s.parentNode.insertBefore(hm, s); |
| 65 | +})(); |
| 66 | +</script> |
| 67 | + |
| 68 | +</head> |
| 69 | + |
| 70 | +<body id="post"> |
| 71 | + |
| 72 | +<div class="navigation-wrapper"> |
| 73 | + <nav role="navigation" id="site-nav" class="animated drop"> |
| 74 | + <ul> |
| 75 | + |
| 76 | + <li> |
| 77 | + |
| 78 | + <a href="/articles">Posts</a> |
| 79 | + |
| 80 | + </li> |
| 81 | + |
| 82 | + <li> |
| 83 | + |
| 84 | + <a href="/links">Links</a> |
| 85 | + |
| 86 | + </li> |
| 87 | + |
| 88 | + <li> |
| 89 | + |
| 90 | + <a href="http://localhost:4000/about">About</a> |
| 91 | + |
| 92 | + </li> |
| 93 | + |
| 94 | + <li><a href="http://localhost:4000/feed.xml" title="Atom/RSS feed"><i class="icon-rss"></i> Feed</a></li> |
| 95 | + <li class="dosearch"><i class="icon-search"></i> Search</li> |
| 96 | + </ul> |
| 97 | + </nav> |
| 98 | +</div><!-- /.navigation-wrapper --> |
| 99 | + |
| 100 | +<!--[if lt IE 9]><div class="upgrade"><strong><a href="http://whatbrowser.org/">Your browser is quite old!</strong> Why not upgrade to a different browser to better enjoy this site?</a></div><![endif]--> |
| 101 | + |
| 102 | +<div class="search-wrapper"> |
| 103 | + <div class="search-form"> |
| 104 | + <input type="text" class="search-field" placeholder="Search..."> |
| 105 | + <i class="icon-remove-sign icon-2x"></i> |
| 106 | + <ul class="search-results post-list"></ul><!-- /.search-results --> |
| 107 | + </div><!-- /.search-form --> |
| 108 | +</div><!-- ./search-wrapper --> |
| 109 | + |
| 110 | +<header class="masthead"> |
| 111 | + <div class="wrap"> |
| 112 | + |
| 113 | + <h1 class="site-title animated fadeIn"><a href="/">叶子</a></h1> |
| 114 | + <h2 class="site-description animated fadeIn" itemprop="description">import this</h2> |
| 115 | + </div> |
| 116 | +</header><!-- /.masthead --> |
| 117 | + |
| 118 | + |
| 119 | +<div id="main" role="main"> |
| 120 | + <article class="hentry"> |
| 121 | + |
| 122 | + <div class="entry-wrapper"> |
| 123 | + <header class="entry-header"> |
| 124 | + <span class="entry-tags">Tags:<a href="http://localhost:4000/tags/#docker" title="Pages tagged docker">docker</a> • <a href="http://localhost:4000/tags/#ubuntu" title="Pages tagged ubuntu">ubuntu</a> • <a href="http://localhost:4000/tags/#Elasticsearch" title="Pages tagged Elasticsearch">Elasticsearch</a></span> |
| 125 | + |
| 126 | + <h1 class="entry-title">docker 中的 ubuntu 使用 Elasticsearch 遇到的错误集合</h1> |
| 127 | + |
| 128 | + </header> |
| 129 | + <div class="entry-content"> |
| 130 | + <p>当修改 Elasticsearch 6.2.4 的配置文件 config/elasticsearch.yml 时,将 network.host 项设置为 0.0.0.0,遇到如下错误:</p> |
| 131 | + |
| 132 | +<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ERROR: [2] bootstrap checks failed |
| 133 | +[1] initial heap size [132120576] not equal to maximum heap size [2092957696]; this can cause resize pauses and prevents mlockall from locking the entire heap |
| 134 | +[2] max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144] |
| 135 | +</code></pre></div></div> |
| 136 | + |
| 137 | +<ol> |
| 138 | + <li> |
| 139 | + <p>错误1:initial heap size [132120576] not equal to maximum heap size [2092957696]; this can cause resize pauses and prevents mlockall from locking the entire heap</p> |
| 140 | + |
| 141 | + <p>修改 Elasticsearch 的配置文件 <code class="highlighter-rouge">config/jvm.options</code>,取消以下两行前的<code class="highlighter-rouge">#</code>号,保存后重启 Elasticsearch 即可。</p> |
| 142 | + |
| 143 | + <p># -Xms1g</p> |
| 144 | + |
| 145 | + <p># -Xmx1g</p> |
| 146 | + </li> |
| 147 | + <li> |
| 148 | + <p>错误2:max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]</p> |
| 149 | + |
| 150 | + <p>错误原因:系统的 vm.max_map_count 参数太小</p> |
| 151 | + |
| 152 | + <p>解决办法:</p> |
| 153 | + |
| 154 | + <p>修改宿主机(即 docker 所在的主机本身),然后重启 docker 容器即可。修改宿主机参数的命令如下:</p> |
| 155 | + |
| 156 | + <ol> |
| 157 | + <li> |
| 158 | + <p>方法1,命令修改</p> |
| 159 | + |
| 160 | + <p><code class="highlighter-rouge">sysctl -w vm.max_map_count=655360</code></p> |
| 161 | + </li> |
| 162 | + <li> |
| 163 | + <p>方法2,修改配置文件</p> |
| 164 | + |
| 165 | + <p>$ sudo vi /etc/sysctl.conf</p> |
| 166 | + |
| 167 | + <p>在文件的底部增加 <code class="highlighter-rouge">vm.max_map_count=262144</code>。</p> |
| 168 | + </li> |
| 169 | + </ol> |
| 170 | + </li> |
| 171 | +</ol> |
| 172 | + |
| 173 | + |
| 174 | + <div id="disqus_thread"></div><!-- /#disqus_thread --> |
| 175 | + <!-- / disqus 评论 --> |
| 176 | + <script type="text/javascript"> |
| 177 | + /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */ |
| 178 | + var disqus_shortname = 'leafcoder'; // required: replace example with your forum shortname |
| 179 | + |
| 180 | + /* * * DON'T EDIT BELOW THIS LINE * * */ |
| 181 | + (function() { |
| 182 | + var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; |
| 183 | + dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js'; |
| 184 | + (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); |
| 185 | + })(); |
| 186 | + </script> |
| 187 | + <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript> |
| 188 | + <a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a> |
| 189 | + <!-- disqus 评论 / --> |
| 190 | + |
| 191 | + </div><!-- /.entry-content --> |
| 192 | + </div><!-- /.entry-wrapper --> |
| 193 | + <nav class="pagination" role="navigation"> |
| 194 | + |
| 195 | + <a href="http://localhost:4000/articles/uWSGI-listen-queue-of-socket-full-%E9%98%9F%E5%88%97%E6%BA%A2%E5%87%BA%E7%9A%84%E9%97%AE%E9%A2%98/" class="btn" title="uWSGI listen queue of socket full 队列溢出的问题">Previous article</a> |
| 196 | + |
| 197 | + |
| 198 | + </nav><!-- /.pagination --> |
| 199 | + </article> |
| 200 | +</div><!-- /#main --> |
| 201 | + |
| 202 | + |
| 203 | +<div class="footer-wrapper"> |
| 204 | + <footer role="contentinfo"> |
| 205 | + <span>© 2018 Leo Zhang. Powered by <a href="http://jekyllrb.com">Jekyll</a> using the <a href="http://mademistakes.com/so-simple/">So Simple Theme</a>.</span> |
| 206 | +<div class="social-icons"> |
| 207 | + |
| 208 | + |
| 209 | + |
| 210 | + |
| 211 | + |
| 212 | + |
| 213 | + |
| 214 | + <a href="http://github.com/leafcoder" title="Leo Zhang on Github" target="_blank"><i class="icon-github icon-2x"></i></a> |
| 215 | + |
| 216 | +</div><!-- /.social-icons --> |
| 217 | +<!--Google Analytics--> |
| 218 | +<script> |
| 219 | + (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ |
| 220 | + (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), |
| 221 | + m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) |
| 222 | + })(window,document,'script','//static.qiniucdn.com/public/v28677/add-on/ga/analytics.js','ga'); |
| 223 | + |
| 224 | + ga('create', 'UA-54353519-1', 'auto'); |
| 225 | + ga('send', 'pageview'); |
| 226 | + |
| 227 | +</script> |
| 228 | +<script type="text/javascript">var cnzz_protocol = (("https:" == document.location.protocol) ? " https://" : " http://");document.write(unescape("%3Cspan id='cnzz_stat_icon_1271707807'%3E%3C/span%3E%3Cscript src='" + cnzz_protocol + "s13.cnzz.com/z_stat.php%3Fid%3D1271707807%26online%3D1%26show%3Dline' type='text/javascript'%3E%3C/script%3E"));</script> |
| 229 | + </footer> |
| 230 | +</div><!-- /.footer-wrapper --> |
| 231 | + |
| 232 | +<script src="//cdn.bootcss.com/jquery/1.9.1/jquery.min.js"></script> |
| 233 | +<script>window.jQuery || document.write('<script src="http://localhost:4000/assets/js/vendor/jquery-1.9.1.min.js"><\/script>')</script> |
| 234 | +<script src="http://localhost:4000/assets/js/scripts.min.js"></script> |
| 235 | + |
| 236 | +<!-- Jekyll Simple Search option --> |
| 237 | +<script> |
| 238 | + $(document).ready(function() { |
| 239 | + $('.search-field').simpleJekyllSearch({ |
| 240 | + jsonFile : 'http://localhost:4000/search.json', |
| 241 | + searchResults : '.search-results', |
| 242 | + template : '<li><article><a href="{url}">{title} <span class="entry-date"><time datetime="{date}">{shortdate}</time></span></a></article></li>', |
| 243 | + noResults: '<p>Nothing found.</p>' |
| 244 | + }); |
| 245 | + }); |
| 246 | + |
| 247 | + (function( $, window, undefined ) { |
| 248 | + |
| 249 | + var bs = { |
| 250 | + close: $(".icon-remove-sign"), |
| 251 | + searchform: $(".search-form"), |
| 252 | + canvas: $("body"), |
| 253 | + dothis: $('.dosearch') |
| 254 | + }; |
| 255 | + |
| 256 | + bs.dothis.on('click', function() { |
| 257 | + $('.search-wrapper').css({ display: "block" }); |
| 258 | + bs.searchform.toggleClass('active'); |
| 259 | + bs.searchform.find('input').focus(); |
| 260 | + bs.canvas.toggleClass('search-overlay'); |
| 261 | + }); |
| 262 | + |
| 263 | + bs.close.on('click', function() { |
| 264 | + $('.search-wrapper').removeAttr( 'style' ); |
| 265 | + bs.searchform.toggleClass('active'); |
| 266 | + bs.canvas.removeClass('search-overlay'); |
| 267 | + }); |
| 268 | + })( jQuery, window ); |
| 269 | +</script> |
| 270 | + |
| 271 | + |
| 272 | +<script type="text/javascript"> |
| 273 | + /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */ |
| 274 | + var disqus_shortname = '评论'; // required: replace example with your forum shortname |
| 275 | + |
| 276 | + /* * * DON'T EDIT BELOW THIS LINE * * */ |
| 277 | + (function() { |
| 278 | + var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; |
| 279 | + dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js'; |
| 280 | + (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); |
| 281 | + })(); |
| 282 | + |
| 283 | + /* * * DON'T EDIT BELOW THIS LINE * * */ |
| 284 | + (function () { |
| 285 | + var s = document.createElement('script'); s.async = true; |
| 286 | + s.type = 'text/javascript'; |
| 287 | + s.src = '//' + disqus_shortname + '.disqus.com/count.js'; |
| 288 | + (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s); |
| 289 | + }()); |
| 290 | +</script> |
| 291 | +<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript> |
| 292 | +<a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a> |
| 293 | + |
| 294 | + |
| 295 | +<script type="text/javascript"> |
| 296 | +/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */ |
| 297 | +var disqus_shortname = 'leafcoder'; // required: replace example with your forum shortname |
| 298 | + |
| 299 | +/* * * DON'T EDIT BELOW THIS LINE * * */ |
| 300 | +(function () { |
| 301 | + var s = document.createElement('script'); s.async = true; |
| 302 | + s.type = 'text/javascript'; |
| 303 | + s.src = '//' + disqus_shortname + '.disqus.com/count.js'; |
| 304 | + (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s); |
| 305 | +}()); |
| 306 | +</script> |
| 307 | +</body> |
| 308 | +</html> |
0 commit comments