栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 前沿技术 > 大数据 > 大数据系统

nsis error(ESD问题)

nsis error(ESD问题)

目录

1.修改某个索引的分片数

2.es 写入超时

3.重索引

4.es常用命令

5.华为云es开启安全模式,客户端使用方法

6.运维的一些命令

7.新加Es节点操作

8.由tranlog引起的文件句柄过多问题解决


1.修改某个索引的分片数

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

#"order": 1 ,这个值,在的会overwite小的值,eg: 默认的es_tempate一般我们都配置为0,这个什为1,那个这值里面的所以参数都会overwirte 值为0的参数

#number_of_shards 表示分片数

#number_of_routing_shards 可扩展的最大分片数,要number_of_shards 倍数,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 写入超时,多方面原因

#先查询集群状态

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"

  }

}

#索引与别名是多对多的关系

#一个索引可以有多个别名,一个别名也可以对应多个索引,

#设置别名

PUT /my_index_v1/_alias/my_index

#查看 别名为my_index所有 索引

GET _settings

{

"index.blocks.read_only_allow_delete":null

}

#减少不平衡现象,每个表分配的主分片个数

put */_settings

{

"index.routing.allocation.total_shards_per_node":2

}

#比较多台,重启一般要操作的步骤

#关闭自动分片

PUT _cluster/settings

{

  "persistent": {

    "cluster": {

      "routing": {

        "allocation.enable": "none"

      }

    }

  }

}

#kill es 进程

#启动 es集群

#启动自动分片

PUT _cluster/settings

{

  "persistent": {

    "cluster": {

      "routing": {

        "allocation.enable": "all"

      }

    }

  }

}

7.新加Es节点操作

#分成两种情况.

#一:新的节点上部署.

1.做互信,系统参数祝始化,建立es用户,在/data盘,创建文件目录,受权给es用户.(可参考安装文档)

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

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

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

3.分发软件,scp 到新的机器上

4.ssh 新的节点,修改配置文件

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 进程

#启动 es集群

#启动自动分片

PUT _cluster/settings

{

  "persistent": {

    "cluster": {

      "routing": {

        "allocation.enable": "all"

      }

    }

  }

}

#二:在老节点上,新增加实例.

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.分发软件,scp 到新的机器上

4.重启es集群

PUT _cluster/settings

{

  "persistent": {

    "cluster": {

      "routing": {

        "allocation.enable": "none"

      }

    }

  }

}

#kill 

es 进程

#启动 es集群

#启动自动分片

PUT _cluster/settings

{

  "persistent": {

    "cluster": {

      "routing": {

        "allocation.enable": "all"

      }

    }

  }

}

​​​​​​8.由tranlog引起的文件句柄过多问题解决

#查看机器文件占用的句柄

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

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

#如果有大于30W 应该处理一下.

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;

#分发到其它台机器 

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

#执行检查脚本 查看是哪个索引引起的

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

47845 d6AF_i8_SWa3cV5kBybpXg

87405 57icq0x4S7KFsxe4k7sWrg

#查看所有 index 和对于的id

#地址要修改成对应的地址: eg:大集群:x.x.x.x:24148

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

#这个ip就是对应的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

#设置有问题的index, 副本设置为0,

PUT 4gdx.post_20211211/_settings

{

"number_of_replicas": 0

}



#副本设置为1



PUT 4gdx.post_20211211/_settings

{

"number_of_replicas": 1

}

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/771399.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号