电影推荐系统项目实战:环境配置与安装:-----Linux环境下 ElasticSearch(单节点)环境配置
1通过 WGET 下载压缩包:
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.6.2.tar.gz
![](https://img2022.cnblogs.com/blog/2986763/202211/2986763-20221111141607555-1127849412.png)
2.修改 Linux 配置参数:
在文件末尾添加:
sudo vim /etc/security/limits.conf
* soft nofile 65536
* hard nofile 131072
* soft nproc 2048
* hard nproc 4096
![](https://img2022.cnblogs.com/blog/2986763/202211/2986763-20221111141848559-1005784040.png)
修改* soft nproc 1024 为 * soft nproc 2048
sudo vim /etc/security/limits.d/90-nproc.conf
* soft nproc 2048 #将该条目修改成 2048
在文件末尾添加:
sudo vim /etc/sysctl.conf
vm.max_map_count=655360
![](https://img2022.cnblogs.com/blog/2986763/202211/2986763-20221111142902764-792741092.png)
配置载入:
sudo sysctl -p
![](https://img2022.cnblogs.com/blog/2986763/202211/2986763-20221111143142930-2133326908.png)
3.解压到指定文件夹
tar -xf elasticsearch-5.6.2.tar.gz -C ./cluster/
![](https://img2022.cnblogs.com/blog/2986763/202211/2986763-20221111145822450-2138302403.png)
4.进入安装目录:
cd elasticsearch-5.6.2/
![](https://img2022.cnblogs.com/blog/2986763/202211/2986763-20221111145827676-1752505342.png)
5.创建数据文件夹data,日志文件夹logs
mkdir elasticsearch-5.6.2/data/
mkdir elasticsearch-5.6.2/logs/
![](https://img2022.cnblogs.com/blog/2986763/202211/2986763-20221111150028998-822875590.png)
6. 修改 ElasticSearch 配置文件
vim ./config/elasticsearch.yml
cluster.name: es-cluster #设置集群的名称
![](https://img2022.cnblogs.com/blog/2986763/202211/2986763-20221111150249548-634213690.png)
node.name: es-node #修改当前节点的名称
![](https://img2022.cnblogs.com/blog/2986763/202211/2986763-20221111150309340-368043089.png)
path.data: /home/bigdata/cluster/elasticsearch-5.6.2/data #修改
数据路径
path.logs: /home/bigdata/cluster/elasticsearch-5.6.2/logs #修改
日志路径
![](https://img2022.cnblogs.com/blog/2986763/202211/2986763-20221111150524334-2102944377.png)
bootstrap.memory_lock: false #设置 ES 节点允许内存交换
![](https://img2022.cnblogs.com/blog/2986763/202211/2986763-20221111150617242-933703216.png)
bootstrap.system_call_filter: false #禁用系统调用过滤器
network.host: linux #设置当前主机名称
![](https://img2022.cnblogs.com/blog/2986763/202211/2986763-20221111150820509-520232934.png)
discovery.zen.ping.unicast.hosts: ["linux"] #设置集群的主机列表
7.启动 ElasticSearch 服务
./bin/elasticsearch -d
8.访问 ElasticSearch 服务
curl http://linux:9200/
hello my world
本文来自博客园,作者:slowlydance2me,转载请注明原文链接:https://www.cnblogs.com/slowlydance2me/p/16881097.html