lijian il y a 4 ans
Parent
commit
bf3cae3890
2 fichiers modifiés avec 7 ajouts et 4 suppressions
  1. 4 1
      pkg/server/netif.go
  2. 3 3
      run.sh

+ 4 - 1
pkg/server/netif.go

@@ -73,8 +73,11 @@ func fixHostIp(address string) (*addr, error) {
 	if *confExIp != "" {
 		if strings.Contains(address, confExternalIP) {
 			in = strings.Replace(address, confExternalIP, "0.0.0.0", -1)
+			ex = strings.Replace(address, confExternalIP, *confExIp, -1)
+		} else if strings.Contains(address, confInternalIP) {
+			in = strings.Replace(address, confInternalIP, InternalIP, -1)
+			ex = in
 		}
-		ex = strings.Replace(address, confExternalIP, *confExIp, -1)
 	} else {
 		if strings.Contains(address, confInternalIP) {
 			in = strings.Replace(address, confInternalIP, InternalIP, -1)

+ 3 - 3
run.sh

@@ -1,5 +1,5 @@
 export GOPATH=/Users/lijian/go
-LEVEL="error"
+LEVEL="debug"
 sudo killall -9 httpaccess registry apiprovider devicemanager controller mqttaccess knowoapi fileaccess coapaccess
 
 # start services
@@ -8,9 +8,9 @@ $GOPATH/bin/httpaccess -etcd http://127.0.0.1:2379 -httphost internal:8088 -logl
 $GOPATH/bin/registry -etcd http://127.0.0.1:2379 -rpchost internal:20034 -aeskey ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP -dbhost 39.98.250.155 -dbname gxt-iot-db -dbport 3306 -dbuser root -dbpass gEkYDPloQcp93t4WHr3X -loglevel $LEVEL &
 $GOPATH/bin/apiprovider -etcd http://127.0.0.1:2379 -loglevel $LEVEL  -httphost internal:8888 &
 $GOPATH/bin/devicemanager -etcd http://127.0.0.1:2379 -loglevel $LEVEL  -rpchost internal:20033 &
-$GOPATH/bin/controller -etcd http://127.0.0.1:2379 -loglevel $LEVEL  -rpchost internal:20032 &
+$GOPATH/bin/controller -etcd http://127.0.0.1:2379 -loglevel $LEVEL  -rpchost internal:20032  &
 #$GOPATH/bin/mqttaccess -etcd http://localhost:2379 -loglevel debug  -rpchost localhost:20030 -tcphost internal:1883 -usetls -keyfile $GOPATH/src/github.com/PandoCloud/pando-cloud/pkg/server/testdata/key.pem -cafile $GOPATH/src/github.com/PandoCloud/pando-cloud/pkg/server/testdata/cert.pem &
-$GOPATH/bin/mqttaccess -etcd http://127.0.0.1:2379 -loglevel $LEVEL  -rpchost internal:20030 -tcphost internal:1883  &
+$GOPATH/bin/mqttaccess -etcd http://127.0.0.1:2379 -loglevel $LEVEL  -rpchost internal:20030 -tcphost external:1883 -external 192.168.1.100  &
 $GOPATH/bin/knowoapi -etcd http://127.0.0.1:2379 -loglevel $LEVEL  -httphost internal:8889 -dbhost 39.98.250.155 -dbname gxt-iot-db -dbport 3306 -dbuser root -dbpass gEkYDPloQcp93t4WHr3X -aeskey ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP &
 $GOPATH/bin/fileaccess -etcd http://127.0.0.1:2379 -loglevel $LEVEL  -rpchost internal:20035 -httphost internal:9000 &
 $GOPATH/bin/coapaccess -etcd http://127.0.0.1:2379 -loglevel $LEVEL  -udphost internal:56883 &