write ceph daemon conf files to the log
This commit is contained in:
1 parent
fdda1f615e
commit
e355cdb68d
5 files changed
+33
-6
No files matched your search
@@ -135,6 +135,10 @@ func (a *mdsAgent) startMDS(context *clusterd.Context, cluster *mon.ClusterInfo,
|
||||
|
||||
// start the monitor daemon in the foreground with the given config
|
||||
logger.Infof("starting mds %s", id)
|
||||
|
||||
confFile := getMDSConfFilePath(context.ConfigDir, id, cluster.Name)
|
||||
util.WriteFileToLog(logger, confFile)
|
||||
|
||||
mdsNameArg := fmt.Sprintf("--name=mds.%s", id)
|
||||
mdsProc, err := context.ProcMan.Start(
|
||||
fmt.Sprintf("mds%s", id),
|
||||
@@ -144,7 +148,7 @@ func (a *mdsAgent) startMDS(context *clusterd.Context, cluster *mon.ClusterInfo,
|
||||
"--foreground",
|
||||
mdsNameArg,
|
||||
fmt.Sprintf("--cluster=%s", cluster.Name),
|
||||
fmt.Sprintf("--conf=%s", getMDSConfFilePath(context.ConfigDir, id, cluster.Name)),
|
||||
fmt.Sprintf("--conf=%s", confFile),
|
||||
fmt.Sprintf("--keyring=%s", getMDSKeyringPath(context.ConfigDir, id)),
|
||||
"-i", id)
|
||||
if err != nil {
|
||||
|
||||
@@ -168,6 +168,9 @@ func (a *agent) runMonitor(context *clusterd.Context, cluster *ClusterInfo, moni
|
||||
return fmt.Errorf("missing endpoint for mon %s", monitor.Name)
|
||||
}
|
||||
|
||||
confFile := GetConfFilePath(getMonRunDirPath(context.ConfigDir, monitor.Name), cluster.Name)
|
||||
util.WriteFileToLog(logger, confFile)
|
||||
|
||||
// start the monitor daemon in the foreground with the given config
|
||||
logger.Infof("starting monitor %s", monitor.Name)
|
||||
monNameArg := fmt.Sprintf("--name=mon.%s", monitor.Name)
|
||||
@@ -180,7 +183,7 @@ func (a *agent) runMonitor(context *clusterd.Context, cluster *ClusterInfo, moni
|
||||
fmt.Sprintf("--cluster=%s", cluster.Name),
|
||||
monNameArg,
|
||||
fmt.Sprintf("--mon-data=%s", getMonDataDirPath(context.ConfigDir, monitor.Name)),
|
||||
fmt.Sprintf("--conf=%s", GetConfFilePath(getMonRunDirPath(context.ConfigDir, monitor.Name), cluster.Name)),
|
||||
fmt.Sprintf("--conf=%s", confFile),
|
||||
fmt.Sprintf("--public-addr=%s", monitor.Endpoint))
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to start monitor %s: %v", monitor.Name, err)
|
||||
|
||||
@@ -454,13 +454,15 @@ func (a *osdAgent) runOSD(context *clusterd.Context, clusterName string, config
|
||||
// start the OSD daemon in the foreground with the given config
|
||||
logger.Infof("starting osd %d at %s", config.id, config.rootPath)
|
||||
|
||||
osdUUIDArg := fmt.Sprintf("--osd-uuid=%s", config.uuid.String())
|
||||
confFile := getOSDConfFilePath(config.rootPath, clusterName)
|
||||
util.WriteFileToLog(logger, confFile)
|
||||
|
||||
osdUUIDArg := fmt.Sprintf("--osd-uuid=%s", config.uuid.String())
|
||||
params := []string{"--foreground",
|
||||
fmt.Sprintf("--id=%d", config.id),
|
||||
fmt.Sprintf("--cluster=%s", clusterName),
|
||||
fmt.Sprintf("--osd-data=%s", config.rootPath),
|
||||
fmt.Sprintf("--conf=%s", getOSDConfFilePath(config.rootPath, clusterName)),
|
||||
fmt.Sprintf("--conf=%s", confFile),
|
||||
fmt.Sprintf("--keyring=%s", getOSDKeyringPath(config.rootPath)),
|
||||
osdUUIDArg,
|
||||
}
|
||||
|
||||
@@ -172,6 +172,10 @@ func (a *rgwAgent) startRGW(context *clusterd.Context, cluster *mon.ClusterInfo)
|
||||
// start the monitor daemon in the foreground with the given config
|
||||
logger.Infof("starting rgw")
|
||||
rgwNameArg := "--name=client.radosgw.gateway"
|
||||
|
||||
confFile := getRGWConfFilePath(context.ConfigDir, cluster.Name)
|
||||
util.WriteFileToLog(logger, confFile)
|
||||
|
||||
rgwProc, err := context.ProcMan.Start(
|
||||
"rgw",
|
||||
"rgw",
|
||||
@@ -180,7 +184,7 @@ func (a *rgwAgent) startRGW(context *clusterd.Context, cluster *mon.ClusterInfo)
|
||||
"--foreground",
|
||||
rgwNameArg,
|
||||
fmt.Sprintf("--cluster=%s", cluster.Name),
|
||||
fmt.Sprintf("--conf=%s", getRGWConfFilePath(context.ConfigDir, cluster.Name)),
|
||||
fmt.Sprintf("--conf=%s", confFile),
|
||||
fmt.Sprintf("--keyring=%s", getRGWKeyringPath(context.ConfigDir)),
|
||||
fmt.Sprintf("--rgw-frontends=civetweb port=%d", RGWPort),
|
||||
fmt.Sprintf("--rgw-mime-types-file=%s", getMimeTypesPath(context.ConfigDir)))
|
||||
|
||||
+15
-1
@@ -15,6 +15,20 @@ limitations under the License.
|
||||
*/
|
||||
package util
|
||||
|
||||
import "github.com/coreos/pkg/capnslog"
|
||||
import (
|
||||
"io/ioutil"
|
||||
|
||||
"github.com/coreos/pkg/capnslog"
|
||||
)
|
||||
|
||||
var logger = capnslog.NewPackageLogger("github.com/rook/rook", "util")
|
||||
|
||||
func WriteFileToLog(logger *capnslog.PackageLogger, path string) {
|
||||
contents, err := ioutil.ReadFile(path)
|
||||
if err != nil {
|
||||
logger.Warningf("failed to write file %s to log: %+v", path, err)
|
||||
return
|
||||
}
|
||||
|
||||
logger.Infof("Config file %s:\n%s", path, string(contents))
|
||||
}
|
||||
Reference in new issue
Block a user