Make the raft logging configurable
parent
60c98e519e
commit
f9b3a27345
|
@ -79,6 +79,8 @@ port = 8090
|
|||
# Where the raft logs are stored. The user running InfluxDB will need read/write access.
|
||||
dir = "/tmp/influxdb/development/raft"
|
||||
|
||||
debug = true
|
||||
|
||||
# election-timeout = "1s"
|
||||
|
||||
[storage]
|
||||
|
|
|
@ -94,6 +94,7 @@ type UdpInputConfig struct {
|
|||
type RaftConfig struct {
|
||||
Port int
|
||||
Dir string
|
||||
Debug bool
|
||||
Timeout duration `toml:"election-timeout"`
|
||||
}
|
||||
|
||||
|
@ -200,6 +201,7 @@ type Configuration struct {
|
|||
|
||||
RaftServerPort int
|
||||
RaftTimeout duration
|
||||
RaftDebug bool
|
||||
SeedServers []string
|
||||
DataDir string
|
||||
RaftDir string
|
||||
|
@ -349,6 +351,7 @@ func parseTomlConfiguration(filename string) (*Configuration, error) {
|
|||
RaftServerPort: tomlConfiguration.Raft.Port,
|
||||
RaftTimeout: tomlConfiguration.Raft.Timeout,
|
||||
RaftDir: tomlConfiguration.Raft.Dir,
|
||||
RaftDebug: tomlConfiguration.Raft.Debug,
|
||||
ProtobufPort: tomlConfiguration.Cluster.ProtobufPort,
|
||||
ProtobufTimeout: tomlConfiguration.Cluster.ProtobufTimeout,
|
||||
ProtobufHeartbeatInterval: tomlConfiguration.Cluster.ProtobufHeartbeatInterval,
|
||||
|
|
|
@ -56,7 +56,6 @@ var registeredCommands bool
|
|||
|
||||
// Creates a new server.
|
||||
func NewRaftServer(config *configuration.Configuration, clusterConfig *cluster.ClusterConfiguration) *RaftServer {
|
||||
// raft.SetLogLevel(raft.Debug)
|
||||
if !registeredCommands {
|
||||
registeredCommands = true
|
||||
for _, command := range internalRaftCommands {
|
||||
|
|
|
@ -12,6 +12,7 @@ import (
|
|||
"time"
|
||||
|
||||
log "code.google.com/p/log4go"
|
||||
"github.com/influxdb/influxdb/_vendor/raft"
|
||||
"github.com/influxdb/influxdb/configuration"
|
||||
"github.com/influxdb/influxdb/coordinator"
|
||||
"github.com/influxdb/influxdb/server"
|
||||
|
@ -117,6 +118,11 @@ func main() {
|
|||
|
||||
setupLogging(config.LogLevel, config.LogFile)
|
||||
|
||||
if config.RaftDebug {
|
||||
log.Info("Turning on raft debug logging")
|
||||
raft.SetLogLevel(raft.Trace)
|
||||
}
|
||||
|
||||
if *repairLeveldb {
|
||||
log.Info("Repairing leveldb")
|
||||
files, err := ioutil.ReadDir(config.DataDir)
|
||||
|
|
|
@ -47,6 +47,8 @@ port = 60501
|
|||
# Where the raft logs are stored. The user running InfluxDB will need read/write access.
|
||||
dir = "/tmp/influxdb/test/1/raft"
|
||||
|
||||
debug = true
|
||||
|
||||
[storage]
|
||||
dir = "/tmp/influxdb/test/1/db"
|
||||
|
||||
|
|
|
@ -31,6 +31,8 @@ port = 60507
|
|||
# Where the raft logs are stored. The user running InfluxDB will need read/write access.
|
||||
dir = "/tmp/influxdb/test/2/raft"
|
||||
|
||||
debug = true
|
||||
|
||||
[storage]
|
||||
dir = "/tmp/influxdb/test/2/db"
|
||||
|
||||
|
|
|
@ -31,6 +31,8 @@ port = 60511
|
|||
# Where the raft logs are stored. The user running InfluxDB will need read/write access.
|
||||
dir = "/tmp/influxdb/test/3/raft"
|
||||
|
||||
debug = true
|
||||
|
||||
[storage]
|
||||
dir = "/tmp/influxdb/test/3/db"
|
||||
|
||||
|
|
Loading…
Reference in New Issue