fix . Cluster admin passwords don't propagate to other nodes in cluster

pull/511/head
John Shahid 2014-05-06 16:16:33 -04:00
parent fc213272f6
commit fcf737d6c3
5 changed files with 36 additions and 1 deletions

View File

@ -4,6 +4,7 @@
- [Issue #500](https://github.com/influxdb/influxdb/issues/500). Support `y` sufix in time durations
- [Issue #501](https://github.com/influxdb/influxdb/issues/501). Writes with invalid payload should be rejected
- [Issue #507](https://github.com/influxdb/influxdb/issues/507). New cluster admin passwords don't propagate properly to other nodes in a cluster
## v0.6.0 [2014-05-02]

View File

@ -469,6 +469,7 @@ func (self *ClusterConfiguration) SaveClusterAdmin(u *ClusterAdmin) {
return
}
self.clusterAdmins[u.GetName()] = u
u.ChangePassword(u.Hash)
}
type SavedConfiguration struct {

View File

@ -284,7 +284,7 @@ func (s *RaftServer) ChangeConnectionString(raftName, protobufConnectionString,
for _, s := range s.raftServer.Peers() {
// send the command and ignore errors in case a server is down
SendCommandToServer(s.ConnectionString, command)
log.Info("sent command to change port to %s", s.ConnectionString)
log.Info("sent %#v to %s", command, s.ConnectionString)
}
// make the change permament

View File

@ -53,6 +53,31 @@ func (self *ServerSuite) TearDownSuite(c *C) {
}
}
func (self *ServerSuite) TestChangingRootPassword(c *C) {
rootClient := self.serverProcesses[0].GetClient("", c)
c.Assert(rootClient.CreateClusterAdmin("newroot", "root"), IsNil)
for _, s := range self.serverProcesses {
s.WaitForServerToSync()
}
for _, s := range self.serverProcesses {
client := s.GetClient("", c)
c.Assert(client.AuthenticateClusterAdmin("newroot", "root"), IsNil)
}
c.Assert(rootClient.ChangeClusterAdminPassword("newroot", "root2"), IsNil)
for _, s := range self.serverProcesses {
s.WaitForServerToSync()
}
for _, s := range self.serverProcesses {
client := s.GetClient("", c)
c.Assert(client.AuthenticateClusterAdmin("newroot", "root2"), IsNil)
}
}
func (self *ServerSuite) TestGraphiteInterface(c *C) {
conn, err := net.Dial("tcp", "localhost:60513")
c.Assert(err, IsNil)

View File

@ -94,6 +94,14 @@ func (self *Server) ListenAndServe() error {
raftConnectionString := self.Config.RaftConnectionString()
if self.ClusterConfig.LocalServer.ProtobufConnectionString != self.Config.ProtobufConnectionString() ||
self.ClusterConfig.LocalServer.RaftConnectionString != raftConnectionString {
log.Info("Sending change connection string command (%s,%s) (%s,%s)",
self.ClusterConfig.LocalServer.ProtobufConnectionString,
self.Config.ProtobufConnectionString(),
self.ClusterConfig.LocalServer.RaftConnectionString,
raftConnectionString,
)
err := self.RaftServer.ChangeConnectionString(
self.ClusterConfig.LocalRaftName,
self.Config.ProtobufConnectionString(),