Elastic

Elastic Stack安装 - Filebeat

戏子无情 提交于 2019-12-06 08:37:06
环境: OS: Centos 7.6 JDK: 1.8.0_91 下载地址: https://artifacts.elastic.co/downloads/beats/heartbeat/heartbeat-7.4.2-linux-x86_64.tar.gz https://artifacts.elastic.co/downloads/beats/packetbeat/packetbeat-7.4.2-linux-x86_64.tar.gz https://artifacts.elastic.co/downloads/beats/metricbeat/metricbeat-7.4.2-linux-x86_64.tar.gz https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-7.4.2-linux-x86_64.tar.gz https://artifacts.elastic.co/downloads/logstash/logstash-7.4.2.tar.gz https://artifacts.elastic.co/downloads/kibana/kibana-7.4.2-linux-x86_64.tar.gz https://artifacts.elastic.co/downloads

Elastic Search中mapping的问题

我与影子孤独终老i 提交于 2019-12-06 06:28:15
Mapping在ES中是非常重要的一个概念。决定了一个index中的field使用什么数据格式存储,使用什么分词器解析,是否有子字段,是否需要copy to其他字段等。 Mapping决定了index中的field的特征。 在ES中有一些自动的字段数据类型识别。 自动识别标准: 数字 -> long 长整数 文本 -> text 文本,字符串 特殊格式的字符串(如:2018-01-01) -> 对应的特殊类型(如:date) 字面值true|false -> boolean类型。 3.1 测试搜索 测试数据: PUT /test_index/test_type/1 { "post_date": "2018-01-01", "title": "my first title", "content": "this is my first content in this test", "author_id": 110 } PUT /test_index/test_type/2 { "post_date": "2018-01-02", "title": "my second title", "content": "this is my second content in this test", "author_id": 110 } PUT /test_index/test_type/3 {

Elastic Search中normalization和分词器

纵然是瞬间 提交于 2019-12-06 05:31:02
为key_words提供更加完整的倒排索引。 如:时态转化(like | liked),单复数转化(man | men),全写简写(china | cn),同义词(small | little)等。 如:china 搜索时,如果条件为cn是否可搜索到。 如:dogs,搜索时,条件为dog是否可搜索到数据。 如果可以使用简写(cn)或者单复数(dog&dogs)搜索到想要的结果,那么称为搜索引擎normalization人性化。 normalization是为了提升召回率的(recall),就是提升搜索能力的。 normalization是配合分词器(analyzer)完成其功能的。 分词器的功能就是处理Document中的field的。就是创建倒排索引过程中用于切分field数据的。 如:I think dogs is human’s best friend.在创建倒排索引的时候,使用分词器实现数据的切分。 上述的语句切分成若干的词条,分别是: think dog human best friend。 常见搜索条件有:think、 human、 best、 friend,很少使用is、a、the、i这些数据作为搜索条件。 1 ES默认提供的常见分词器 要切分的语句:Set the shape to semi-transparent by calling set_trans(5)

Elastic Stack安装 - Metricbeat

余生颓废 提交于 2019-12-06 04:54:59
环境: OS: Centos 7.6 JDK: 1.8.0_91 下载地址: https://artifacts.elastic.co/downloads/beats/heartbeat/heartbeat-7.4.2-linux-x86_64.tar.gz https://artifacts.elastic.co/downloads/beats/packetbeat/packetbeat-7.4.2-linux-x86_64.tar.gz https://artifacts.elastic.co/downloads/beats/metricbeat/metricbeat-7.4.2-linux-x86_64.tar.gz https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-7.4.2-linux-x86_64.tar.gz https://artifacts.elastic.co/downloads/logstash/logstash-7.4.2.tar.gz https://artifacts.elastic.co/downloads/kibana/kibana-7.4.2-linux-x86_64.tar.gz https://artifacts.elastic.co/downloads

跨平台开源通讯组件elastic communication

China☆狼群 提交于 2019-12-05 23:19:45
    elastic communication是基于c#开发支持.net和mono的通讯组件(简称EC),EC的主要目的简化mono和.net下的通讯开发难度,通过EC可以非常快速地开发基于mono和.net的通讯交互应用。EC抽取的基础的通讯协议默认支持protobuf,msgpack的数据对象进行通讯交互,开发者不可以根据自己的制要制订更多的序列化方式支持;EC不紧紧支持简单的对像传输,还提供了控制器,方法控制器和更方便的远程接口调用功能。     以下是ES希望实现的最终目标          借助于Xamarin实现不同移动端的实现,由于这一块个人工作原因还没细化实现,通过开源相关代码可以让感兴趣的人更好进一步去完成相关功能。 功能简介     EC实现通讯功能是非常方便的事情,下面通讯简单的几种场景来介绍一下EC在通讯上的应用。 HelloWord 服务端 namespace HelloWord.Server { [Controller] public class Program { static void Main( string [] args) { ECServer.Open(); System.Threading.Thread.Sleep( - 1 ); } public string HelloWord(ISession session,Hello e) {

Elasticsearch常用操作

社会主义新天地 提交于 2019-12-05 05:11:14
1、修改elastic超级用户密码 curl -u elastic -XPUT 'http://192.168.1.14:9200/_xpack/security/user/elastic/_password?pretty' -H 'Content-Type: application/json' -d '{ "password" : "xxx" }' 来源: https://www.cnblogs.com/xiaopaipai/p/11908692.html

centos7.5环境下elasticserch5.6.15集群升级6.8.4

蓝咒 提交于 2019-12-04 11:40:31
节点的角色分片: node01 eus_mp_web01 : master,false node,false, ingest,true node02 eus_mp_es01 : master,true node,true, ingest,true node03 eus_mp_spider01 : master,false node,true, ingest,true 背景: 生产环境大量使用 elasticsearch 集群,不同的业务使用不同版本的elasticsearch es经常曝出一些大的漏洞,需要进行版本升级,并且使用x-pack免费版的基本验证功能,避免用户数据泄露 x-pack免费版本特征: 基本的TLS 功能,可对通信进行加密 文件和原生 Realm,可用于创建和管理用户 基于角色的访问控制,可用于控制用户对集群 API 和索引的访问权限; 通过针对 Kibana Spaces 的安全功能,还可允许在 Kibana 中实现多租户。 升级的两种策略: 1.滚动性升级,即不中断业务服务,一台一台进行升级 2.全新部署新版本,然后将数据迁移到新版本的es集群中 此处从 es5.6.15升级到6.8.4,可以直接配置好新的集群后(新集群的data和logs直接引用老集群的配置),关闭老的集群,重新启动新集群等待恢复即可 这两种方式都需要将数据恢复到新版本的es集群中

自主开发lumen的composer包

怎甘沉沦 提交于 2019-12-04 08:37:46
以我开发的zero/lumen-elasticsearch包为例 ###注意本插件使用的是lumen框架 ####1.安装依赖 composer require zzq/lumen-elasticsearch ####2.创建elasticsearch.php配置文件,文件内容如下: <?php return [ /** * You can specify one of several different connections when building an * Elasticsearch client. * * Here you may specify which of the connections below you wish to use * as your default connection when building an client. Of course you may * use create several clients at once, each with different configurations. */ 'defaultConnection' => 'default', /** * These are the connection parameters used when building a client. */ 'connections'

Java代码解决ElasticSearch的Result window is too large

杀马特。学长 韩版系。学妹 提交于 2019-12-04 06:45:10
调用ElasticSearch做分页查询时报错: QueryPhaseExecutionException[Result window is too large, from + size must be less than or equal to: [10000] but was [666000]. See the scroll api for a more efficient way to request large data sets. This limit can be set by changing the [index.max_result_window] index level setting.]; } 提示用from+size方式有1万条数据查询的限制,需要更改index.max_result_window参数的值。 翻了下elasticsearch官网的文档: index.max_result_window The maximum value of from + size for searches to this index.Defaults to 10000. Search requests take heap memory and time proportional to from + size and this limits that memory. See

elastic search记录

跟風遠走 提交于 2019-12-04 04:12:21
elastic api GET _search { "query": { "match_all": {} } } GET /_cat/indices ## 查询所有索引中的字段映射 GET _mapping ## 查询index中的type GET logstash-2019.11.10-000001/_search ## 根据id查询单个详情, 上面结果中返回的type=_doc GET logstash-2019.11.10-000001/_doc/VL1cU24BpEn5ymJfSBRH?pretty ## 根据message字段全匹配查询, 提供type (已过期) GET logstash-2019.11.10-000001/_doc/_search?q=message:ffffff ## 根据message字段模糊查询, 提供type (已过期) GET logstash-2019.11.10-000001/_doc/_search?q=message:*f ## 根据message字段全匹配查询, 不提供type POST logstash-2019.11.10-000001/_search {"query":{"match":{"message":"ffffff"}}} ## 根据message字段模糊查询, 使用的是wildcard POST logstash