配置详解
##################################################################################################################
#
# NOTICE:
#
# 系统配置文件,所有列出的项是系统所支持全部配置项
# 如果要覆盖某项的值可以添加到mpush.conf中。
#
# 配置文件格式采用HOCON格式。解析库由https://github.com/typesafehub/config提供。
# 具体可参照器说明文档,比如含有特殊字符的字符串必须用双引号包起来。
#
##############################################################################################################
mp {
#日志配置
log.level=warn
log.dir=${user.dir}/../logs
#核心配置
core {
max-packet-size=10k
compress-threshold=10k
min-heartbeat=3m
max-heartbeat=3m
max-hb-timeout-times=2
session-expired-time=1d
epoll-provider=netty
}
#安全配置
security {
#rsa 私钥, 公钥 key长度为1024;生成方式可以使用open-ssh或者使用工具类com.mpush.tools.crypto.RSAUtils#main
private-key="MIIBNgIBADANBgkqhkiG9w0BAQEFAASCASAwggEcAgEAAoGBAKCE8JYKhsbydMPbiO7BJVq1pbuJWJHFxOR7L8Hv3ZVkSG4eNC8DdwAmDHYu/wadfw0ihKFm2gKDcLHp5yz5UQ8PZ8FyDYvgkrvGV0ak4nc40QDJWws621dm01e/INlGKOIStAAsxOityCLv0zm5Vf3+My/YaBvZcB5mGUsPbx8fAgEAAoGAAy0+WanRqwRHXUzt89OsupPXuNNqBlCEqgTqGAt4Nimq6Ur9u2R1KXKXUotxjp71Ubw6JbuUWvJg+5Rmd9RjT0HOUEQF3rvzEepKtaraPhV5ejEIrB+nJWNfGye4yzLdfEXJBGUQzrG+wNe13izfRNXI4dN/6Q5npzqaqv0E1CkCAQACAQACAQACAQACAQA="
public-key="MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCghPCWCobG8nTD24juwSVataW7iViRxcTkey/B792VZEhuHjQvA3cAJgx2Lv8GnX8NIoShZtoCg3Cx6ecs+VEPD2fBcg2L4JK7xldGpOJ3ONEAyVsLOttXZtNXvyDZRijiErQALMTorcgi79M5uVX9/jMv2Ggb2XAeZhlLD28fHwIDAQAB"
aes-key-length=16
ras-key-length=1024
}
#网络配置
net {
connect-server-port=3000
gateway-server-port=3001
admin-server-port=3002
public-host-mapping {
"127.0.0.1":"111.1.32.137"
}
traffic-shaping {
gateway-client {
enabled:true
check-interval:100ms
write-global-limit:1k
read-global-limit:0
write-channel-limit:256b
read-channel-limit:0
}
gateway-server {
enabled:true
check-interval:100ms
write-global-limit:0
read-global-limit:10k
write-channel-limit:0
read-channel-limit:0.5k
}
connect-server {
enabled:false
check-interval:100ms
write-global-limit:0
read-global-limit:100k
write-channel-limit:3k
read-channel-limit:3k
}
}
}
#Zookeeper配置
zk {
server-address="127.0.0.1:2181"
namespace=mpush
digest=mpush
local-cache-path=/
retry {
#initial amount of time to wait between retries
baseSleepTimeMs=3s
#max number of times to retry
maxRetries=3
#max time in ms to sleep on each retry
maxSleepMs=5s
}
connectionTimeoutMs=5s
sessionTimeoutMs=5s
}
#Redis集群配置
redis {
write-to-zk=true
#redis 集群配置,group 是个二维数组,第一层表示有多少组集群,每个集群下面可以有多台机器
cluster-group:[
[
{
host:"127.0.0.1"
port:2181
password:ShineMoIpo
}
]
]
config {
maxTotal:8,
maxIdle:4,
minIdle:1,
lifo:true,
fairness:false,
maxWaitMillis:5000,
minEvictableIdleTimeMillis:300000,
softMinEvictableIdleTimeMillis:1800000,
numTestsPerEvictionRun:3,
testOnCreate:false,
testOnBorrow:false,
testOnReturn:false,
testWhileIdle:false,
timeBetweenEvictionRunsMillis:60000,
blockWhenExhausted:true,
jmxEnabled:true,
jmxNamePrefix:pool,
jmxNameBase:pool
}
}
#HTTP代理配置
http {
proxy-enabled=false
max-conn-per-host=5
default-read-timeout=10s
max-content-length=5m
dns-mapping {
"mpush.com":["127.0.0.1:8080", "127.0.0.1:8081"]
}
}
#线程池配置
thread {
pool {
boss {
min:4
max:16
queue-size:1000
}
work {
min:8
max:32
queue-size:1000
}
event-bus {
min:4
max:4
queue-size:10000
}
http-proxy {
min:8
max:64
queue-size:1000
}
biz {
min:4
max:64
queue-size:10
}
mq {
min:2
max:4
queue-size:10000
}
push-callback {
min:2
max:2
queue-size:0
}
}
}
#系统监控配置
monitor {
dump-dir=/tmp/logs/mpush/
dump-stack=false
dump-period=1m
print-log=true
}
#SPI扩展配置
spi {
thread-pool-factory:"com.mpush.tools.thread.pool.DefaultThreadPoolFactory"
dns-mapping-manager:"com.mpush.common.net.HttpProxyDnsMappingManager"
}
}