influxdb/influxdb — pull request #921 by oliveagle (2014-09-10 08:41:15+00:00)
Title: Sharding 2 up servers only

only create shard on up servers.

3 servers all up: **/cluster/servers?u=root&p=root**

[{"id":1,"isLeader":true,"isUp":true, . . . },
{"id":2,"isLeader":false,"isUp":true, . . .},
{"id":3,"isLeader":false,"isUp":true, . . }]

shard info: **/cluster/shards?u=root&p=root**

[{"database":"mon_sg","endTime":1410247080,"id":24,"serverIds":[1,2],"spaceName":"s1","startTime":1410247020},
{"database":"mon_sg","endTime":1410247020,"id":25,"serverIds":[2,3],"spaceName":"s1","startTime":1410246960},
{"database":"mon_sg","endTime":1410246960,"id":26,"serverIds":[1,3],"spaceName":"s1","startTime":1410246900},
{"database":"mon_sg","endTime":1410247140,"id":27,"serverIds":[1,2],"spaceName":"s1","startTime":1410247080},
{"database":"mon_sg","endTime":1410247260,"id":28,"serverIds":[2,3],"spaceName":"s1","startTime":1410247200}]

shutdown 1 server: **/cluster/servers?u=root&p=root**

[{"id":1,"isLeader":true,"isUp":true, . . . },
{"id":2,"isLeader":false,"isUp":true, . . .},
{"id":3,"isLeader":false,"isUp":false, . . }]

shard info: **/cluster/shards?u=root&p=root**

[{"database":"mon_sg","endTime":1410247080,"id":24,"serverIds":[1,2],"spaceName":"s1","startTime":1410247020},
{"database":"mon_sg","endTime":1410247020,"id":25,"serverIds":[2,3],"spaceName":"s1","startTime":1410246960},
{"database":"mon_sg","endTime":1410246960,"id":26,"serverIds":[1,3],"spaceName":"s1","startTime":1410246900},
{"database":"mon_sg","endTime":1410247140,"id":27,"serverIds":[1,2],"spaceName":"s1","startTime":1410247080},
{"database":"mon_sg","endTime":1410247260,"id":28,"serverIds":[2,3],"spaceName":"s1","startTime":1410247200},
{"database":"mon_sg","endTime":1410247380,"id":29,"serverIds":[1,2],"spaceName":"s1","startTime":1410247320},
{"database":"mon_sg","endTime":1410247320,"id":30,"serverIds":[1,2],"spaceName":"s1","startTime":1410247260},
{"database":"mon_sg","endTime":1410247200,"id":31,"serverIds":[1,2],"spaceName":"s1","startTime":1410247140}]