怎样在公司的网站服务器上更新网站内容,东莞网站如何制作,怎么做宣传推广,设计本网站图片大全目录
写在前面
一、前期准备
1. 创建用户和用户组
2. 修改limits.conf文件
3. 关闭操作系统swap功能
4. 调整mmap上限
二、安装ES
1.下载ES
2.配置集群间安全访问证书密钥
3.配置elasticsearch.yml
4.修改jvm.options
5.启动ES服务
6.修改密码
7.启用外部ht…目录
写在前面
一、前期准备
1. 创建用户和用户组
2. 修改limits.conf文件
3. 关闭操作系统swap功能
4. 调整mmap上限
二、安装ES
1.下载ES
2.配置集群间安全访问证书密钥
3.配置elasticsearch.yml
4.修改jvm.options
5.启动ES服务
6.修改密码
7.启用外部https调用
8.三台都重启
9.查看集群节点状态 写在前面 这是一份详细的Ubuntu安装Elasticsearch 8.8.2部署教程适合刚接触的小伙伴也能帮上有经验的朋友。从环境准备开始到安装配置再到集群搭建手把手教你怎么操作。包括创建用户、设置权限、优化系统参数、生成证书、配置文件调整等步骤每一步都清清楚楚。按照这个流程走相信你很快就能跑起一个稳定的ES集群了祝你顺利
一、前期准备
1. 创建用户和用户组 ES不能使用root启动所以要新建用户命令如下 # 创建组
groupadd elastic# 创建用户
useradd -s /bin/bash -g elastic -m elastic# 修改elastic密码
passwd elastic
New password: [输入你的新密码] 以上步骤添加名为elastic用户, 并将其添加至elastic组内, 并修改密码。 假如elastic准备放在/data/elastic882/下需要给这个用户这个目录的所有权 chown elastic /data/elastic882/
chmod 777 /data/elastic882/ 2. 修改limits.conf文件 为elastic用户调整最大的文件和线程资源数上限 vi /etc/security/limits.conf# 添加如下配置elastic – nofile 65536elastic – nproc 4096 在ubuntu操作系统下需要确保/etc/pam.d/su文件中已经开启pam_limits功能使得上述limits.conf文件生效 grep pam_limits /etc/pam.d/su# 应如下信息如果没有就加上
session required pam_limits.so 3. 关闭操作系统swap功能 修改/etc/fstab注释掉所有与swap的功能 vi /etc/fstab# 比如下面这样
/dev/mapper/openeuler_zhrm--es01-root / xfs defaults 0 0
UUID2c60fc0b-ea0d-43cb-8f8b-bb607b3e49f0 /boot ext4 defaults 1 2
# /dev/mapper/openeuler_zhrm--es01-swap none swap defaults 0 0
UUID1d193d38-969c-4dac-b2ef-b4b26f6f778f /data xfs defaults 0 0 需要重启才能生效 关闭此功能前的效果 生效的后的效果 4. 调整mmap上限
修改/etc/sysctl.conf vi /etc/sysctl.conf 添加如下设置vm.max_map_count262144 重启系统让上面的设置生效。 二、安装ES 我们以三台服务器为例假设为node-1、node-2、node-3使用es8.8.2es安装在 /data/elastic882 目录。
1.下载ES cd /data/elastic882
curl -L -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.8.2-linux-x86_64.tar.gz
tar -zxvf elasticsearch-8.8.2-linux-x86_64.tar.gz 2.配置集群间安全访问证书密钥 在任意一台执行命令颁发证书 cd elasticsearch-8.8.2
# 签发ca证书
./bin/elasticsearch-certutil ca
【ENTER】 什么也不用输入直接回车
【ENTER】 什么也不用输入直接回车# 用ca证书签发节点证书
./bin/elasticsearch-certutil cert --ca elastic-stack-ca.p12
【ENTER】 什么也不用输入直接回车
【ENTER】 什么也不用输入直接回车
【ENTER】 什么也不用输入直接回车# 将证书放到certs目录手动创建
mkdir config/certs
mv elastic-certificates.p12 elastic-stack-ca.p12 config/certs 然后把elastic-certificates.p12 elastic-stack-ca.p12两个文件另外两个服务器的相同位置
/data/elastic882/elasticsearch-8.8.2/config/certs
3.配置elasticsearch.yml
vi /data/elastic882/elasticsearch-8.8.2/config/elasticsearch.yml 添加如下配置三台都这么做 #----------------------- BEGIN SECURITY AUTO CONFIGURATION -----------------------# Enable security features
xpack.security.enabled: truexpack.security.enrollment.enabled: true# Enable encryption for HTTP API client connections, such as Kibana, Logstash, and Agents
xpack.security.http.ssl:enabled: falsekeystore.path: certs/elastic-certificates.p12# Enable encryption and mutual authentication between cluster nodes
xpack.security.transport.ssl:enabled: trueverification_mode: certificatekeystore.path: certs/elastic-certificates.p12truststore.path: certs/elastic-certificates.p12
# Create a new cluster with the current node only
# Additional nodes can still join the cluster later
ingest.geoip.downloader.enabled: false
#--------------------- END SECURITY AUTO CONFIGURATION ------------------------- 继续修改elasticsearch.yml node-1配置注意下面的ip1、ip2、ip3要替换成自己实际的ip cluster.name: es8
http.cors.enabled: true
http.cors.allow-origin: *
action.destructive_requires_name: falsenode.name: node-1
node.roles: [master,data]path.data: /data/elastic882/data
path.logs: /data/elastic882/logsnetwork.host: 0.0.0.0
http.port: 9200
http.publish_host: ip1discovery.seed_hosts: [ip1:9300,ip2:9300,ip3:9300]cluster.initial_master_nodes: [node-1,node-2,node-3]node-2只有下面两个配置不同 node.name: node-2http.publish_host: ip2 node-3也是 node.name: node-3http.publish_host: ip3 4.修改jvm.options 最大最小堆内存需要根据实际机器情况配置, 上限(不包括)32G注意这两个参数前不要有空格 vi jvm.options# 下面两行的注释 打开配置合适的大小
-Xms4g
-Xmx4g 5.启动ES服务 # 三台都启动
./bin/elasticsearch -d -p pid 6.修改密码 在任意一台上执行修改密码的命令 ./bin/elasticsearch-reset-password -u elastic -iPlease confirm that you would like to continue [y/N]y
Enter password for [elastic]: [你的ES密码]
Re-enter password for [elastic]: [你的ES密码] 7.启用外部https调用 # 三台都改
vi /data/elastic882/elasticsearch-8.8.2/config/elasticsearch.yml# 将这个参数变为true
xpack.security.http.ssl:enabled: true 8.三台都重启 # 关闭
kill cat pid# 启动
./bin/elasticsearch -d -p pid 9.查看集群节点状态 # 集群各个节点状态可以看到三个节点的信息
curl -k -u elastic:[你的ES密码] https://127.0.0.1:9200/_cat/nodes?vip heap.percent ram.percent cpu load_1m load_5m load_15m node.role master name
[ip1] 8 22 4 0.81 0.37 0.21 dm * node-1
[ip1] 8 22 5 0.56 0.27 0.14 dm - node-3
[ip1] 7 26 5 0.53 0.23 0.12 dm - node-2# 查看集群的健康状态
curl -k -u elastic:[你的ES密码] https://127.0.00.1:9200/_cat/health?vepoch timestamp cluster status node.total node.data shards pri relo init unassign pending_tasks max_task_wait_time active_shards_percent
1734652132 23:48:52 es8 green 3 3 2 1 0 0 0 0 - 100.0%注意elasticsearch.yml配置文件要遵循yml格式要求每一行的开头空格很敏感不要写错。 ES8集群部署就介绍到这关注不迷路(#^.^#) 了解更多优质内容商务合作 搞钱入口》》》 还在为找工作烦恼吗用这个宝藏小程序拿Offer快人一步Offer入口》》》