在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 教程/ 數(shù)據(jù)庫/ 快速開始
nsqadmin
常見問題
安裝
編譯客戶端庫
特性和擔(dān)保
工具
拓?fù)淠J?/span>
設(shè)計
Docker
nsqd
內(nèi)幕
性能
TCP 協(xié)議規(guī)范
nsqlookupd
介紹
產(chǎn)品配置
客戶端庫
快速開始

快速開始

下面的步驟將通過推送(publishing)、消費(fèi)(consuming)和歸檔(archiving)消息到本地磁盤,在本地環(huán)境演示一個小型的 NSQ 集群

  1. 根據(jù)文檔安裝安裝 NSQ。

  2. 在另外一個 shell 中,運(yùn)行 nsqlookupd:

      $ nsqlookupd
  3. 再開啟一個 shell,運(yùn)行 nsqd:

      $ nsqd --lookupd-tcp-address=127.0.0.1:4160
  4. 再開啟第三個 shell,運(yùn)行 nsqadmin:

      $ nsqadmin --lookupd-http-address=127.0.0.1:4161
  5. 開啟第四個 shell,推送一條初始化數(shù)據(jù)(并且在集群中創(chuàng)建一個 topic):

      $ curl -d 'hello world 1' 'http://127.0.0.1:4151/put?topic=test'
  6. 最后,開啟第五個 shell, 運(yùn)行 nsq_to_file:

      $ nsq_to_file --topic=test --output-dir=/tmp --lookupd-http-address=127.0.0.1:4161
  7. 推送更多地數(shù)據(jù)到 nsqd:

      $ curl -d 'hello world 2' 'http://127.0.0.1:4151/put?topic=test'
      $ curl -d 'hello world 3' 'http://127.0.0.1:4151/put?topic=test'
  8. 按照預(yù)先設(shè)想的,在瀏覽器中打開 http://127.0.0.1:4171/ 就能查看 nsqadmin 的 UI 界面和隊列統(tǒng)計數(shù)據(jù)。同時,還可以在 /tmp 目錄下檢查 (test.*.log) 文件.

這個教程中最重要的是:nsq_to_file (客戶端)沒有明確地指出 test 主題從哪里產(chǎn)生,它從 nsqlookupd 獲取信息,即使在消息推送之后才開始連接 nsqd,消息也并沒有消失。

上一篇:性能下一篇:TCP 協(xié)議規(guī)范