CANopen cordova magento ant ios4 Fries vue框架 android开发项目 rxjava线程切换 maven配置eclipse less的比较级 java 注解 python数据格式 python教学 python学习入门 python基本语法 python随机整数 python获取输入 php实例 计算机电子书 cf透视辅助 linux多线程编程 骰子动态图 findall java表白代码 pro换肤 战地2地图包下载 枪林弹雨辅助 cad多段线线宽设置 苹果手机怎么滚动截屏 sprutcam python进制转换 论文封面怎么做 ps渐变工具在哪里 画吧教程 cdr复制属性快捷键 traceback lol皮肤修改器 cf活动一键领取 css文件
当前位置: 首页 > 学习教程  > 编程语言

安装elaticsearch 以及elaticsearch-sql

2020/9/19 13:40:43 文章标签:

1.安装elaticsearch

下载elaticsearch,我这里用的5.1.2的版本:

https://www.elastic.co/cn/downloads/past-releases/elasticsearch-5-1-2

创建一个ela用户,配置好data目录和logs目录,一般解压至opt文件夹下直接解压即可,修改配置文件。

# ======================== 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-application
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
node.name: node-1
#
# 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: /data/es-data
#
# Path to log files:
#
path.logs: /var/log/elasticsearch
#
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
#
#bootstrap.memory_lock: true
#
# 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 -----------------------------------
#
# Set the bind address to a specific IP (IPv4 or IPv6):
#
#network.host: 192.168.0.1
network.host: 0.0.0.0
#
# Set a custom port for HTTP:
#
http.port: 9200
#
# For more information, consult the network module documentation.
#
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when new node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
#discovery.zen.ping.unicast.hosts: ["host1", "host2"]
#
# Prevent the "split brain" by configuring the majority of nodes (total number of master-eligible nodes / 2 + 1):
#
#discovery.zen.minimum_master_nodes: 3
#
# For more information, consult the zen discovery module documentation.
#
# ---------------------------------- Gateway -----------------------------------
#
# Block initial recovery after a full cluster restart until N nodes are started:
#
#gateway.recover_after_nodes: 3
#
# For more information, consult the gateway module documentation.
#
# ---------------------------------- Various -----------------------------------
#
# Require explicit names when deleting indices:
#
#action.destructive_requires_name: true
node.master:  true
node.data:  true
http.enabled:  true
http.cors.enabled: true
http.cors.allow-origin: "*"

添加/etc/security/limits.conf配置

* soft nofile 65536
* hard nofile 65536

添加vi /etc/sysctl.conf 配置

vm.max_map_count=262144

启动elasticsearch:/opt/elasticsearch-5.1.2/bin/elasticsearch -d

2.安装elaticsearch-sql

在https://github.com/NLPchina/elasticsearch-sql上查找

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.1.2.0/elasticsearch-sql-5.1.2.0.zip

   在es 5.X后,需要下载 es-sql的extract site ,并解压启动。

下载地址如下:https://github.com/NLPchina/elasticsearch-sql/releases/download/5.4.1.0/es-sql-site-standalone.zip,然后切换到解压文件目录中的site-server中。执行如下安装命令:

yum -y install nodejs npm
cd site-server
npm install express --save
启动服务
node node-server.js & 

然后输入https://ip:8080即可访问(改端口可以在site-server/site_configuration.json中修改)。

参考文档:

https://blog.csdn.net/zerokissingthefire/article/details/100104607

https://www.cnblogs.com/kangoroo/p/7273493.html

https://www.elastic.co/cn/what-is/elasticsearch-sql

https://blog.csdn.net/cb2474600377/article/details/78181974


本文链接: http://www.dtmao.cc/news_show_200052.shtml

附件下载

相关教程

    暂无相关的数据...

共有条评论 网友评论

验证码: 看不清楚?