teg 腾讯云CVM 自建ES 5.6.4

葫芦的运维日志

下一篇 搜索 上一篇

2019/11/16 20:58


新机器挂盘

机器配置: 三台

centos 7.6 50g 500g 4c 8g

mkdir /databak
mv /data/* /databak
mkfs.ext4 /dev/vdb
echo "/dev/vdb             /data               ext4       defaults              0 0" >> /etc/fstab
mount -a
rmdir /databak

jdk安装

cd /usr/local
wget soft_source_ip:9999/jdk-8u152-linux-x64.tar.gz
wget soft_source_ip:9999/java.sh
cd /usr/local && tar zxf jdk-8u152-linux-x64.tar.gz && ln -s jdk1.8.0_152  jdk && chown -R root.root /usr/local/jdk
mv java.sh /etc/profile.d/
source /etc/profile
ln -s /usr/local/jdk/bin/java  /usr/bin/java

es安装

cd  /opt/
wget soft_source_ip:9999/elasticsearch-5.6.4.rpm
yum -y localinstall package elasticsearch-5.6.4.rpm
mkdir -p /data/elasticsearch/{data,log}
chown -R elasticsearch:elasticsearch /data/elasticsearch/

相关配置

/etc/profile.d/java.sh

export JAVA_HOME=/usr/local/jdk
export JRE_HOME=${JAVA_HOME}/jre
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib:$CLASSPATH

/etc/elasticsearch/elasticsearch.yml

http.port: 9200
transport.tcp.port: 9300
cluster.name: node_cluster_name  
node.name: node_host_name
discovery.zen.ping.unicast.hosts: ["node_ip1:9300","node_ip2:9300","node_ip3:9300"]
network.host: 0.0.0.0
network.bind_host: 0.0.0.0
network.publish_host: node_ip1
discovery.zen.minimum_master_nodes: 1
path.data: /data/elasticsearch/data
http.cors.allow-origin: "*"
http.cors.enabled: true

/etc/elasticsearch/jvm.options

-Xms6g
-Xmx6g
-XX:+UseConcMarkSweepGC
-XX:CMSInitiatingOccupancyFraction=75
-XX:+UseCMSInitiatingOccupancyOnly
-XX:+AlwaysPreTouch
-server
-Xss1m
-Djava.awt.headless=true
-Dfile.encoding=UTF-8
-Djna.nosys=true
-Djdk.io.permissionsUseCanonicalPath=true
-Dio.netty.noUnsafe=true
-Dio.netty.noKeySetOptimization=true
-Dio.netty.recycler.maxCapacityPerThread=0
-Dlog4j.shutdownHookEnabled=false
-Dlog4j2.disable.jmx=true
-Dlog4j.skipJansi=true
-XX:+HeapDumpOnOutOfMemoryError
-Dcom.sun.management.jmxremote=true 
-Dcom.sun.management.jmxremote.authenticate=false 
-Dcom.sun.management.jmxremote.ssl=false 
-Dcom.sun.management.jmxremote.port=18080
thread_pool.bulk.queue_size: 5000

拉起

systemctl enable elasticsearch.service
systemctl start elasticsearch.service
systemctl status elasticsearch.service

● elasticsearch.service - Elasticsearch
   Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendor preset: disabled)
   Active: active (running) since Sat 2019-11-16 20:40:51 CST; 13min ago
     Docs: http://www.elastic.co
  Process: 21900 ExecStartPre=/usr/share/elasticsearch/bin/elasticsearch-systemd-pre-exec (code=exited, status=0/SUCCESS)
 Main PID: 21902 (java)
   CGroup: /system.slice/elasticsearch.service
           └─21902 /bin/java -Xms6g -Xmx6g -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+Always...

Nov 16 20:40:51 bthlt-es-03 systemd[1]: Starting Elasticsearch...
Nov 16 20:40:51 bthlt-es-03 systemd[1]: Started Elasticsearch.

葫芦的运维日志

打赏

上一篇 搜索 下一篇
© 冰糖葫芦甜(bthlt.com) 2019 王梓 打赏联系方式 陕ICP备17005322号