<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                # Elasticsearch6.5.4集群 ## 環境要求 | 軟件 | 版本 | 備注 | | --- | --- |--- | | centos| 7.5 | | | JDK | 1.8 | | 最近學習Elasticsearch,順便記錄下操作步驟,供日后參考 安裝環境 CentOS release 7.5 1、因Elasticsearch是基于java寫的,所以它的運行環境中需要java的支持,在Linux下執行命令:java -version,檢查Jar包是否安裝 安裝java版本至少是1.8以上 ``` mkdir /app cd /app ``` 2、首先準備下載Elasticsearch6.5.4 安裝包 ~~~ wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.5.4.tar.gz ~~~ 3、下載到/usr/local 目錄下,解壓 ``` tar -zxvf elasticsearch-6.5.4.tar.gz ``` 4、創建用戶 useradd es 5、配置內存 cd elasticsearch-6.5.4 修改config/jvm.options為內存的一半大小 vi config/jvm.options -Xms512m -Xmx512m 6、配置資源限額 修改 max file 和 max virtual memory 參數 用root 或 sudo 用戶 vi /etc/sysctl.conf 添加下面配置: vm.max_map_count=655360 并執行命令: sysctl -p 7、 修改/etc/security/limits.conf ``` grep -q "* - nofile" /etc/security/limits.conf || cat >> /etc/security/limits.conf << EOF ######################################## * soft nofile 65536 * hard nofile 65536 * soft nproc 4096 * hard nproc 4096 EOF ``` ## 修改elasticsearch.yml ``` vi /app/elasticsearch-6.5.4/config/elasticsearch.yml cluster.name: elasticsearch node.name: node-1 network.host: 0.0.0.0 http.port: 9200 node.max_local_storage_nodes: 2 http.cors.enabled: true http.cors.allow-origin: "*" ``` ## 賦權啟動 ``` chown -R es:es /app/elasticsearch-6.5.4/ su - es -c '/app/elasticsearch-6.5.4/bin/elasticsearch -d' ``` 注:安裝后出現如下問題,致使elasticsearch無法啟動 ``` [root@zookeeper01 bin]# su - es -c '/app/elasticsearch-6.5.4/bin/elasticsearch -d OpenJDK 64-Bit Server VM warning: If the number of processors is expected to increase from one, then you should configure the number of parallel GC threads appropriately using -XX:ParallelGCThreads=N OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x0000000085330000, 2060255232, 0) failed; error='Cannot allocate memory' (errno=12) # # There is insufficient memory for the Java Runtime Environment to continue. # Native memory allocation (mmap) failed to map 2060255232 bytes for committing reserved memory. # An error report file with more information is saved as: # /root/elk/elasticsearch-6.5.4/bin/hs_err_pid3801.log解決: ``` 配置elasticsearch下的jvm.options: ``` # vi /etc/elasticsearch/jvm.options -Xms256m ##啟用如下兩項 -Xmx256m ##-Xms2g ##關閉如下兩項 ##-Xmx2g ``` ②ElasticSearch默認的對外服務的HTTP端口是9200,節點間交互的TCP端口是9300。 ``` OpenJDK 64-Bit Server VM warning: If the number of processors is expected to increase from one, then you should configure the number of parallel GC threads appropriately using -XX:ParallelGCThreads=N [2017-12-21T19:27:28,046][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [] uncaught exception in thread [main] org.elasticsearch.bootstrap.StartupException: java.lang.RuntimeException: can not run elasticsearch as root ``` 4、因為Elasticsearch5.0之后,不能使用root賬戶啟動,我們先創建一個elasticsearch組和賬戶 ``` useradd es chown -R es:es /app/elasticsearch-6.5.4/ su - es -c '/app/elasticsearch-6.5.4/bin/elasticsearch -d' ``` 192.168.235.154創建集群環境節點1 vi config/elasticsearch.yml ``` cluster.name: elasticsearch node.name: node-1 http.cors.enabled: true http.cors.allow-origin: "*" bootstrap.memory_lock: false bootstrap.system_call_filter: false network.host: 192.168.235.154 http.port: 9200 transport.tcp.port: 9300 discovery.zen.ping.unicast.hosts: ["192.168.235.154:9300","192.168.235.155:9300","192.168.235.157:9300"] ``` su - es -c '/app/elasticsearch-6.5.4/bin/elasticsearch -d' [root@localhost logs]# cd /app/elasticsearch-6.5.4/logs && tail -f elasticsearch.log 192.168.235.155創建集群環境節點2 vi config/elasticsearch.yml ``` cluster.name: elasticsearch node.name: node-2 http.cors.enabled: true http.cors.allow-origin: "*" bootstrap.memory_lock: false bootstrap.system_call_filter: false network.host: 192.168.235.155 http.port: 9200 transport.tcp.port: 9300 discovery.zen.ping.unicast.hosts: ["192.168.235.154:9300","192.168.235.155:9300","192.168.235.157:9300"] ``` su - es -c '/app/elasticsearch-6.5.4/bin/elasticsearch -d' [root@localhost logs]# cd /app/elasticsearch-6.5.4/logs && tail -f elasticsearch.log 192.168.235.157創建集群環境節點3 vi config/elasticsearch.yml ``` cluster.name: elasticsearch node.name: node-3 http.cors.enabled: true http.cors.allow-origin: "*" bootstrap.memory_lock: false bootstrap.system_call_filter: false network.host: 192.168.235.157 http.port: 9200 transport.tcp.port: 9300 discovery.zen.ping.unicast.hosts: ["192.168.235.154:9300","192.168.235.155:9300","192.168.235.157:9300"] ``` su - es -c '/app/elasticsearch-6.5.4/bin/elasticsearch -d' [root@localhost logs]# cd /app/elasticsearch-6.5.4/logs && tail -f elasticsearch.log ## 搭建效果 ![](https://img.kancloud.cn/e1/c0/e1c0a867fc7d14264cb97f1f09ba7d84_1260x402.png) ![](https://img.kancloud.cn/f9/ce/f9ce13b07b31780b3319e03cdc532255_1917x388.png) ![](https://img.kancloud.cn/f7/16/f7164305a0a46949258994758804ef87_1920x433.png) ![](https://img.kancloud.cn/ec/24/ec24879723669d9548f603efc8615199_1920x454.png)
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看