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

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                # Docker安裝方式 Elasticsearch也提供了可用的Docker鏡像,The images use [centos:7](https://hub.docker.com/_/centos/) as the base image and are available with [X-Pack](https://www.elastic.co/guide/en/x-pack/6.0/xpack-introduction.html). A list of all published Docker images and tags can be found in[www.docker.elastic.co](https://www.docker.elastic.co/). The source code can be found on?[GitHub](https://github.com/elastic/elasticsearch-docker/tree/6.0). ## Image types The images are available in three different configurations or "flavors". The basic flavor, which is the default, ships with X-Pack Basic features pre-installed and automatically activated with a free licence. The platinum flavor features all X-Pack functionally under a 30-day trial licence. The oss flavor does not include X-Pack, and contains only open-source Elasticsearch. > 注意 > > [X-Pack](https://www.elastic.co/guide/en/x-pack/6.0/xpack-security.html) Security is enabled in the platinum image. To access your cluster, it’s necessary to set an initial password for the elastic user. The initial password can be set at start up time via the ELASTIC_PASSWORD environment variable: ``` docker run -e ELASTIC_PASSWORD=MagicWord docker.elastic.co/elasticsearch/elasticsearch-platinum:6.0.0 ``` > 注意 > >The platinum image includes a trial license for 30 days. After that, you can obtain one of the available subscriptions or revert to a Basic licence. The Basic license is free and includes a selection of X-Pack features. Obtaining Elasticsearch for Docker is as simple as issuing a docker pull command against the Elastic Docker registry. Docker images can be retrieved with the following commands: ``` docker pull docker.elastic.co/elasticsearch/elasticsearch:6.0.0 docker pull docker.elastic.co/elasticsearch/elasticsearch-platinum:6.0.0 docker pull docker.elastic.co/elasticsearch/elasticsearch-oss:6.0.0 ``` ## 在命令行中運行Elasticsearch ### 開發模式 Elasticsearch可以通過下面的指令快起的在開發或測試環境中啟動: ``` docker run -p 9200:9200 -e "http.host=0.0.0.0" -e "transport.host=127.0.0.1" docker.elastic.co/elasticsearch/elasticsearch:5.3.0 ``` ### 生產模式 > 重要提示 > > 用于生產`vm_max_map_count`內核參數需要被設置到至少262144。不同平臺的設置方式: > > - Linux > > `vm_max_map_count`參數需要永久的配置在`/etc/sysctl.conf`中: > > > ``` > $ grep vm.max_map_count /etc/sysctl.conf > vm.max_map_count=262144 > > ``` > 正在運行的系統實時生效可使用:`sysctl -w vm.max_map_count=262144` > > - OSX with [Docker for Mac](https://docs.docker.com/engine/installation/mac/#/docker-for-mac) > > `vm_max_map_count`參數必須要在`xhyve`虛擬機中配置: > > > ``` > $ screen ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty > > ``` > 登錄到root用戶下,像Linux那樣通過`sysctl`來配置 > > > ``` > sysctl -w vm.max_map_count=262144 > > ``` > - OSX with [Docker Toolbox](https://docs.docker.com/engine/installation/mac/#docker-toolbox) > > `vm_max_map_count`參數必須要在`docker-machine`中配置: > > > ``` > docker-machine ssh > sudo sysctl -w vm.max_map_count=262144 > > ``` 下面的示例演示了啟動一個包含兩個節點的集群。啟動集群之前,你需要編寫好[docker-compose.yml](#docker-compose),然后輸入: ``` docker-compose up ``` > 注意 > > 如果Linux上沒有預安裝`docker-compose`指令,請參考此站點進行安裝:[docker-compose](https://docs.docker.com/compose/install/#install-using-pip)。 `elasticsearch1`節點將會監聽`localhost:9200`,并且`elasticsearch1`與`elasticsearch2`將會通過Docker網絡通信。 這個例子還使用[Docker named volumes](https://docs.docker.com/engine/tutorials/dockervolumes),被稱為esdata1和esdata2,,如果不存在會先創建。 `docker-compose.yml:` ``` version: '2' services: elasticsearch1: image: docker.elastic.co/elasticsearch/elasticsearch:5.3.0 container_name: elasticsearch1 environment: - cluster.name=docker-cluster - bootstrap.memory_lock=true - "ES_JAVA_OPTS=-Xms512m -Xmx512m" ulimits: memlock: soft: -1 hard: -1 nofile: soft: 65536 hard: 65536 mem_limit: 1g cap_add: - IPC_LOCK volumes: - esdata1:/usr/share/elasticsearch/data ports: - 9200:9200 networks: - esnet elasticsearch2: image: docker.elastic.co/elasticsearch/elasticsearch:5.3.0 environment: - cluster.name=docker-cluster - bootstrap.memory_lock=true - "ES_JAVA_OPTS=-Xms512m -Xmx512m" - "discovery.zen.ping.unicast.hosts=elasticsearch1" ulimits: memlock: soft: -1 hard: -1 nofile: soft: 65536 hard: 65536 mem_limit: 1g cap_add: - IPC_LOCK volumes: - esdata2:/usr/share/elasticsearch/data networks: - esnet volumes: esdata1: driver: local esdata2: driver: local networks: esnet: driver: bridge ``` 若要停掉整個集群,輸入`docker-compose down`即可。數據目錄會被保留下來,所以再次通過`docker-compose up`啟動整個集群會得到之前的數據。如要停止整個集群且刪除之前的數據,請使用`docker-compose down -v`即可。 ### 檢查集群狀態 ``` curl -u elastic http://127.0.0.1:9200/_cat/health Enter host password for user 'elastic': 1472225929 15:38:49 docker-cluster green 2 2 4 2 0 0 0 0 - 100.0% ``` 日志信息將被輸出到控制臺且被Docker日志驅動處理。默認情況下你可以通多`docker logs`來獲取日志信息。 ## 在Docker中配置Elastcsearch Elasticsearch從`/usr/share/elasticsearch/config`文件中加載配置。這些配置文件的文檔在[Elasticsearch設置](../Configuring_Elasticsearch.md)與[JVM設置](../Important_System_Configuration/Configuring_system_settings.md#jvm-options)。 鏡像通過了配置多種方式,傳統的是修改`elasticsearch.yml`文件,但也可以通過環境變量來設置參數: ### A.通過Docker環境變量方式設置 例如,在使用`docker run`的時候輸入`-e "cluster.name=mynewclustername"`來定義集群名稱。雙引號是必須的。 > 注意 > > [默認設置](../Configuring_Elasticsearch.md#_setting_default_settings)與普通設置有一些區別。如果你定義了,模板中以`default.`開頭的普通設置將不會被覆蓋。 ### B.綁定掛載文件方式設置 創建一個自定義的配置文件并掛載到鏡像中配置文件同樣的路徑。例如,使用`docker run`時綁定掛載一個`custom_elasticsearch.yml`的參數: ``` -v full_path_to/custom_elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml ``` > 重要 > > `custom_elasticsearch.yml`需要能夠被`uid:gid 1000:1000`讀取。 ### C.自定義鏡像 在某些環境中,你可以需要自定義鏡像包括你的配置。一個完整的`Dockerfile`可能像是下面這個樣子: ``` FROM docker.elastic.co/elasticsearch/elasticsearch:5.3.0 ADD elasticsearch.yml /usr/share/elasticsearch/config/ USER root RUN chown elasticsearch:elasticsearch config/elasticsearch.yml USER elasticsearch ``` 然后您可以像這樣嘗試構建: ``` docker build --tag=elasticsearch-custom . docker run -ti -v /usr/share/elasticsearch/data elasticsearch-custom ``` ### D.覆蓋鏡像默認的命令行參數 可以通過鏡像的默認指令來覆蓋Elsticsearch提供的命令行參數,例如: ``` docker run <various parameters> bin/elasticsearch -Ecluster.name=mynewclustername ``` ## 生產使用以及默認值的注意事項 我們收集了一些生產使用的最佳實踐配置。所有提及到的參數都假定你使用`docker run`。 // TODO ## 下一步 現在,您搭建了一個測試環境Elasticsearch。開始更深入的研究或投入生產使用Elasticsearch之前,你需要做一些額外的配置: - 了解如何[配置Elasticsearch](../Configuring_Elasticsearch.md)。 - 配置[重要的Elasticsearch設置](../Important_Elasticsearch_configuration.md)。 - 配置[重要的系統設置](../Important_System_Configuration.md)。
                  <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>

                              哎呀哎呀视频在线观看