找回密码
 立即注册
CeraNetworksBGVM服务器主机交流IP归属甄别会员请立即修改密码
查看: 5|回复: 0

elasticsearch集群搭建

[复制链接]

81

主题

8

回帖

665

积分

高级会员

积分
665
发表于 2023-11-3 22:02:28 | 显示全部楼层 |阅读模式
10.1.1.10 node.master: true node.data: true

10.1.1.11 node.master: false node.data: true

10.1.1.12 node.master: false node.data: true

安装elasticsearch
wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" https://download.oracle.com/otn-pub/java/jdk/8u202-b08/1961070e4c9b4e26a04e7f5a083f551e/jdk-8u202-linux-x64.rpm
rpm -ivh jdk-8u202-linux-x64.rpm #安装jdk
useradd es #新增es用户
下载elasticsearch https://www.elastic.co/cn/downloads/past-releases/elasticsearch-5-6-4 并解压,如:/usr/local/elasticsearch-5.6.4

修改配置文件
10.1.1.10 elasticsearch.yml

cluster.name: search_cluster
node.name: node-1-10
node.master: true
node.data: true
network.host: 0.0.0.0
discovery.zen.ping.unicast.hosts: ["10.1.1.10","10.1.1.11","10.1.1.12"]
http.port: 9200
http.cors.enabled: true
http.cors.allow-origin: "*"
10.1.1.11 elasticsearch.yml

cluster.name: search_cluster
node.name: node-1-11
node.master: false
node.data: true
network.host: 0.0.0.0
discovery.zen.ping.unicast.hosts: ["10.1.1.10","10.1.1.11","10.1.1.12"]
http.port: 9200
10.1.1.12 elasticsearch.yml

cluster.name: search_cluster
node.name: node-1-12
node.master: false
node.data: true
network.host: 0.0.0.0
discovery.zen.ping.unicast.hosts: ["10.1.1.10","10.1.1.11","10.1.1.12"]
http.port: 9200
启动关闭elasticsearch
3个节点依次启动

su - es
/usr/local/elasticsearch-5.6.4/bin/elasticsearch -d
关闭elasticsearch:

kill -SIGTERM PID
安装elasticsearch-head
安装nodejs,参考:https://linuxeye.com/435.html

安装elasticsearch-head,如下:

cd /usr/local
git clone https://github.com/mobz/elasticsearch-head.git
chown -R es.es elasticsearch-head
cd elasticsearch-head
su - es
npm install
vim _site/app.js

localhost:9200改成10.1.1.10:9200

vim Gruntfile.js

9100更改为9102

connect: {
        server: {
                options: {
                        port: 9102,
                        base: '.',
                        keepalive: true
                }
        }
}
启动elasticsearch-head
nohup npm start &
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|HS2V主机综合交流论坛

GMT+8, 2024-4-29 07:03 , Processed in 0.061495 second(s), 5 queries , Gzip On, Redis On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表