zoukankan      html  css  js  c++  java
  • centors7 elasticsearch6.3安装以及问题记录

    1.安装elasticsearch 。

    安装系统:centors7 

    1.下载安装包 官网地址:https://www.elastic.co/downloads/past-releases

    2.mac文件下载后上传到centrs7.

      终端-shell- 新建远程连接。弹出下图

      

    选择自己的服务器。 

    之后 使用put命令 上传到自己的服务器

    3.解压文件到指定目录。

    tar -xvf elasticsearch-6.3.0.tar.gz

     4.配置 系统参数 。因为每个版本不同,es默认有些参数 和 系统默认参数不同。按照默认系统参数,无法正常启动es.

      1)vim ./config/jvm.options

      

      1. #修改内容
        -Xms200m 
        -Xmx200m
         
         
         
         
        2)修改/etc/security/limits.conf,修改到提示值即可
         
        1. * hard nofile 65536  

        3)修改/etc/security/limits.d/20-nproc.conf 文件  (limits.d目录下就一个文件夹 可能是20也可能是19或者90)

        1. 修改或添加  
        2. * hard nproc 4096  
        3. 切换用户,如果还是不行则修改:/etc/security/limits.d/20-nproc.conf,其他文章上写的都是修改90-nproc.conf  
        4. 不过我这个安装之后没有这个文件,只有一个20-nproc.conf,我的修改这个就行,刚开始学不知道什么原因  
        5. [root@centos7.4-64 ~]# vim /etc/security/limits.d/20-nproc.conf   
        6.   
        7. 将内容改为:  
        8. *          soft    nproc     4096  

        4)修改/etc/sysctl.conf

         
        1. [root@centos7.4-64 ~]# vim /etc/sysctl.conf   
        2. 添加配置:vm.max_map_count=262144,然后执行命令  
        3. [root@centos7.4-64 ~]# sysctl -p  

         修改后 如果 启动es报错。需要重新退出 xshell或者 重新进入下

        5.进入到es的bin目录。启动 ./elasticsearch & 如果此时是root身份会报错。原因是 root身份不能启动  创建新用户 fan

         1.adduser fan



        2.
        个人用户的权限只可以在本home下有完整权限,其他目录要看别人授权。而经常需要root用户的权限,这时候sudo可以化身为root来操作。我记得我曾经sudo创建了文件,然后发现自己并没有读写权限,因为查看权限是root创建的。

        新创建的用户并不能使用sudo命令,需要给他添加授权。

        sudo命令的授权管理是在sudoers文件里的。可以看看sudoers:

        [root@localhost ~]# sudoers
        bash: sudoers: 未找到命令...
        [root@localhost ~]# whereis sudoers
        sudoers: /etc/sudoers /etc/sudoers.d /usr/libexec/sudoers.so /usr/share/man/man5/sudoers.5.gz
        

        找到这个文件位置之后再查看权限:

        [root@localhost ~]# ls -l /etc/sudoers
        -r--r----- 1 root root 4251 9月  25 15:08 /etc/sudoers

        是的,只有只读的权限,如果想要修改的话,需要先添加w权限:

        [root@localhost ~]# chmod -v u+w /etc/sudoers
        mode of "/etc/sudoers" changed from 0440 (r--r-----) to 0640 (rw-r-----)
        

        然后就可以添加内容了,在下面的一行下追加新增的用户:

        [root@localhost ~]# vim /etc/sudoers
        
        
        ## Allow root to run any commands anywher  
        root    ALL=(ALL)       ALL  
        zhangbiao  ALL=(ALL)       ALL  #这个是新增的用户

        wq保存退出,这时候要记得将写权限收回:

        [root@localhost ~]# chmod -v u-w /etc/sudoers
        mode of "/etc/sudoers" changed from 0640 (rw-r-----) to 0440 (r--r-----)

        这时候使用新用户登录,使用sudo:

        [zhangbiao@localhost ~]$ sudo cat /etc/passwd
        [sudo] password for zhangbiao: 
        
        We trust you have received the usual lecture from the local System
        Administrator. It usually boils down to these three things:
        
            #1) Respect the privacy of others.
            #2) Think before you type.
            #3) With great power comes great responsibility.

        第一次使用会提示你,你已经化身超人,身负责任。而且需要输入密码才可以下一步。如果不想需要输入密码怎么办,将最后一个ALL修改成NOPASSWD: ALL

        6.切换到新创建的用户  su fan

        进入到bin 目录 启动es  ./elasticsearch &

        7.安装kibana

        https://blog.csdn.net/feifantiyan/article/details/53098896

        kibana和 es对应关系。不同版本的es kibana的版本不同

        下载地址

        https://www.elastic.co/downloads/past-releases

        下载后安装 。比如我的版本是 6.3的,kibana的版本也是 6.3

        tar -xvf kibana-6.3.0-linux-x86_64.tar.gz

        下载后 打开 

        http://ip:5601/ 默认情况下 可以看到 

    1.  如果一切正常 ,就可以使用了。

       

  • 相关阅读:
    SPOJ 8093 JZPGYZ
    UVA1030 Image Is Everything
    UVA11996 Jewel Magic
    UVA11922 Permutation Transformer
    UVA1479 Graph and Queries
    P3224 [HNOI2012]永无乡
    UVA11020 Efficient Solutions
    UVA12206 Stammering Aliens
    UVA11107 Life Forms
    UVA11019 Matrix Matcher
  • 原文地址:https://www.cnblogs.com/thinkingandworkinghard/p/9910469.html
Copyright © 2011-2022 走看看