示例#1
0
func (f *fakeRunCommand) ensureServiceInstalled(dataDir string, statePort, oplogSizeMB int, setNumaControlPolicy bool, version mongo.Version, auth bool) error {
	ran := []string{"mongo.EnsureServiceInstalled",
		dataDir,
		strconv.Itoa(statePort),
		strconv.Itoa(oplogSizeMB),
		strconv.FormatBool(setNumaControlPolicy),
		version.String(),
		strconv.FormatBool(auth)}

	f.ranCommands = append(f.ranCommands, ran)
	return nil
}
示例#2
0
func (a *MachineAgent) maybeStopMongo(ver mongo.Version, isMaster bool) error {
	if !a.mongoInitialized {
		return nil
	}

	conf := a.AgentConfigWriter.CurrentConfig()
	v := conf.MongoVersion()

	logger.Errorf("Got version change %v", ver)
	// TODO(perrito666) replace with "read-only" mode for environment when
	// it is available.
	if ver.NewerThan(v) > 0 {
		err := a.AgentConfigWriter.ChangeConfig(func(config agent.ConfigSetter) error {
			config.SetMongoVersion(mongo.MongoUpgrade)
			return nil
		})
		if err != nil {
			return err
		}

	}
	return nil

}
示例#3
0
文件: agent.go 项目: kat-co/juju
// SetMongoVersion implements configSetterOnly.
func (c *configInternal) SetMongoVersion(v mongo.Version) {
	c.mongoVersion = v.String()
}