您的位置:首页 > 大数据 > 人工智能

mesos-go/examples/zkdetect/main.go 测试

2015-10-17 18:49 621 查看
zkdetect测试代码主要负责发现mesos master leader

1. standalone模式

1.1先启动本地mesos集群:

root@ubuntu:/home/tjy/mesos-0.24.0/build/bin# ./mesos-local.sh --ip=127.0.0.1 --port=5050

1.2然后执行测试代码:

root@ubuntu:/home/tjy/go-ws/src/github.com/mesos/mesos-go/examples/_output# ./zkdetect -masters 127.0.0.1:5050
-log_dir . -v 3

1.3执行结果如下:

root@ubuntu:/home/tjy/go-ws/src/github.com/mesos/mesos-go/examples/_output# cat
zkdetect.INFO
Log file created at: 2015/10/11 20:31:08
Running on machine: ubuntu
Binary: Built with gc go1.5.1 for linux/amd64
Log line format: [IWEF]mmdd hh:mm:ss.uuuuuu threadid file:line] msg
I1011 20:31:08.444243 2978 main.go:38] creating ZK detector for "127.0.0.1:5050"
I1011 20:31:08.444859 2978 factory.go:93] New.defaultFactory
I1011 20:31:08.444896 2978 standalone.go:46] creating new standalone detector for &MasterInfo{Id:*master,Ip:*0,Port:*5050,Pid:*master@127.0.0.1:5050,Hostname:*127.0.0.1,Version:nil,Address:nil,XXX_unrecognized:[],}
I1011 20:31:08.444952 2978 main.go:45] created ZK detector
I1011 20:31:08.444966 2978 standalone.go:67] Detect()
I1011 20:31:08.444978 2978 standalone.go:69] spinning up asyc master detector poller
I1011 20:31:08.445478 2978 standalone.go:78] spawning asyc master detector listener
I1011 20:31:08.445620 2978 main.go:51] registered ZK listener
I1011 20:31:08.445638 2978 standalone.go:80] waiting for polled to send updates
I1011 20:31:08.445684 2978 standalone.go:140] polling for master leadership at '127.0.0.1:5050'
I1011 20:31:08.451280 2978 standalone.go:214] Got mesos state, content length 1675
I1011 20:31:08.451771 2978 standalone.go:147] detected leadership change from '<nil>' to 'master@127.0.0.1:5050'
I1011 20:31:08.451840 2978 standalone.go:185] master leader poller sleeping for 29.993862976s

I1011 20:31:08.451864 2978 standalone.go:88] detected master change: &MasterInfo{Id:*master,Ip:*0,Port:*5050,Pid:*master@127.0.0.1:5050,Hostname:*127.0.0.1,Version:nil,Address:nil,XXX_unrecognized:[],}

I1011 20:31:08.451970 2978 main.go:19] master changed: Id master Ip 0 Hostname 127.0.0.1 Port 5050 Version Pid master@127.0.0.1:5050

I1011 20:31:38.459248 2978 standalone.go:214] Got mesos state, content length 1675

I1011 20:31:38.461606 2978 standalone.go:161] no change to master leadership: 'master@127.0.0.1:5050'

I1011 20:31:38.461828 2978 standalone.go:185] master leader poller sleeping for 29.985301792s

2. High Availability模式

2.1 先启动HA模式的mesos集群

2.2 执行测试命令:./zkdetect
-masters zk://192.168.1.91:2181/mesos -log_dir . -v 3
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: