标签:
Neptune 流程简介
配置参数简介
流程、配置参数详解
1 #system configurations 2 *SYSTEM 3 4 MULTICASTADDR = 239.255.0.4 5 6 # state announcing/listening multicast address 7 8 MULTICASTPORT = 10002 9 10 # state multicast listening port 11 12 STATEANNOUNCE = 1.0 13 14 # state announcing interval (in seconds) 15 16 LOADUDPPORT = 20014 17 18 SHMKEY = 747 19 20 LOADANNOUNCE = 1.0 21 22 # workload announcing interval (in seconds) 23 24 STATEEXPIRE = 5.0 25 26 # state expiration period (in seconds)
1 # global service configurations 2 *SERVICE 3 [Lookup] 4 CONSISTENCY = Readonly 5 INITPROC = Lookup_Init 6 FINALPROC = Lookup_Final 7 REQRESPROC = Lookup_Lookup 8 TOTAL_PARTITION = 2
1 # server configurations 2 *SERVER 3 INTERFACE = eth1 4 LISTENPORT = 8382 5 # local service configurations 6 *SERVICE 7 [Lookup] 8 PROCESS_MODE = 0 9 SVC_DLL = ../bin/Lookup.so 10 LOCAL_PARTITION = 0 11 NUM_WORKER = 20
1 #system configurations 2 *SYSTEM 3 MULTICASTADDR = 239.255.0.4 #多播地址 4 MULTICASTPORT = 10002 #多播端口 5 #Neptune服务机器之间要配置同一个多播地址和端口,就属于同一个多播组 6 SHMKEY = 747 #共享内存,用于多播数据的读写空间 7 STATEANNOUNCE = 1.0 #每1秒钟向多播组发布状态信息(服务、分区等) 8 STATEEXPIRE = 5.0 #每条状态信息5秒钟后过期
1 #system configurations 2 3 *SYSTEM 4 5 LOADANNOUNCE = 1.0 #每1秒钟更新本机Load信息 6 7 LOADUDPPORT = 20014 #主线程监听20014号UDP端口,当有客户端的Load查询请求,返回本机Load信息
1 # global service configurations 2 3 *SERVICE 4 5 #本机每添加一个服务,就添加与以下类似的配置块 6 7 [Lookup] #服务名 8 9 CONSISTENCY = Readonly #模式 (只读) 10 11 INITPROC = Lookup_Init #初始化函数函数名(加载配置、数据等) 12 13 FINALPROC = Lookup_Final #终结函数函数名(释放内存等) 14 15 REQRESPROC = Lookup_Lookup #服务函数函数名 16 17 TOTAL_PARTITION = 2 #该服务的数据分区个数
配置参数 - server_conf:
1 # server configurations 2 3 *SERVER 4 5 INTERFACE = eth1 #网卡接口 6 7 LISTENPORT = 8382 #监听服务请求的端口 8 9 # local service configurations 10 11 *SERVICE 12 13 [Lookup] #服务名 14 15 PROCESS_MODE = 0 #模式(多线程 0 ,多进程 1) 16 17 SVC_DLL = ../bin/Lookup.so #服务程序所生成的动态链接库的地址 18 19 LOCAL_PARTITION = 0 #本地该服务的数据分区编号 20 21 NUM_WORKER = 20 #工作线程/进程的数量
1 #!/bin/bash 2 3 node=$(uname -n); 4 5 root=`pwd`/.. 6 7 echo $root 8 9 export NEPTUNE_LOAD_PORT=20014 #Load查询请求监听端口 10 11 export NEPTUNE_SHM_KEY=747 #共享内存 12 13 export NEPTUNE_MAX_QLEN=50 #队列最大长度 14 15 export NEPTUNE_LOGFILE=$root/logs/server_log #日志文件地址 16 17 export NEPTUNE_SYSCONFFILE=$root/conf/system_conf #系统配置文件地址 18 19 export NEPTUNE_SVRCONFFILE=$root/conf/server_conf #服务器配置文件地址 20 21 export NEPTUNE_SVCCONFPATH=$root/conf #配置文件夹地址(用于生成该服务 22 23 ../bin/NeptuneServer_g & #启动Neptune服务器 特有的配置文件的地址) 24 25 echo "$node Neptune started" 26 27
标签:
原文地址:http://www.cnblogs.com/xiaoyesoso/p/4612157.html