亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

NATS服務(wù)器配置的詳細(xì)介紹

 更新時(shí)間:2017年10月29日 14:40:29   作者:資深架構(gòu)師  
這篇文章主要介紹了NATS服務(wù)器配置的詳細(xì)介紹的相關(guān)資料,希望通過(guò)本文能幫助到大家,需要的朋友可以參考下

NATS服務(wù)器配置的詳細(xì)介紹

前言:

盡管NATS可以無(wú)配置的運(yùn)行,但也可以使用配置文件配置NATS服務(wù)器。

1)配置項(xiàng)包括

  • 客戶(hù)端監(jiān)聽(tīng)器端口 Client listening port
  • HTTP監(jiān)聽(tīng)器端口 HTTP monitoring port
  • 客戶(hù)端認(rèn)證 Client auth
  • 集群定義 Cluster definitions
  • 集群路由 Cluster routes
  • 日志 Logging
  • 最大客戶(hù)端連接數(shù) Max client connections
  • 最大有效負(fù)載 Max payload
  • 慢消費(fèi)者閥值 Slow consumer threshold

2)配置文件的語(yǔ)法

NATS服務(wù)器配置文件的格式比較靈活,結(jié)合了傳統(tǒng)的JSON格式和新的YAML格式的風(fēng)格。

NATS配置文件格式支持以下語(yǔ)法:

Mixed Arrays: […]
Nested Maps: {…}
Multiple comment types: # and //
Key value assigments using:

    Equals sign (foo = 2) 
    Colon (foo: 2) 
    Whitespace (foo 2)

Maps can be assigned with no key separator

Semicolons as value terminators in key/value assignments are optional

注:YAML不是標(biāo)記語(yǔ)言,而是一種語(yǔ)言中立的、對(duì)閱讀友好的數(shù)據(jù)序列化標(biāo)準(zhǔn)。YAML語(yǔ)言發(fā)展了三個(gè)版本,1.0、1.1、1.2,

3)NATS服務(wù)器配置文件示例

下面是一個(gè)完整的NATS服務(wù)器配置文件樣例:

port: 4242   # 供客戶(hù)端連接的監(jiān)聽(tīng)端口
net: apcera.me # 監(jiān)聽(tīng)的網(wǎng)絡(luò)地址

http_port: 8222 # HTTP監(jiān)控端口

# 客戶(hù)端連接的認(rèn)證信息
authorization {
 user:   derek
 password: T0pS3cr3t
 timeout: 1
}

# 集群定義
cluster {

 host: '127.0.0.1' # 主機(jī)地址
 port: 4244     # 路由連接的入站(inbound)端口

 # 路由連接的認(rèn)證信息
 authorization {
  user: route_user
  password: T0pS3cr3tT00!
  timeout: 0.5
 }

 # Routes are actively solicited and connected to from this server.
 # Other servers can connect to us if they supply the correct credentials
 # in their routes definitions from above.
 routes = [
  nats-route://user1:pass1@127.0.0.1:4245
  nats-route://user2:pass2@127.0.0.1:4246
 ]
}

# 日志選項(xiàng)
debug:  false
trace:  true
logtime: false
log_file: "/tmp/gnatsd.log"

# PID進(jìn)程文件
pid_file: "/tmp/gnatsd.pid"

# 一些系統(tǒng)屬性

# 客戶(hù)端最大連接數(shù)
max_connections: 100

# 最大協(xié)議控制行
max_control_line: 512

# 最大的有效負(fù)載
max_payload: 65536

# 慢消費(fèi)者閥值
max_pending_size: 10000000

 如有疑問(wèn)請(qǐng)留言或者到本站社區(qū)交流討論,感謝閱讀,希望能幫助到大家,謝謝大家對(duì)本站的支持!

相關(guān)文章

最新評(píng)論