- 下载安装包
复制代码
1
2wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.14.0-linux-x86_64.tar.gz
- 解压&修改配置文件
复制代码
1
2
3tar -zxvf elasticsearch-7.14.0-linux-x86_64.tar.gz -C /home/soft cp config/elasticsearch.yml config/elasticsearch.yml.bak
- 修改系统配置
1、vim /etc/sysctl.conf
复制代码
1
2vm.max_map_count=655360
执行
复制代码
1
2sysctl -p
2、vim /etc/security/limits.conf
复制代码
1
2
3
4
5* soft nofile 65536 * hard nofile 65536 * soft nproc 4096 * hard nproc 4096
-
vim elasticsearch.yml 添加以下内容
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92# ======================== Elasticsearch Configuration ========================= # # NOTE: Elasticsearch comes with reasonable defaults for most settings. # Before you set out to tweak and tune the configuration, make sure you # understand what are you trying to accomplish and the consequences. # # The primary way of configuring a node is via this file. This template lists # the most important settings you may want to configure for a production cluster. # # Please consult the documentation for further information on configuration options: # https://www.elastic.co/guide/en/elasticsearch/reference/index.html # # ---------------------------------- Cluster ----------------------------------- # # Use a descriptive name for your cluster: # cluster.name: my-es-cluster # # ------------------------------------ Node ------------------------------------ # # Use a descriptive name for the node: # node.name: node-es # # 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/es/elasticsearch-7.14.0/data # # Path to log files: # path.logs: /home/es/elasticsearch-7.14.0/logs # # ----------------------------------- Memory ----------------------------------- # # Lock the memory on startup: # bootstrap.memory_lock: false # # Make sure that the heap size is set to about half the memory available # on the system and that the owner of the process is allowed to use this # limit. # # Elasticsearch performs poorly when the system is swapping the memory. # # ---------------------------------- Network ----------------------------------- # # By default Elasticsearch is only accessible on localhost. Set a different # address here to expose this node on the network: # network.host: 192.168.41.137 # # By default Elasticsearch listens for HTTP traffic on the first free port it # finds starting at 9200. Set a specific HTTP port here: # http.port: 9200 # # For more information, consult the network module documentation. # # --------------------------------- Discovery ---------------------------------- # # Pass an initial list of hosts to perform discovery when this node is started: # The default list of hosts is ["127.0.0.1", "[::1]"] # discovery.seed_hosts: ["192.168.41.137"] # # Bootstrap the cluster using an initial set of master-eligible nodes: # cluster.initial_master_nodes: ["192.168.41.137"] # # For more information, consult the discovery and cluster formation module documentation. # # ---------------------------------- Various ----------------------------------- # # Require explicit names when deleting indices: # #action.destructive_requires_name: true #是否启用节点上ES的XPACK安全功能,默认为true xpack.security.enabled: false #下面几项需要开始安全认证时打开,开启时访问页面需要输入用户名及密码,用户为:elastic #xpack.security.enabled: true #xpack.security.transport.ssl.enabled: true #xpack.security.transport.ssl.verification_mode: certificate #xpack.security.transport.ssl.keystore.path: elastic-certificates.p12 #xpack.security.transport.ssl.truststore.path: elastic-certificates.p12
- 开启 Elasticsearch 安全功能
复制代码
1
2./bin/elasticsearch-certutil cert -out config/elastic-certificates.p12 -pass "123456"
复制代码
1
2./bin/elasticsearch-setup-passwords interactive
- 启动es服务
复制代码
1
2./bin/elasticsearch -d
- 验证是否启动成功
复制代码
1
2ps -ef| grep elasticsearch
复制代码
1
2
3
4
5#开启认证时 curl --user elastic:123456 192.168.0.36:9200 #未开启时 curl 192.168.0.36:9200
提示如下信息es则启动成功!
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19{ "name" : "node-es", "cluster_name" : "my-es-cluster", "cluster_uuid" : "6ari_8AATSeZ0NB9XZyM-Q", "version" : { "number" : "7.14.0", "build_flavor" : "default", "build_type" : "tar", "build_hash" : "dd5a0a2acaa2045ff9624f3729fc8a6f40835aa1", "build_date" : "2021-07-29T20:49:32.864135063Z", "build_snapshot" : false, "lucene_version" : "8.9.0", "minimum_wire_compatibility_version" : "6.8.0", "minimum_index_compatibility_version" : "6.0.0-beta1" }, "tagline" : "You Know, for Search" }
最后
以上就是务实发箍最近收集整理的关于Elasticsearch 入门之单机版安装部署的全部内容,更多相关Elasticsearch内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复