内存问题
1、清理cache
- 清理前内存使用情况
free -m
- 开始清理
echo 1 > /proc/sys/vm/drop_caches
清理后内存使用情况
free -m
2、修改ElasticSearch内存
修改~/.bashrc文件
[itsm@t0-tkpol-elasticsearch-01 ~]$ cat .bashrc
.bashrc
Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
User specific aliases and functions
JAVA_HOME=/opt/jdk1.8.0_60/jre
export JAVA_HOME
PATH=$PATH:/opt/jdk1.8.0_60/jre/bin:/opt/elasticsearch-2.3.3/bin
export PATH
export CLASSPATH=.:$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jar:$CLASSPATH
export ES_HEAP_SIZE=8g
具体添加内容
export ES_HEAP_SIZE=8g
刷新环境变量
source .bashrc
- 验证是否生效
[itsm@t0-tkpol-elasticsearch-01 ~]$ ps -aux|grep elasticsearch
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.8/FAQ
itsm 17550 9.1 13.2 16822508 2168616 pts/0 Sl 11:09 4:04 /opt/jdk1.8.0_60/jre/bin/java -Xms8g -Xmx8g -Djava.awt.headless=true -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError -XX:+DisableExplicitGC -Dfile.encoding=UTF-8 -Djna.nosys=true -Des.path.home=/opt/elasticsearch-2.3.3 -cp /opt/elasticsearch-2.3.3/lib/elasticsearch-2.3.3.jar:/opt/elasticsearch-2.3.3/lib/* org.elasticsearch.bootstrap.Elasticsearch start
itsm 19062 0.0 0.0 103304 876 pts/0 R+ 11:54 0:00 grep elasticsearch