123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537 |
- // 新增某字段mapping
- curl -XPUT http://127.0.0.1:19905/bidding_customer_v1/_mapping -u jybid:Top2023_JEB01i@31 -H 'Content-Type: application/json' -d '
- {
- "properties": {
- "businesstype": {
- "type": "keyword"
- }
- }
- }'
- // 索引添加别名
- curl -H 'Content-Type: application/json' -XPOST http://192.168.3.241:9205/_aliases -d '
- {
- "actions": [
- { "remove": {
- "alias": "bidding_customer",
- "index": "bidding_customer_v1"
- }},
- { "add": {
- "alias": "bidding_customer",
- "index": "bidding_customer_v2"
- }}
- ]
- }'
- // 添加并移除别名
- curl -H 'Content-Type: application/json' -u es_all:TopJkO2E_d1x -XPOST http://127.0.0.1:19805/_aliases -d '
- {
- "actions": [
- { "remove": {
- "alias": "winner",
- "index": "winner_v1"
- }},
- { "add": {
- "alias": "winner",
- "index": "winner_v2"
- }}
- ]
- }'
- //新增某字段mapping,es7 版本
- curl -XPUT "http://127.0.0.1:19805/bidding_v1/_mapping" -u es_all:TopJkO2E_d1x -H 'Content-Type: application/json' -d '
- {
- "properties": {
- "procurementlist": {
- "properties": {
- "remark": {
- "type": "keyword"
- }
- }
- }
- }
- }'
- curl -XPUT "http://127.0.0.1:19805/projectset/_mapping?pretty" -u es_all:TopJkO2E_d1x -H 'Content-Type: application/json' -d '
- {
- "properties": {
- "review_experts": {
- "type": "text",
- "fielddata": true
- },
- "s_winner": {
- "type": "text",
- "fielddata": true,
- "fields": {
- "mwinner": {
- "type": "text",
- "analyzer": "my_ngram"
- }
- },
- "analyzer": "douhao"
- }
- }
- }'
- // 清库
- curl -XPOST 'http://127.0.0.1:19905/ttbid_v9/_delete_by_query' -u jybid:Top2023_JEB01i@31 -H 'Content-Type:application/json' -d '{"query": { "match_all": {} }}'
- // 默认查询数量
- curl -XPUT "http://127.0.0.1:19805/bidding/_settings" -u es_all:TopJkO2E_d1x -H 'Content-Type: application/json' -d '
- {
- "index.max_result_window": "20000"
- }'
- //开启节点平衡
- curl -XPUT http://127.0.0.1:19908/_cluster/settings -u jybid:Top2023_JEB01i@31 -H 'content-Type:application/json' -d'{
- "transient" : {
- "cluster.routing.allocation.enable" : "none"
- }
- }'
- //关闭节点平衡
- curl -XPUT http://127.0.0.1:19905/_cluster/settings -u jybid:Top2023_JEB01i@31 -H 'content-Type:application/json' -d'{
- "transient" : {
- "cluster.routing.allocation.enable" : "none"
- }
- }'
- //开启节点平衡
- curl -XPUT http://192.168.3.241:9205/_cluster/settings -H 'content-Type:application/json' -d'{
- "transient" : {
- "cluster.routing.allocation.enable" : "all"
- }
- }'
- //关闭节点平衡
- curl -XPUT http://192.168.3.206:9800/_cluster/settings -d'{
- "transient" : {
- "cluster.routing.allocation.enable" : "none"
- }
- }'
- //开启节点平衡,es7 环境,需要传递header参数
- curl -H 'Content-Type: application/json' -XPUT http://192.168.3.149:9200/_cluster/settings -d'{
- "transient" : {
- "cluster.routing.allocation.enable" : "none"
- }
- }'
- //关闭节点平衡
- curl -H 'Content-Type: application/json' -XPUT http://192.168.3.149:9200/_cluster/settings -d'{
- "transient" : {
- "cluster.routing.allocation.enable" : "none"
- }
- }'
- //手动移动节点
- curl -H 'Content-Type: application/json' -XPOST 'http://192.168.3.241:9205/_cluster/reroute' -d '{
- "commands" : [ {
- "move" :
- {
- "index": "forecast_v1", "shard": 1,
- "from_node": "node_1", "to_node": "node_2"
- }
- }
- ]
- }'
- //查看节点个数
- curl http://localhost:9800/_settings?pretty
- //设置节点个数
- curl -XPUT 'http://127.0.0.1:9800/projectset_v1/_settings' -d '{
- "index.routing.allocation.total_shards_per_node":2
- }'
- // 分片异常 unsigned
- curl -XPOST '192.168.3.206:9800/_cluster/reroute' -d '{
- "commands": [{
- "allocate": {
- "index": "projectset_v1",
- "shard": 1,
- "node": "node-4",
- "allow_primary": 1
- }
- }]
- }'
- //新增某字段mapping
- curl -XPUT http://127.0.0.1:9800/bidding_v1/bidding/_mapping -d '
- {
- "properties": {
- "isValidFile": {
- "type": "boolean"
- }
- }
- }'
- curl -XPUT http://127.0.0.1:9800/bidding_v1/bidding/_mapping -d '
- {
- "properties": {
- "dataweight": {
- "type": "integer"
- }
- }
- }'
- // 恢复mapping文件
- curl -XPOST "http://192.168.3.128:9800/bidding/bidding/_mapping?pretty" -d '
- {
- "bidding": {
- "transform": {
- "lang": "groovy",
- "script": "ctx._source[\"id\"] = ctx._source[\"_id\"]"
- },
- "_id": {
- "path": "_id"
- },
- "_all": {
- "enabled": false
- },
- "properties": {
- "winneraddr": {
- "index": "not_analyzed",
- "type": "string"
- },
- "projectcode": {
- "index": "not_analyzed",
- "type": "string"
- },
- "channel": {
- "index": "not_analyzed",
- "type": "string"
- },
- "projectaddr": {
- "index": "not_analyzed",
- "type": "string"
- },
- "contractcode": {
- "index": "not_analyzed",
- "type": "string"
- },
- "entidlist": {
- "index": "not_analyzed",
- "type": "string"
- },
- "agencyaddr": {
- "index": "not_analyzed",
- "type": "string"
- },
- "tagname": {
- "analyzer": "douhao",
- "type": "string"
- },
- "toptype": {
- "index": "not_analyzed",
- "type": "string"
- },
- "project_duration": {
- "type": "long"
- },
- "bid_guarantee": {
- "type": "boolean"
- },
- "href": {
- "index": "not_analyzed",
- "type": "string"
- },
- "id": {
- "index": "not_analyzed",
- "type": "string"
- },
- "filetext": {
- "analyzer": "my_ngram",
- "type": "string"
- },
- "budget": {
- "type": "double"
- },
- "buyeraddr": {
- "index": "not_analyzed",
- "type": "string"
- },
- "area": {
- "index": "not_analyzed",
- "type": "string"
- },
- "bidamount": {
- "type": "double"
- },
- "projectname": {
- "index": "not_analyzed",
- "type": "string",
- "fields": {
- "pname": {
- "type": "string"
- }
- }
- },
- "buyertel": {
- "index": "not_analyzed",
- "type": "string"
- },
- "project_scale": {
- "analyzer": "my_ngram",
- "type": "string"
- },
- "signaturedate": {
- "type": "long"
- },
- "s_winner": {
- "analyzer": "douhao",
- "type": "string",
- "fields": {
- "mwinner": {
- "analyzer": "my_ngram_title",
- "type": "string"
- }
- }
- },
- "winnerorder": {
- "properties": {
- "sortstr": {
- "index": "not_analyzed",
- "type": "string"
- },
- "entname": {
- "index": "not_analyzed",
- "type": "string"
- },
- "sort": {
- "type": "integer"
- }
- }
- },
- "supervisorrate": {
- "type": "double"
- },
- "project_completedate": {
- "type": "long"
- },
- "buyer": {
- "index": "not_analyzed",
- "type": "string",
- "fields": {
- "mbuyer": {
- "analyzer": "my_ngram_title",
- "type": "string"
- }
- }
- },
- "winner": {
- "index": "not_analyzed",
- "type": "string"
- },
- "qualifies": {
- "analyzer": "my_ngram",
- "type": "string"
- },
- "district": {
- "index": "not_analyzed",
- "type": "string"
- },
- "publishtime": {
- "type": "long"
- },
- "buyerzipcode": {
- "index": "not_analyzed",
- "type": "string"
- },
- "detail": {
- "analyzer": "my_ngram",
- "type": "string"
- },
- "projectinfo": {
- "properties": {
- "approvecontent": {
- "analyzer": "my_ngram",
- "type": "string"
- },
- "approvenumber": {
- "index": "not_analyzed",
- "type": "string"
- },
- "approvecity": {
- "index": "not_analyzed",
- "type": "string"
- },
- "approvestatus": {
- "index": "not_analyzed",
- "type": "string"
- },
- "approvecode": {
- "index": "not_analyzed",
- "type": "string"
- },
- "projecttype": {
- "index": "not_analyzed",
- "type": "string"
- },
- "approvetime": {
- "index": "not_analyzed",
- "type": "string"
- },
- "approvedept": {
- "analyzer": "my_ngram",
- "type": "string"
- }
- }
- },
- "city": {
- "index": "not_analyzed",
- "type": "string"
- },
- "purchasing": {
- "analyzer": "my_ngram",
- "type": "string"
- },
- "projectscope": {
- "index": "not_analyzed",
- "type": "string",
- "fields": {
- "pscope": {
- "analyzer": "my_ngram",
- "type": "string"
- }
- }
- },
- "agencytel": {
- "index": "not_analyzed",
- "type": "string"
- },
- "project_startdate": {
- "type": "long"
- },
- "title": {
- "analyzer": "my_ngram_title",
- "type": "string"
- },
- "winnerperson": {
- "index": "not_analyzed",
- "type": "string"
- },
- "comeintime": {
- "type": "long"
- },
- "s_topscopeclass": {
- "analyzer": "douhao",
- "type": "string"
- },
- "projectperiod": {
- "index": "not_analyzed",
- "type": "string"
- },
- "project_timeunit": {
- "index": "not_analyzed",
- "type": "string"
- },
- "spidercode": {
- "index": "not_analyzed",
- "type": "string"
- },
- "subtype": {
- "index": "not_analyzed",
- "type": "string"
- },
- "infoformat": {
- "type": "integer"
- },
- "s_subscopeclass": {
- "analyzer": "douhao",
- "type": "string"
- },
- "agency": {
- "index": "not_analyzed",
- "type": "string",
- "fields": {
- "magency": {
- "analyzer": "my_ngram",
- "type": "string"
- }
- }
- },
- "agencyperson": {
- "index": "not_analyzed",
- "type": "string"
- },
- "bidstatus": {
- "index": "not_analyzed",
- "type": "string"
- },
- "payway": {
- "index": "not_analyzed",
- "type": "string"
- },
- "winnertel": {
- "index": "not_analyzed",
- "type": "string"
- },
- "buyerclass": {
- "index": "not_analyzed",
- "type": "string"
- },
- "contract_guarantee": {
- "type": "boolean"
- },
- "site": {
- "index": "not_analyzed",
- "type": "string"
- },
- "bidopentime": {
- "type": "long"
- },
- "topscopeclass": {
- "index": "not_analyzed",
- "type": "string"
- },
- "buyerperson": {
- "index": "not_analyzed",
- "type": "string"
- },
- "purchasinglist": {
- "properties": {
- "number": {
- "type": "double"
- },
- "itemname": {
- "index": "not_analyzed",
- "type": "string"
- },
- "totalprice": {
- "type": "double"
- },
- "unitname": {
- "index": "not_analyzed",
- "type": "string"
- },
- "model": {
- "analyzer": "my_ngram",
- "type": "string"
- },
- "brandname": {
- "analyzer": "my_ngram",
- "type": "string"
- },
- "unitprice": {
- "type": "double"
- }
- }
- }
- }
- }
- }'
- 命令:
- curl -XPUT 'http://127.0.0.1:9902/_cluster/settings' -u elastic:MsOCrY7Yct3sjVvB5gCd -H 'Content-Type: application/json' -d '{
- "persistent": {
- "ingest.geoip.downloader.enabled": false
- }
- }'
- https://discuss.elastic.co/t/unable-to-start-elasticsearch-after-upgrade-7-17-8-2-timeout-was-exceeded/310960/2
- 错误:
- [2023-05-17T16:41:14,077][ERROR][o.e.i.g.DatabaseNodeService] [es_1] failed to retrieve database [GeoLite2-Country.mmdb]
- org.elasticsearch.cluster.block.ClusterBlockException: blocked by: [SERVICE_UNAVAILABLE/1/state not recovered / initialized];
|