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

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                ## 安裝 `etcd` 基于 `Go` 語言實現,因此,用戶可以從 [項目主頁](https://github.com/coreos/etcd) 下載源代碼自行編譯,也可以下載編譯好的二進制文件,甚至直接使用制作好的 `Docker` 鏡像文件來體驗。 >注意:本章節內容基于 etcd `3.x` 版本 ### 二進制文件方式下載 編譯好的二進制文件都在 [github.com/coreos/etcd/releases](https://github.com/coreos/etcd/releases/) 頁面,用戶可以選擇需要的版本,或通過下載工具下載。 例如,使用 `curl` 工具下載壓縮包,并解壓。 ```bash $ curl -L https://github.com/coreos/etcd/releases/download/v3.2.10/etcd-v3.2.10-linux-amd64.tar.gz -o etcd-v3.2.10-linux-amd64.tar.gz $ tar xzvf etcd-v3.2.10-linux-amd64.tar.gz $ cd etcd-v3.2.10-linux-amd64 ``` 解壓后,可以看到文件包括 ```bash $ ls Documentation README-etcdctl.md README.md READMEv2-etcdctl.md etcd etcdctl ``` 其中 `etcd` 是服務主文件,`etcdctl` 是提供給用戶的命令客戶端,其他文件是支持文檔。 下面將 `etcd` `etcdctl` 文件放到系統可執行目錄(例如 `/usr/local/bin/`)。 ```bash $ sudo cp etcd* /usr/local/bin/ ``` 默認 `2379` 端口處理客戶端的請求,`2380` 端口用于集群各成員間的通信。啟動 `etcd` 顯示類似如下的信息: ```bash $ etcd 2017-12-03 11:18:34.406082 I | etcdmain: etcd Version: 3.2.10 2017-12-03 11:18:34.406226 I | etcdmain: Git SHA: GitNotFound 2017-12-03 11:18:34.406235 I | etcdmain: Go Version: go1.9.2 2017-12-03 11:18:34.406242 I | etcdmain: Go OS/Arch: darwin/amd64 2017-12-03 11:18:34.406250 I | etcdmain: setting maximum number of CPUs to 4, total number of available CPUs is 4 2017-12-03 11:18:34.406265 N | etcdmain: failed to detect default host (default host not supported on darwin_amd64) 2017-12-03 11:18:34.406279 W | etcdmain: no data-dir provided, using default data-dir ./default.etcd 2017-12-03 11:18:34.406457 N | etcdmain: the server is already initialized as member before, starting as etcd member... 2017-12-03 11:18:34.411579 I | embed: listening for peers on http://localhost:2380 2017-12-03 11:18:34.411938 I | embed: listening for client requests on localhost:2379 ``` 此時,可以使用 `etcdctl` 命令進行測試,設置和獲取鍵值 `testkey: "hello world"`,檢查 `etcd` 服務是否啟動成功: ```bash $ ETCDCTL_API=3 etcdctl member list 8e9e05c52164694d, started, default, http://localhost:2380, http://localhost:2379 $ ETCDCTL_API=3 etcdctl put testkey "hello world" OK $ etcdctl get testkey testkey hello world ``` 說明 etcd 服務已經成功啟動了。 ### Docker 鏡像方式運行 鏡像名稱為 `quay.io/coreos/etcd`,可以通過下面的命令啟動 `etcd` 服務監聽到 `2379` 和 `2380` 端口。 ```bash $ export NODE1=192.168.1.21 $ docker run --name etcd \ -p 2379:2379 \ -p 2380:2380 \ --volume=etcd-data:/etcd-data \ quay.io/coreos/etcd:latest \ /usr/local/bin/etcd \ --data-dir=/etcd-data --name node1 \ --initial-advertise-peer-urls http://${NODE1}:2380 --listen-peer-urls http://0.0.0.0:2380 \ --advertise-client-urls http://${NODE1}:2379 --listen-client-urls http://0.0.0.0:2379 \ --initial-cluster node1=http://${NODE1}:2380 ``` >注意:etcd 官方標注 `quay.io/coreos/etcd` 即將廢棄,啟用新的 `gcr.io/etcd-development/etcd` 鏡像,但后者由于網絡原因,國內不能下載到該鏡像,這里仍然使用前者作為演示。 打開新的終端按照上一步的方法測試 `etcd` 是否成功啟動。 ### macOS 中運行 ```bash $ brew install etcd $ etcd $ etcdctl member list ```
                  <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>

                              哎呀哎呀视频在线观看