国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

ES常見問題

這篇具有很好參考價值的文章主要介紹了ES常見問題。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點擊"舉報違法"按鈕提交疑問。

目錄

1.修改某個索引的分片數(shù)

2.es 寫入超時

3.重索引

4.es常用命令

5.華為云es開啟安全模式,客戶端使用方法

6.運維的一些命令

7.新加Es節(jié)點操作

8.由tranlog引起的文件句柄過多問題解決


1.修改某個索引的分片數(shù)

#其中, index_patterns 表示要匹配的索引名

#"order": 1 ,這個值,在的會overwite小的值,eg: 默認(rèn)的es_tempate一般我們都配置為0,這個什為1,那個這值里面的所以參數(shù)都會overwirte 值為0的參數(shù)

#number_of_shards 表示分片數(shù)

#number_of_routing_shards 可擴(kuò)展的最大分片數(shù),要number_of_shards 倍數(shù),8倍比較合適

PUT _template/gakx_vehicle1_new

{

??"index_patterns": [

????"gakx.vehicle1_*"

??],

??"order": 1,

??"settings": {

????"index": {

??????"number_of_shards": 15,

??????"number_of_routing_shards": 120

????}

??}

}

2.es 寫入超時

es 寫入超時,多方面原因

#先查詢集群狀態(tài)

get _cluster/health

#再看五上bulk 或者 wirte 隊列情況

# es 6.1 6.3

GET _cat/thread_pool/bulk?v&h=ip,port,name,type,active,size,queue,queue_size,rejected,largest,completed

# es 6.7

GET _cat/thread_pool/write?v&h=ip,port,name,type,active,size,queue,queue_size,rejected,largest,completed

3.重索引

#_reindex 重索引

POST _reindex

{

??"source": {

????"index":?"fjst_gakx.bill1_20190808",

????"size": 5000

??},

??"dest": {

????"index":?"fjst_gakx.bill1_20190808new"

??}

}

#索引與別名是多對多的關(guān)系

#一個索引可以有多個別名,一個別名也可以對應(yīng)多個索引,

#設(shè)置別名

PUT /my_index_v1/_alias/my_index

#查看 別名為my_index所有 索引

GET /*/_alias/my_index

#查看這個索引有幾個別名

GET /my_index_v1/_alias/*

#設(shè)置副本數(shù)

PUT 4gyd.post_20191029/_settings

{

????"index": {

??????"number_of_replicas": 0

????}

}

4.es常用命令

#查看分詞情況

post idx_z06crjzjcs_j_qz_wg_my_1205/_analyze

{

"analyzer":"ik_max_word",

"text":"黃小明在臺灣abcdedf"

}

post _analyze

{

"analyzer":"ik_max_word",

"text":"黃小明在臺灣abcdedf"

}

#查看段的情況

get idx_z22czrk_gab_czrk_jbxx_new_zl_my_1218/_segments

#進(jìn)行段的合并

post idx_z22czrk_gab_czrk_jbxx_new_zl_my_1218/_forcemerge?only_expunge_deletes=false&max_num_segments=1&flush=true&pretty

5.華為云es開啟安全模式,客戶端使用方法

1.kibana使用方法.

kibana需要使用oss的版本,如: kibana-oss-xxx-linux-x86_64.tar.gz

#配置里面需要修改

elasticsearch.ssl.verificationMode: none

#bWVpeWE6QWRtaW5AMTIzNDU= 為? base64(用戶:密碼)

elasticsearch.customHeaders: {"custom-proxy-username":"bWVpeWE6QWRtaW5AMTIzNDU="}

2.程序直接訪問(有些功能沒有配置資源目錄,如姓名分析,可以使用這個方式).

1)把原來的http修改為https

2) request head 增加參數(shù)

#bWVpeWE6QWRtaW5AMTIzNDU= 為? base64(用戶:密碼)

"custom-proxy-username":"bWVpeWE6QWRtaW5AMTIzNDU="

6.運維的一些命令

#查看 硬盤分布情況

get _cat/allocation?v

#查看集群狀態(tài)

#curl -Xget "http://192.168.1.1:9200/_cluster/health?pretty"

get _cluster/health

{

??"cluster_name": "elasticsearch_cluster",

??"status": "yellow",

??"timed_out": false,

??"number_of_nodes": 311,

??"number_of_data_nodes": 231,

??"active_primary_shards": 20161,

??"active_shards": 38804,

??"relocating_shards": 0,

??"initializing_shards": 60,

??"unassigned_shards": 13,

??"delayed_unassigned_shards": 0,

??"number_of_pending_tasks": 6,

??"number_of_in_flight_fetch": 0,

??"task_max_waiting_in_queue_millis": 53955,

??"active_shards_percent_as_number": 99.81222830979758

}

#如果有沒分配的,要查看分配的分片

#查看分配情況 ,INITIALIZING 代表是在init初始化中,UNASSIGNED 代表還沒分配的

get _cat/shards?v

4gdx.post_20191126 0 ????r ?????UNASSIGNED ????

#如果還有沒有分配的,查看一下原因

#查看分配失敗的原因

get _cluster/allocation/explain

{

"index":"4gyd.post_20191126",

"shard":0,

"primary":false

}

#檢查是否gc達(dá)到100%

?/opt/shell/jstat.sh /usr/local/elk/es1

觀察O指標(biāo)

#查看原因,解決

#原因1. allocation_expalin temporarily thottled 超過最大限制

#解決方法:設(shè)置初始化參數(shù),加快初始化

put _cluster/settings

{

"transient":{

"cluster.routing.allocation.node_concurrent_recoveries":60

??}

}

#原因2.Too manny oppen file 文件句柄過多

#請查看 由tranlog引起的文件句柄過多問題解決

#原因3: ?"allocate_explanation": "cannot allocate because all found copies of the shard are either stale or corrupt",

#說明數(shù)據(jù)有問題,或者不同步,找到一下"in_sync": false,的節(jié)點.完成后再查看explain .如果還有問題把a(bǔ)llocate_stale_primary 設(shè)置成allocate_empty_primary .允許為空分片

POST _cluster/reroute

{

??"commands": [

????{"allocate_stale_primary": {

??????"index": "t_sys_log_sga_20200709",

??????"shard": 1,

??????"node": "LN82kzp",

??????"accept_data_loss":true

????}}

??]

}

#設(shè)置平衡參數(shù),加快平衡

put _cluster/settings

{

"transient":{

"cluster.routing.allocation.cluster_concurrent_rebalance":60,

"indices.recovery.max_bytes_per_sec":"1gb"

}

}

#查看集群的所有參數(shù)

GET _cluster/settings

{

??"persistent": {

????"indices": {

??????"breaker": {

????????"fielddata": {

??????????"limit": "20%"

????????},

????????"request": {

??????????"limit": "10%"

????????},

????????"total": {

??????????"limit": "70%"

????????}

??????}

????}

??},

??"transient": {

????"cluster": {

??????"routing": {

????????"rebalance": {

??????????"enable": "all"

????????},

????????"allocation": {

??????????"cluster_concurrent_rebalance": "2",

??????????"node_concurrent_recoveries": "60",

??????????"node_initial_primaries_recoveries": "4",

??????????"enable": "all"

????????}

??????}

????}

??}

}

#查看索引情況

get _cat/indices

#查看節(jié)點情況(掛了的就不在這里面)

GET _cat/nodes?v

#pending 任務(wù)

get _cat/pending_tasks?v

#重新分布分片?

post _cluster/reroute?retry_failed=true

#去掉只讀模型

put */_settings

{

"index.blocks.read_only_allow_delete":null

}

#減少不平衡現(xiàn)象,每個表分配的主分片個數(shù)

put */_settings

{

"index.routing.allocation.total_shards_per_node":2

}

#比較多臺,重啟一般要操作的步驟

#關(guān)閉自動分片

PUT _cluster/settings

{

??"persistent": {

????"cluster": {

??????"routing": {

????????"allocation.enable": "none"

??????}

????}

??}

}

#kill es 進(jìn)程

#啟動 es集群

#啟動自動分片

PUT _cluster/settings

{

??"persistent": {

????"cluster": {

??????"routing": {

????????"allocation.enable": "all"

??????}

????}

??}

}

7.新加Es節(jié)點操作

#分成兩種情況.

#一:新的節(jié)點上部署.

1.做互信,系統(tǒng)參數(shù)祝始化,建立es用戶,在/data盤,創(chuàng)建文件目錄,受權(quán)給es用戶.(可參考安裝文檔)

2.修改配置,增加新的ip地址,如:

vim /usr/local/elk/es1/config/elasticsearch.yml

discovery.zen.ping.unicast.hosts: ["xxxx","xxxx"]

3.分發(fā)軟件,scp 到新的機(jī)器上

4.ssh 新的節(jié)點,修改配置文件

vim /usr/local/elk/es1/config/elasticsearch.yml

network.host: xxx.xxx.xxx

5.重啟es集群

PUT _cluster/settings

{

??"persistent": {

????"cluster": {

??????"routing": {

????????"allocation.enable": "none"

??????}

????}

??}

}

#kill es 進(jìn)程

#啟動 es集群

#啟動自動分片

PUT _cluster/settings

{

??"persistent": {

????"cluster": {

??????"routing": {

????????"allocation.enable": "all"

??????}

????}

??}

}

#二:在老節(jié)點上,新增加實例.

1.copy 軟件,如

cp /usr/local/elk/es1 /usr/local/elk/es2

2.修改配置,增加新的ip地址,如:

#修改舊的地址配置,增加discovery.zen.ping.unicast.hosts 新的端口

vim /usr/local/elk/es1/config/elasticsearch.yml

??discovery.zen.ping.unicast.hosts:

["x.x.x.x:9300","x.x.x.x:9302",]

#修改新的地址配置,增加discovery.zen.ping.unicast.hosts 新的端口 和 http.port,transport.tcp.port 的端口

vim /usr/local/elk/es1/config/elasticsearch.yml

?http.port: 9202

?transport.tcp.port: 9302

?discovery.zen.ping.unicast.hosts:?

["x.x.x.x:9300","x.x.x.x:9302",]

3.分發(fā)軟件,scp 到新的機(jī)器上

4.重啟es集群

PUT _cluster/settings

{

??"persistent": {

????"cluster": {

??????"routing": {

????????"allocation.enable": "none"

??????}

????}

??}

}

#kill 

es 進(jìn)程

#啟動 es集群

#啟動自動分片

PUT _cluster/settings

{

??"persistent": {

????"cluster": {

??????"routing": {

????????"allocation.enable": "all"

??????}

????}

??}

}

??????8.由tranlog引起的文件句柄過多問題解決

#查看機(jī)器文件占用的句柄

/opt/FusionInsight_SetupTool/preinstall/tools/cluster/clustercmd.sh "cat /proc/sys/fs/file-nr"

?"cat /proc/sys/fs/file-nr"

#如果有大于30W 應(yīng)該處理一下.

vi?/opt/check_fd.sh

ps -ef|grep java|grep org.elasticsearch.bootstrap.Elasticsearch|grep -v grep |awk '{print $2}'|while read line;do cd /proc/$line/fd;ls -l > /opt/fd_$line.txt;done;wc -l /opt/fd_*|grep -v 總用量|awk '{if($1>5000) print $2}'|while read line;do cat? $line|grep translog|awk -F'/' '{print $9}'|sort|uniq -c|awk '{if($1>1000)print $0}';done;

#分發(fā)到其它臺機(jī)器?

/opt/FusionInsight_SetupTool/preinstall/tools/cluster/clusterscp.sh put /opt/check_fd.sh /opt/check_fd.sh

#執(zhí)行檢查腳本 查看是哪個索引引起的

?/opt/FusionInsight_SetupTool/preinstall/tools/cluster/clustercmd.sh "sh? /opt/check_fd.sh"?

47845 d6AF_i8_SWa3cV5kBybpXg

87405 57icq0x4S7KFsxe4k7sWrg

#查看所有 index 和對于的id

#地址要修改成對應(yīng)的地址: eg:大集群:x.x.x.x:24148

curl -Xget "http://163.1.6.3:24148/_cat/indices?v" > /opt/all_index.txt

#這個ip就是對應(yīng)的kibanna.yml里面的elasticsearch.url,位置在總控/usr/local/elk/kibana-6.1.3-8601/config

[root@hosts01 ~]# cat /opt/all_index.txt |grep h-sdnAM5Q32AoD1fTLIq0Q

green open 4gyd.log_20211215 h-sdnAM5Q32AoD1fTLIq0Q 5 1 37255447

#設(shè)置有問題的index, 副本設(shè)置為0,文章來源地址http://www.zghlxwxcb.cn/news/detail-402492.html

PUT 4gdx.post_20211211/_settings

{

"number_of_replicas": 0

}



#副本設(shè)置為1



PUT 4gdx.post_20211211/_settings

{

"number_of_replicas": 1

}

到了這里,關(guān)于ES常見問題的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實不符,請點擊違法舉報進(jìn)行投訴反饋,一經(jīng)查實,立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費用

相關(guān)文章

  • kibana中ES修改某個字段類型問題

    ?近日,發(fā)現(xiàn)同步數(shù)據(jù)到es的時候,有個新建的索引動態(tài)適配了mapping,而往往這種會有字段類型不是我們想要的,比如我這就有個tid字段,此字段要在聚合操作中使用,而此時的tid被識別成text類型了,而text不支持聚合,所以要更改字段類型為long或者keyword,注意es 不支持直接

    2024年02月08日
    瀏覽(28)
  • ES常見問題(1)-解決ElasticSearch每次只能返回10條數(shù)據(jù)

    ES常見問題(1)-解決ElasticSearch每次只能返回10條數(shù)據(jù)

    使用ElasticSearch查詢分頁數(shù)據(jù) 有時候,我們需要使用ElasticSearch來分詞查詢,并分頁返回指定的數(shù)據(jù)條數(shù),但是當(dāng)我們每次想得到分頁數(shù)據(jù)條數(shù)超過十條的時候,ElasticSearch總是只能返回十條 因為ElasticSearch為了查詢的速度,在默認(rèn)的情況下已經(jīng)設(shè)置了分頁數(shù)據(jù)只能返回10條,所

    2024年02月11日
    瀏覽(25)
  • 線掃相機(jī)DALSA--常見問題四:修改相機(jī)參數(shù),參數(shù)保存無效情況

    線掃相機(jī)DALSA--常見問題四:修改相機(jī)參數(shù),參數(shù)保存無效情況

    該問題是操作不當(dāng),未按照正常步驟保存參數(shù)所致,相機(jī)為RAM機(jī)制,參數(shù)需保存在采集卡的ROM內(nèi)。 保存參數(shù)步驟: ①首先將相機(jī)參數(shù)保存至User Set1; ②然后回到Board(采集卡)參數(shù)設(shè)置區(qū),鼠標(biāo)選中Basic Timing; ③最后鼠標(biāo)點擊相機(jī)專家菜單欄”Save”按鈕即可完成參數(shù)保存。

    2024年02月06日
    瀏覽(52)
  • SQL server中:常見問題匯總(如:修改表時不允許修改表結(jié)構(gòu)、將截斷字符串或二進(jìn)制數(shù)據(jù)等)

    SQL server中:常見問題匯總(如:修改表時不允許修改表結(jié)構(gòu)、將截斷字符串或二進(jìn)制數(shù)據(jù)等)

    步驟 選擇菜單欄中的“工具”-“選項”,在選項對話框左欄中找到“設(shè)計器”,在設(shè)計器右邊取消勾選“阻止保存要求重新創(chuàng)建表的更改”即可。 圖例 注意 設(shè)計表時,盡量一次性設(shè)計成功,避免使用alter修改表,修改起來有各種約束,不容易修改。 解決: 你設(shè)置的數(shù)據(jù)類型

    2024年02月03日
    瀏覽(23)
  • 【Visual Studio 2022創(chuàng)建ASP.NET Web應(yīng)用程序(.NET Framework)發(fā)布并部署到局域網(wǎng) 及“常見權(quán)限問題和不列出目錄問題解決”】

    【Visual Studio 2022創(chuàng)建ASP.NET Web應(yīng)用程序(.NET Framework)發(fā)布并部署到局域網(wǎng) 及“常見權(quán)限問題和不列出目錄問題解決”】

    然后給項目命名并選擇文件保存位置 用一個空項目進(jìn)行舉例 創(chuàng)建完成如下 點擊更多模板選擇Web窗體 創(chuàng)建成功如下 .aspx頁面編寫前端代碼,.aspx.cs頁面編寫后端代碼 通過插入表格和拉取控件快速完成 然后給Button按鈕設(shè)置一個點擊事件,雙擊按鈕后會跳到.aspx.cs頁面,完善下面

    2024年02月07日
    瀏覽(85)
  • ES命令行查詢es集群的狀態(tài)、分片、索引

    ES命令行查詢es集群的狀態(tài)、分片、索引

    查看es集群狀態(tài) 查看es分片信息 查看es索引 查看ES索引 本文參考:https://www.cnblogs.com/expiator/p/14847705.html

    2024年02月12日
    瀏覽(88)
  • ElasticSearch---查詢es集群狀態(tài)、分片、索引

    查看es集群狀態(tài): 如果?后面加上pretty,能讓返回的json格式化。 加上?v的返回結(jié)果,如下: 解釋如下: 查看es分片信息: 查看es分片信息,模糊匹配,比如匹配test: 返回信息如下: 解析如下: 查看狀態(tài)為unassigned的es分片信息: 查看es索引 查看es所有索引: indices表示索引,是

    2024年02月02日
    瀏覽(25)
  • ES中刪除索引中某個字段

    ES中無法直接增刪索引中的字段,只能能夠覆蓋,即重建新的索引 例:刪除索引my_index中的source字段 先將source字段中的數(shù)據(jù)刪除 否則后面reindex時,索引中會自動增加source字段和類型 創(chuàng)建新的索引my_index_bak,該mapping中不包含source字段 數(shù)據(jù)遷移 刪除原來的索引 再重新創(chuàng)建索引

    2024年02月11日
    瀏覽(23)
  • es索引分片重新分配cluster.routing.allocation

    Index-level shard allocation filtering | Elasticsearch Guide [master] | Elastic index.routing.allocation.include.{attribute} Assign the index to a node whose? {attribute} ?has at least one of the comma-separated values. index.routing.allocation.require.{attribute} Assign the index to a node whose? {attribute} ?has? all ?of the comma-separated values. i

    2024年02月09日
    瀏覽(21)
  • elasticSearch核心概念的介紹(十四):ES集群索引分片管理

    elasticSearch核心概念的介紹(十四):ES集群索引分片管理

    上一章節(jié)我們對ES的集群進(jìn)行了搭建,有興趣的朋友可以參考一下elasticSearch核心概念的介紹(十三):docker搭建ES集群 這里我們來介紹了ES集群索引的分片管理 ES集群索引分片管理 介紹 分片(shard):因為ES是個分布式的搜索引擎,所以索引通常都會分解成不同部分,而這些

    2023年04月27日
    瀏覽(24)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包