chmod -v u+w /etc/sudoers
sed -i 's#.*top.*##g' /etc/sudoers
sed -i 's#root.*ALL=(ALL).*ALL#root ALL=(ALL) ALL \ntop ALL=(ALL) ALL#g' /etc/sudoers
chmod -v u-w /etc/sudoers
修改文件
vim /etc/security/limits.conf
增加的内容
* soft nofile 65536
* hard nofile 65536
最后几行加上 需要增加的部分
修改文件
vim /etc/sysctl.conf
增加的内容
vm.max_map_count=655360
最后几行加上 需要增加的部分(最后几行加上)
修改文件
[top@node85 .ssh]$ sudo sysctl -p
[sudo] top 的密码:
vm.max_map_count = 655360
结果如图

执行命令
sudo reboot
执行命令
mkdir /home/top/opensearch
cd /home/top/opensearch
wget http://10.168.2.60:35000/opensearch-1.1.0-linux-x64.tar.gz
执行命令
cd /home/top/opensearch
tar -xzvf opensearch-1.1.0-linux-x64.tar.gz
执行命令
mkdir /home/top/opensearch/data -p
mkdir /home/top/opensearch/logs -p
执行命令
rm -rf opensearch-1.1.0-linux-x64.tar.gz
ln -s opensearch-1.1.0/ opensearch
执行命令
rsync -avl /home/top/opensearch u86:/home/top
rsync -avl /home/top/opensearch u87:/home/top
或者
rsync -avl /home/top/opensearch top@10.168.2.86:/home/top/
rsync -avl /home/top/opensearch top@10.168.2.87:/home/top/
cat /home/top/opensearch/opensearch/config/opensearch.yml
# ---------------------------------- Cluster -----------------------------------
#
# Use a descriptive name for your cluster:
#
cluster.name: opensearch-cluster
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
node.name: opensearch-master
node.master: true #专用的主节点
node.data: false # 不是子节点
node.ingest: false # 不是摄取节点 (通道)
#
# Add custom attributes to the node:
#
#node.attr.rack: r1
#
# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comma):
#
path.data: /home/top/opensearch/data
#
# Path to log files:
#
path.logs: /home/top/opensearch/logs
#将集群绑定到特定的 IP 地址
network.host: node85
#为集群配置发现主机
discovery.seed_hosts: ["node86","node87","node88"]
cluster.initial_master_nodes: opensearch-master
#禁用安全
plugins.security.disabled: true
#discovery.type: cluster
#
# ---------------------------------- Cluster -----------------------------------
#
# Use a descriptive name for your cluster:
#
cluster.name: opensearch-cluster
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
node.name: opensearch-d1
node.master: true
node.data: true
node.ingest: true
#
# Add custom attributes to the node:
#
#node.attr.rack: r1
#
# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comma):
#
path.data: /home/top/opensearch/data
# Path to log files:
#
path.logs: /home/top/opensearch/logs
#将集群绑定到特定的 IP 地址
network.host: node86
#为集群配置发现主机
discovery.seed_hosts: ["node85","node87","node88"]
cluster.initial_master_nodes: opensearch-master
#禁用安全
plugins.security.disabled: true
#
# ---------------------------------- Cluster -----------------------------------
#
# Use a descriptive name for your cluster:
#
cluster.name: opensearch-cluster
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
node.name: opensearch-d2
node.master: true
node.data: true
node.ingest: true
#
# Add custom attributes to the node:
#
#node.attr.rack: r1
#
# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comma):
#
path.data: /home/top/opensearch/data
#
# Path to log files:
#
path.logs: /home/top/opensearch/logs
#将集群绑定到特定的 IP 地址
network.host: node87
#为集群配置发现主机
discovery.seed_hosts: ["node85", "node86","node88"]
cluster.initial_master_nodes: opensearch-master
#禁用安全
plugins.security.disabled: true
#
# ---------------------------------- Cluster -----------------------------------
#
# Use a descriptive name for your cluster:
#
cluster.name: opensearch-cluster
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
# 协调节点
node.name: opensearch-c1
node.master: false
node.data: false
node.ingest: false
# Path to directory where to store the data (separate multiple locations by comma):
#
path.data: /home/top/opensearch/data
#
# Path to log files:
#
path.logs: /home/top/opensearch/logs
#将集群绑定到特定的 IP 地址
network.host: node88
#为集群配置发现主机
discovery.seed_hosts: ["node85","node86","node87"]
cluster.initial_master_nodes: opensearch-master
#禁用安全
plugins.security.disabled: true
/home/top/opensearch/opensearch/bin/opensearch -d -p /home/top/opensearch/pid >/dev/null 2>&1 &
- [top@localhost ~]$ curl -X GET ‘http://10.168.2.85:9200/’
-Xms1g =>修改成想要的内存数
-Xmx1g =>修改成想要的内存数