elasticsearch安装部署

    科技2024-08-17  27

    配置

    主配置 config下的 elasticsearch.yml es主配置文件

    node.name: hadoop001 path.data: /home/hadoop/app/tmp/es/data path.logs: /home/hadoop/app/tmp/es/logs network.host: 0.0.0.0 http.port: 9200 cluster.initial_master_nodes: ["hadoop001"] http.cors.enabled: true http.cors.allow-origin: "*"

    jvm.options jvm配置

    -Xms512M -Xmx512M

    文件下 $ES_HOME/plugins 插件, 中文分词插件

    报错

    ERROR: [4] bootstrap checks failed [1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535] [2]: max number of threads [1024] for user [hadoop] is too low, increase to at least [4096] [3]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144] [4]: system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk

    解决

    vim /etc/security/limits.conf [1]: max file descriptors [65535] for elasticsearch process is too low, increase to at least [65536] 编辑 /etc/security/limits.conf,追加以下内容; * soft nofile 65536 * hard nofile 65536 此文件修改后需要重新登录用户,才会生效 [2]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144] 编辑 /etc/sysctl.conf,追加以下内容: vm.max_map_count=655360 保存后,执行: sysctl -p 重新启动,成功。 vim /etc/security/limits.d/90-nproc.conf 找到如下内容: soft nproc 1024 修改为 soft nproc 2048 设置elasticsearch.yml bootstrap.system_call_filter: false bin/elasticsearch

    安装插件

    安装npm

    1.root 登录linux 2.没有目录就自己创建一个 cd /usr/local/node/ 3.下载安装包 wget https://npm.taobao.org/mirrors/node/v6.1.0/node-v6.1.0-linux-x64.tar.gz 4.解压安装包 tar -zxvf node-v4.4.7-linux-x64.tar.gz 5.移除安装包 rm -rf node-v4.4.7-linux-x64.tar.gz 6.建立软连接 ln -s /usr/local/node/node-v4.4.7-linux-x64/bin/npm /usr/local/bin/npm ln -s /usr/local/node/node-v4.4.7-linux-x64/bin/node /usr/local/bin/node 7.查看npm版本 npm -v 8.npm升级,@后面是版本号 npm i -g npm@3.3.1

    下载grunt

    npm install grunt --registry=http://registry.cnpmjs.org/

    下载插件

    git clone https://github.com/mobz/elasticsearch-head.git cd elasticsearch-head npm install -g grunt --registry=https://registry.npm.taobao.org npm run start

    kibana

    vim kibana.yml

    server.port: 15601 server.host: "hadoop001" elasticsearch.hosts: ["http://hadoop001:9200"] i18n.locale: "en"
    Processed: 0.011, SQL: 8