Installing elastic search in CentOS

  • Install Java environment (tar package mode)

    Download Java tar package:
    Unzip: tar-zxvf jdk-8u60-linux-x64.tar.gz
    Create a soft link: Ln-S / usr / Java / jdk1.8.0_ // usr / JDK // / usr / Java / jdk1.8.0_isthe path of tar package decompression file
    Edit the configuration file and configure the environment variables:
       vim /etc/profile
       Add at the end:
           export PATH JAVA_HOME CLASSPATH
     Execute command validation environment variable configuration: source / etc / profile  
     View version: Java version
  • Install elastic search (Reference:…)

    Tar - zxvf elasticsearch-7.1.1-linux-x86_. Tar. Gz // Note: ES can't run directly under root user. You need to create other users (chown - res: ES / usr / local / elasticsearch /)
    Sudo VI config / elasticsearch.yml // you need to modify the location where the comment is released
       Cluster. Name: my application // cluster name
       Node. Name: node-1 // node name
       Network. Host: // network
       Http.port: 9200 // port number
       Cluster. Initial master nodes: ["node-1"] // initial master node
    Modify configuration:
       1.vim  /etc/security/limits.conf
           *               soft    nofile          65536
           *               hard    nofile          65536
           *               soft    nproc           4096
           *               hard    nproc           4096
       View the configuration validation command (Note: you need to restart the server for validation)
           ulimit -Hu
           ulimit -Su
       2.vim /etc/sysctl.conf
         Sysctl - P // execute the command sysctl - P to take effect
       #Host port correlation (if the host only listens to the local:, the default port is 9200) false
       http.port: 9201
       RAM memory
       bootstrap.memory_lock: false
       bootstrap.system_call_filter: false
       #Allow cross domain
       http.cors.enabled: true
       http.cors.allow-origin: "*"
       #Clusters and nodes test-cluster master
       node.master: true