---
title: "elssticsearch 优化配置"
author: "ioio"
date: "2013-11-02T14:16:37Z"
tags: []
categories: ["行业应用"]
slug: "elssticsearch"
draft: false
lastmod: "2013-11-04T22:45:39Z"
id: 1969142
url: "https://ioio.iteye.com/blog/1969142"
---

一.增加用户可以打开的文件数

   bin/elasticsearch -f 前台启动es,查看启动参数，默认max-open-file 998 

   文件描述符配置设置为32k或者64k，具体配置为:

   **vim /etc/security/limits.conf**

   **用户名 soft nofile 65536**

   **用户名 hard nofile 65536**

 

二 内存设置，确保elasticsearch使用物理内存，不使用linux swap

    es配置文件中修改

    bootstrap.mlockall:true

  **vim /etc/security/limits.conf**

  **用户名** -memlock unlimited

  

 echo   "ulimit -n 65535" &gt;&gt; /etc/profile

 echo   "ulimit -n 65535" &gt;&gt; /etc/profile

  $ bin/elasticsearch -f -Des.max-open-files=true