mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-07 09:05:55 +00:00
creator can set GOMAXPROCS for remote pilosa nodes
This commit is contained in:
parent
9d5acdeecd
commit
0c6e6e4f44
2 changed files with 16 additions and 1 deletions
|
|
@ -985,6 +985,7 @@ type CreateCommand struct {
|
|||
ReplicaN int
|
||||
LogFilePrefix string
|
||||
Hosts []string
|
||||
GoMaxProcs int
|
||||
|
||||
SSHUser string
|
||||
|
||||
|
|
@ -1012,6 +1013,7 @@ func (cmd *CreateCommand) ParseFlags(args []string) error {
|
|||
fs.IntVar(&cmd.ReplicaN, "replicaN", 1, "")
|
||||
fs.StringVar(&cmd.LogFilePrefix, "log-file-prefix", "", "")
|
||||
var hosts string
|
||||
fs.IntVar(&cmd.GoMaxProcs, "gomaxprocs", 0, "")
|
||||
fs.StringVar(&hosts, "hosts", "", "")
|
||||
fs.StringVar(&cmd.SSHUser, "ssh-user", "", "")
|
||||
|
||||
|
|
@ -1052,6 +1054,11 @@ The following flags are allowed:
|
|||
|
||||
-ssh-user
|
||||
username to use when contacting remote hosts
|
||||
|
||||
-gomaxprocs
|
||||
when starting a cluster on remote hosts, this
|
||||
will set the value of GOMAXPROCS.
|
||||
|
||||
`)
|
||||
}
|
||||
|
||||
|
|
@ -1077,6 +1084,7 @@ func (cmd *CreateCommand) Run(ctx context.Context) error {
|
|||
ReplicaN: cmd.ReplicaN,
|
||||
SSHUser: cmd.SSHUser,
|
||||
Stderr: cmd.Stderr,
|
||||
GoMaxProcs: cmd.GoMaxProcs,
|
||||
}
|
||||
default:
|
||||
return fmt.Errorf("Unknown cluster type %v", cmd.Type)
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import (
|
|||
"fmt"
|
||||
"io"
|
||||
"net"
|
||||
"strconv"
|
||||
"sync"
|
||||
|
||||
"time"
|
||||
|
|
@ -20,6 +21,7 @@ type RemoteCluster struct {
|
|||
SSHUser string
|
||||
Keyfile string
|
||||
Key []byte
|
||||
GoMaxProcs int
|
||||
Stderr io.Writer
|
||||
wg *sync.WaitGroup
|
||||
logs []io.Reader
|
||||
|
|
@ -113,7 +115,12 @@ func (c *RemoteCluster) Start() error {
|
|||
c.pipeWs = append(c.pipeWs, pipeW)
|
||||
c.stdins = append(c.stdins, inpipe)
|
||||
|
||||
err = sess.Start("pilosa -config " + configname)
|
||||
gomaxprocsString := ""
|
||||
if c.GoMaxProcs != 0 {
|
||||
gomaxprocsString = "GOMAXPROCS=" + strconv.Itoa(c.GoMaxProcs) + " "
|
||||
}
|
||||
|
||||
err = sess.Start(gomaxprocsString + "pilosa -config " + configname)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue