TH小破站

  • 首页
  • 容器
    • 认识Docker
    • DockerFile详解
  • k8s
    • 认识Kubernetes
    • Kubernetes部署--(kubeadm方式)
    • kubeasz部署k8s集群
    • Ansible-binary部署k8s集群-1.31.2
  • Ceph
    • 认识分布式存储
    • CPEH部署
  • CI/CD
    • DevOps认识
    • 部署--Gitlab
  • ELK
    • ELK简介
    • Elasticsearch
    • Kibana部署
    • Logstash
    • ELK--收集 tomcat 日志(实战)
  • HD
    • 认识--大数据
    • Hadoop-单机部署
    • Hadoop-伪分布部署
    • Hadoop-完全分布部署
    • Hadoop-(HA)完全分布部署
    • Ambari自动部署--Hadoop
  • Nginx
    • Nginx功能介绍
    • Nginx安全选项
    • Nginx配置文件简单介绍
    • 网站服务器部署
  • 监控
    • ZABBIX-部署(yum)
    • ZABBIX-编译安装
  • 云计算
    • KVM 概述
    • OpenStack企业级部署(T版)
    • OpenStack之dashboard部署
    • OpenStack-controller的高可用
    • openstack(Caracal版_ubuntu版本)部署
  • 数据库
    • mariadb与mysql
    • mysql主从
    • MySQL--冷备(实战)
    • MySQL--热备(dump表)
    • MySQL--热备(dump库)
    • 数据恢复实战案例
    • Xtrabackup实现MySql8.x全量备份
    • MyCat实现数据库读写分离
    • MHA实现数据库高可用
    • Percona XtraDB(PXC)实现数据库集群高可用
    • 数据库压力测试
    • PostgreSQL 基操
    • PostgreSQL备份恢复
    • PostgreSQL高可用
    • MongDB安装配置基础使用
    • MongoDB实现复制集
    • MongoDB备份还原
  • 自动化
    • ssh远程服务原理及配置
    • Ansible剧本文件应用
    • Ansible管理服务介绍
    • Ansible自动化部署node_exporter(包含升级,回滚)
    • Saltstack-部署安装
  • 脚本
    • 一键查看服务器资源利用率
    • 一键生成SSL证书
    • 保存指定数量的文件/目录
    • 初始化服务器
    • 扫描可用IP
    • 批量分发SSH密钥
    • 监控多主机磁盘脚本
    • 一键安装MySQL8.x脚本
    • Python脚本监控ES集群
    • 资源巡检脚本
    • 查看各用户使用的cpu占比
热衷于分享
架构师成长之路 !!!
  1. 首页
  2. 日志收集
  3. 正文

elasticsearch最新版本-8.13.1二进制包单机部署

2024年4月8日 1532点热度 0人点赞 0条评论

二进制包部署

官方文档

 https://www.elastic.co/guide/en/elasticsearch/reference/master/targz.html

下载二进制文件

 https://www.elastic.co/cn/downloads/elasticsearch

下载解压
 root@ubuntu-2204:~# hostnamectl set-hostname es-single && bash
 root@es-single:~# wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.13.1-linux-x86_64.tar.gz
 root@es-single:~# tar xf elasticsearch-8.13.1-linux-x86_64.tar.gz -C /usr/local/
修改配置
 root@es-single:~# ln -sv /usr/local/elasticsearch-8.13.1 /usr/local/elasticsearch
 root@es-single:~# grep -v '#' /usr/local/elasticsearch/config/elasticsearch.yml 
 path.data: /data/es-data
 path.logs: /data/es-logs
 network.host: 192.168.139.241
 http.port: 9200
 ​
 ​
 xpack.security.enabled: false
 ​
 xpack.security.enrollment.enabled: true
 ​
 xpack.security.http.ssl:
   enabled: true
   keystore.path: certs/http.p12
 ​
 xpack.security.transport.ssl:
   enabled: true
   verification_mode: certificate
   keystore.path: certs/transport.p12
   truststore.path: certs/transport.p12
 cluster.initial_master_nodes: ["es-single"]
 ​
修改内存配
root@es-single:~# echo 'vm.max_map_count=262144' >> /etc/sysctl.conf 
root@es-single:~# sysctl -p 
root@es-single:~# vim /usr/local/elasticsearch/config/jvm.options
 ...
 ## -Xms4g
 -Xms128m
 ## -Xmx4g
 -Xmx128m
 ...
创建用户

从es7.X以后版不允许以root启动服务,需要委创建专用的用户

 root@es-single:~# useradd -r elasticsearch
目录权限更改
 root@es-single:~# mkdir -p /data/es-{data,logs}
 root@es-single:~# chown -R elasticsearch.elasticsearch /data/
 root@es-single:~# chown -R elasticsearch.elasticsearch /usr/local/elasticsearch/
启动 Elasticsearch服务
 root@es-single:~# echo 'PATH=/usr/local/elasticsearch/bin:$PATH' > /etc/profile.d/elasticsearch.sh
 root@es-single:~# . /etc/profile.d/elasticsearch.sh
 #不能以root用户运行,切换用户
 root@es-single:~# su - elasticsearch
 $ elasticsearch
验证服务

 root@es-single:~# curl 192.168.139.241:9200
 {
   "name" : "es-single",
   "cluster_name" : "elasticsearch",
   "cluster_uuid" : "t_n9Lvl0SVuqyS4jtopGng",
   "version" : {
     "number" : "8.13.1",
     "build_flavor" : "default",
     "build_type" : "tar",
     "build_hash" : "9287f29bba5e270bd51d557b8daccb7d118ba247",
     "build_date" : "2024-03-29T10:05:29.787251984Z",
     "build_snapshot" : false,
     "lucene_version" : "9.10.0",
     "minimum_wire_compatibility_version" : "7.17.0",
     "minimum_index_compatibility_version" : "7.0.0"
   },
   "tagline" : "You Know, for Search"
 }
 ​
创建 service 文件
 root@es-single:~# vim /lib/systemd/system/elasticsearch.service
 [Unit]
 Description=Elasticsearch
 Documentation=http://www.elastic.co
 Wants=network-online.target
 After=network-online.target
 [Service]
 RuntimeDirectory=elasticsearch
 PrivateTmp=true
 Environment=PID_DIR=/var/run/elasticsearch
 WorkingDirectory=/usr/local/elasticsearch
 User=elasticsearch
 Group=elasticsearch
 ExecStart=/usr/local/elasticsearch/bin/elasticsearch -p ${PID_DIR}/elasticsearch.pid --quiet
 # Specifies the maximum file descriptor number that can be opened by thisprocess
 LimitNOFILE=65535
 # Specifies the maximum number of processes
 LimitNPROC=4096
 # Specifies the maximum size of virtual memory
 LimitAS=infinity
 # Specifies the maximum file size
 LimitFSIZE=infinity
 # Disable timeout logic and wait until process is stopped
 TimeoutStopSec=0
 # SIGTERM signal is used to stop the Java process
 KillSignal=SIGTERM
 # Send the signal only to the JVM rather than its control group
 KillMode=process
 # Java process is never killed
 SendSIGKILL=no
 # When a JVM receives a SIGTERM signal it exits with code 143
 SuccessExitStatus=143
 [Install]
 WantedBy=multi-user.target
 ​
 root@es-single:~# systemctl daemon-reload
 root@es-single:~# systemctl enable --now elasticsearch.service
 Created symlink /etc/systemd/system/multi-user.target.wants/elasticsearch.service → /lib/systemd/system/elasticsearch.service.
 root@es-single:~# systemctl status elasticsearch.service
 ​
 root@es-single:~# curl 192.168.139.241:9200
 {
   "name" : "es-single",
   "cluster_name" : "elasticsearch",
   "cluster_uuid" : "t_n9Lvl0SVuqyS4jtopGng",
   "version" : {
     "number" : "8.13.1",
     "build_flavor" : "default",
     "build_type" : "tar",
     "build_hash" : "9287f29bba5e270bd51d557b8daccb7d118ba247",
     "build_date" : "2024-03-29T10:05:29.787251984Z",
     "build_snapshot" : false,
     "lucene_version" : "9.10.0",
     "minimum_wire_compatibility_version" : "7.17.0",
     "minimum_index_compatibility_version" : "7.0.0"
   },
   "tagline" : "You Know, for Search"
 }
标签: 暂无
最后更新:2024年4月8日

tanghao946

这个人很懒,什么都没留下

点赞
< 上一篇

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复
文章目录
  • 二进制包部署

COPYRIGHT © 2025 TH小破站. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang

渝ICP备2023013789号

渝公网安备50011702500926号