diff options
| author | Chris Lu <chrislusf@users.noreply.github.com> | 2020-05-17 17:39:16 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-17 17:39:16 -0700 |
| commit | e0e31e67a809d00c99edaa299531c7ce4d4750dc (patch) | |
| tree | 0f890277ef14c748faed4fecb7f8b8d4edeb9849 /weed/command | |
| parent | b4e02ec525a6ec87b26686202307896faf3296a7 (diff) | |
| parent | 081ee6fe349b519da8ea54cf3cdc17d2b15c5a71 (diff) | |
| download | seaweedfs-e0e31e67a809d00c99edaa299531c7ce4d4750dc.tar.xz seaweedfs-e0e31e67a809d00c99edaa299531c7ce4d4750dc.zip | |
Merge pull request #1318 from chrislusf/msg_channel
Add messaging, add channel
Diffstat (limited to 'weed/command')
| -rw-r--r-- | weed/command/benchmark.go | 2 | ||||
| -rw-r--r-- | weed/command/filer_copy.go | 2 | ||||
| -rw-r--r-- | weed/command/msg_broker.go | 8 |
3 files changed, 8 insertions, 4 deletions
diff --git a/weed/command/benchmark.go b/weed/command/benchmark.go index 5b2e31622..ee21914b3 100644 --- a/weed/command/benchmark.go +++ b/weed/command/benchmark.go @@ -232,7 +232,7 @@ func writeFiles(idChan chan int, fileIdLineChan chan string, s *stat) { Reader: &FakeReader{id: uint64(id), size: fileSize, random: random}, FileSize: fileSize, MimeType: "image/bench", // prevent gzip benchmark content - Fsync: *b.fsync, + Fsync: *b.fsync, } ar := &operation.VolumeAssignRequest{ Count: 1, diff --git a/weed/command/filer_copy.go b/weed/command/filer_copy.go index 322ab20d5..2d6ba94d6 100644 --- a/weed/command/filer_copy.go +++ b/weed/command/filer_copy.go @@ -428,7 +428,7 @@ func (worker *FileCopyWorker) uploadFileInChunks(task FileCopyTask, f *os.File, uploadError = fmt.Errorf("upload %v to %s result: %v\n", fileName, targetUrl, uploadResult.Error) return } - chunksChan <- uploadResult.ToPbFileChunk(assignResult.FileId, i * chunkSize) + chunksChan <- uploadResult.ToPbFileChunk(assignResult.FileId, i*chunkSize) fmt.Printf("uploaded %s-%d to %s [%d,%d)\n", fileName, i+1, targetUrl, i*chunkSize, i*chunkSize+int64(uploadResult.Size)) }(i) diff --git a/weed/command/msg_broker.go b/weed/command/msg_broker.go index 984497c2e..bab1083ab 100644 --- a/weed/command/msg_broker.go +++ b/weed/command/msg_broker.go @@ -6,9 +6,10 @@ import ( "strconv" "time" - "github.com/chrislusf/seaweedfs/weed/util/grace" "google.golang.org/grpc/reflection" + "github.com/chrislusf/seaweedfs/weed/util/grace" + "github.com/chrislusf/seaweedfs/weed/glog" "github.com/chrislusf/seaweedfs/weed/messaging/broker" "github.com/chrislusf/seaweedfs/weed/pb" @@ -24,6 +25,7 @@ var ( type QueueOptions struct { filer *string + ip *string port *int cpuprofile *string memprofile *string @@ -32,7 +34,8 @@ type QueueOptions struct { func init() { cmdMsgBroker.Run = runMsgBroker // break init cycle messageBrokerStandaloneOptions.filer = cmdMsgBroker.Flag.String("filer", "localhost:8888", "filer server address") - messageBrokerStandaloneOptions.port = cmdMsgBroker.Flag.Int("port", 17777, "queue server gRPC listen port") + messageBrokerStandaloneOptions.ip = cmdMsgBroker.Flag.String("ip", util.DetectedHostAddress(), "broker host address") + messageBrokerStandaloneOptions.port = cmdMsgBroker.Flag.Int("port", 17777, "broker gRPC listen port") messageBrokerStandaloneOptions.cpuprofile = cmdMsgBroker.Flag.String("cpuprofile", "", "cpu profile output file") messageBrokerStandaloneOptions.memprofile = cmdMsgBroker.Flag.String("memprofile", "", "memory profile output file") } @@ -91,6 +94,7 @@ func (msgBrokerOpt *QueueOptions) startQueueServer() bool { Filers: []string{*msgBrokerOpt.filer}, DefaultReplication: "", MaxMB: 0, + Ip: *msgBrokerOpt.ip, Port: *msgBrokerOpt.port, Cipher: cipher, }, grpcDialOption) |
