随笔分类 - elasticsearch
摘要:1. 集群支持的选项curl -XGET 'http://10.240.0.8:9200/_cat'2. 查看节点信息curl -XGET 'http://10.240.0.8:9200/_cat/nodes?v'3. 查看master节点信息curl -XGET 'http://10.240.0.8:9200/_cat/master?v'4. 查看集群的健康状态curl -XGET 'ht...
阅读全文
摘要:注意权限,不建议使用root,同es集群的启动用户相同即可1. 下载 & 解压# 下载wget https://github.com/lmenezes/cerebro/releases/download/v0.8.3/cerebro-0.8.3.zip# 解压unzip cerebro-0.8.3.zip# 软链ln -s cerebro-0.8.3 cerebro2. 配置什么都不配置,直接启动...
阅读全文
摘要:1. 下载 & 解压# 下载wget https://artifacts.elastic.co/downloads/kibana/kibana-7.1.1-linux-x86_64.tar.gz# 解压tar xvf kibana-7.1.1-linux-x86_64.tar.gz# 软链ln -s kibana-7.1.1-linux-x86_64 kibana2. 配置 kibana.ymlv...
阅读全文
摘要:1. 下载 & 解压# 下载wget https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-7.1.1-linux-x86_64.tar.gz# 解压tar xvf filebeat-7.1.1-linux-x86_64.tar.gz# 软链ln -s filebeat-7.1.1-linux-x86_64 filebeat2...
阅读全文
摘要:1. 安装nodejshead插件需要nodejs环境,所以先安装node,可以直接只用yum安装,但版本较低,建议使用更高版本,方式如下:1.1 下载 & 解压# 下载,选择 Linux Binaries (x64)wget https://nodejs.org/dist/v10.16.0/node-v10.16.0-linux-x64.tar.xz# 解压,xz -d 如果报错,请切换到roo...
阅读全文
摘要:1. 集群简介三台机器,均用于保存数据且可被选为master节点服务版本服务版本elasticsearch7.1.1jdk1.81. 创建elsearch用户不建议直接使用root用户,所以此处新建 elsearch用户1.1 添加用户组及用户,配置密码# 添加用户组groupadd elsearch# 添加用户useradd -m -g elsearch elsearch# 配置密码passwd...
阅读全文
摘要:1. 建立连接from elasticsearch import Elasticsearches = Elasticsearch(["localhost:9200"])2. 查询所有数据# 方式1:es.search(index="index_name", doc_type="type_name") # 方式2:body = { "query":{ "match_all":{}...
阅读全文
摘要:使用python连接es并执行最基本的查询from elasticsearch import Elasticsearches = Elasticsearch(["localhost:9200"])para = {"_source":"message"}es.search(index=index_name, q='offset: xx', doc_type='doc' ,params=para, s...
阅读全文
摘要:import datetimeimport sysimport getoptimport hashlibfrom elasticsearch import Elasticsearch"""初始化elasticsearch连接"""def init_es(): return Elasticsearch(["localhost:9200"])"""查询数据, 支持分页"""def query_d...
阅读全文
摘要:这里使用filebeat直连elasticsearch的形式完成数据传输,由于没有logstash,所有对于原始数据的过滤略显尴尬(logstash的filter非常强大)。 但是由于业务需求,还是需要将message(原始数据)中的某些字段进行提取,具体方式如下:1. /path/目录下建立pipeline.json文件{ "description" : "test-pipeline", "...
阅读全文