Elasticsearch7.7 installation and deployment

Only one node has been built here for use in the test environment, and ES cluster expansion and optimization have not been considered for the time being.

ES 7.0 was released in April 2019, and the bottom layer is Lucene 8.0. Other important features are:
abolish the support of multiple types under a single index
ES Security Free use of
ECK-ES Operator on K8s
New function: New Cluster coordination
New function: Complete High Level REST Client
New function: Script Score Query
performance: Default Primary Shard number From 5 to 1, avoid Over Sharding; Top K with faster performance optimization


# 安装es7.7
cd /opt
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.7.0-linux-x86_64.tar.gz
tar zxf elasticsearch-7.7.0-linux-x86_64.tar.gz
 
# es启动需要es用户
useradd es
chown es:es -R elasticsearch-7.7.0
su - es
 
# es7内置jdk,修改启动脚本
cd /opt/elasticsearch-7.7.0
vim ./bin/elasticsearch
    # 配置自己的jdk11
    export JAVA_HOME=/opt/elasticsearch-7.7.0/jdk
    export PATH=$JAVA_HOME/bin:$PATH
    # 添加jdk判断
    if [ -x "$JAVA_HOME/bin" ]; then
        JAVA="/opt/elasticsearch-7.7.0/jdk/bin/java"
    else
        JAVA=`which java`
    fi
    :wq

# 禁用swap
sed -i '/swap/s/^/#/' /etc/fstab
swapoff -a

vim /etc/sysctl.conf
	# 优化文件描述符
	vm.max_map_count = 655300
	# 优化脏内存页,es写入削峰
	vm.dirty_ratio=10
	vm.dirty_background_ratio=5
	vm.dirty_writeback_centisecs=200
	# 优化系统回收inode cache权重
	vm.vfs_cache_pressure=200
	vm.dirty_expire_centisecs=6000
	:wq
sysctl -p

# 检查或修改文件句柄数
vim /etc/security/limits.conf
	*  soft  nofile  65536
	*  hard  nofile  65536
	:wq

vim ./config/jvm.options  #这里的4g不能超过最大内存的一半,需要给lucene留内存
    -Xms4g
    -Xmx4g
    :wq

# 启动
./bin/elasticsearch -d

# 查看日志
vim ./logs/elasticsearch.log

# 验证是否成功启动
curl localhost:9200
 
# es可视化插件,elasticsearch-head
# 用谷歌浏览器打开下面的地址,根据提示安装即可。
# https://chrome.google.com/webstore/detail/elasticsearch-head/ffmkiejjmecolpfloofpjologoblkegm/

Guess you like

Origin blog.csdn.net/zimou5581/article/details/106782184