elasticsearch-7.13.0 安装部署

前提准备

序号软件
1jdk-8u192-linux-x64.rpm
2elasticsearch-7.13.0-linux-x86_64.tar.gz

安装说明

内容描述
服务器IP192.168.16.128
安装位置/usr/local/elasticsearch/
conf文件/usr/local/elasticsearch/config

安装步骤

安装JDK

$ rpm -ivh jdk-8u192-linux-x64.rpm

$ vim /etc/profile
export JAVA_HOME=/usr/java/jdk1.8.0_192-amd64
export JRE_HOME=$JAVA_HOME/jre
export PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin;
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib

$ source /etc/profile

解压

$ tar -zxvf elasticsearch-7.13.0-linux-x86_64.tar.gz

$ mv elasticsearch-7.13.0 /usr/local/elasticsearch

# 创建数据存储目录
$ mkdir /usr/local/elasticsearch/data

修改配置文件

$ cd config/

$ vim elasticsearch.yml
cluster.name: sj_test
node.name: function-test-13
path.data: /usr/local/elasticsearch/data
path.logs: /usr/local/elasticsearch/logs
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
network.host: 192.168.16.128
http.port: 9200
discovery.seed_hosts: ["192.168.16.128"]
cluster.initial_master_nodes: ["function-test-13"]
http.cors.enabled: true
http.cors.allow-origin: "*"
xpack.security.enabled: true
xpack.license.self_generated.type: basic
xpack.security.transport.ssl.enabled: true

设置用户名及密码

$ ./elasticsearch-setup-passwords interactive

密码:123456

Enter password for [elastic]:
Reenter password for [elastic]:
Enter password for [apm_system]:
Reenter password for [apm_system]:
Enter password for [kibana_system]:
Reenter password for [kibana_system]:
Enter password for [logstash_system]:
Reenter password for [logstash_system]:
Enter password for [beats_system]:
Reenter password for [beats_system]:
Enter password for [remote_monitoring_user]:
Reenter password for [remote_monitoring_user]:
Changed password for user [apm_system]
Changed password for user [kibana_system]
Changed password for user [kibana]
Changed password for user [logstash_system]
Changed password for user [beats_system]
Changed password for user [remote_monitoring_user]
Changed password for user [elastic]

创建运行用户

$ useradd es

$ chown -R es.es /usr/local/elasticsearch

修改限制

$ vim /etc/security/limits.conf

es  hard memlock unlimited 
es  soft memlock unlimited
es  hard nofile 65535
es  soft nofile 65535
es  hard nproc 65535
es  soft nproc 65535

修改内核参数

$ vim /etc/sysctl.conf
vm.max_map_count = 262144

$ sysctl -p

启动

su - es -c "/usr/local/elasticsearch/bin/elasticsearch -d"

测试

# 使用用户名/密码访问
curl http://elastic:123456@192.168.16.128:9200/_cluster/health?pretty
{
  "cluster_name" : "sj_test",
  "status" : "green",
  "timed_out" : false,
  "number_of_nodes" : 1,
  "number_of_data_nodes" : 1,
  "active_primary_shards" : 0,
  "active_shards" : 0,
  "relocating_shards" : 0,
  "initializing_shards" : 0,
  "unassigned_shards" : 0,
  "delayed_unassigned_shards" : 0,
  "number_of_pending_tasks" : 0,
  "number_of_in_flight_fetch" : 0,
  "task_max_waiting_in_queue_millis" : 0,
  "active_shards_percent_as_number" : 100.0
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值