我有一个基于 docker 1.12.1 群集模式的群集群集。 有3个主节点和3个工作节点。我在集群上运行了node.js / express服务。
该服务有5个副本和公共端口8082。 但是当我尝试访问它时,如果提供静态文件则失败。
我使用curl
从服务中获取一个静态样式脚本作为示例。
[root@i1-proxy ~]# time curl -v 192.168.100.3:8082/dist/style.css
* About to connect() to 192.168.100.3 port 8082 (#0)
* Trying 192.168.100.3...
* Connected to 192.168.100.3 (192.168.100.3) port 8082 (#0)
> GET /dist/style.css HTTP/1.1
> User-Agent: curl/7.29.0
> Host: 192.168.100.3:8082
> Accept: */*
>
< HTTP/1.1 200 OK
< X-Powered-By: Express
< Accept-Ranges: bytes
< Cache-Control: public, max-age=0
< Last-Modified: Fri, 02 Sep 2016 02:09:20 GMT
< ETag: W/"106e1-156e8a85080"
< Content-Type: text/css; charset=UTF-8
< Content-Length: 67297
< Date: Mon, 05 Sep 2016 02:50:14 GMT
< Connection: keep-alive
<
* Recv failure: Connection reset by peer
* Closing connection 0
curl: (56) Recv failure: Connection reset by peer
real 4m0.657s
user 0m0.019s
sys 0m0.012s
它返回HTTP标头但没有HTTP主体。
添加:
Containers: 1 Running: 1 Paused: 0 Stopped: 0 Images: 12 Server Version: 1.12.1 Storage Driver: aufs Root Dir: /var/lib/docker/aufs Backing Filesystem: extfs Dirs: 59 Dirperm1 Supported: true Logging Driver: json-file Cgroup Driver: cgroupfs Plugins: Volume: local Network: bridge overlay null host Swarm: active NodeID: 99wq9cba397bps7578fxqijq1 Is Manager: true ClusterID: 73oimnw1q8zh9caof3gk6sutw Managers: 3 Nodes: 6 Orchestration: Task History Retention Limit: 5 Raft: Snapshot Interval: 10000 Heartbeat Tick: 1 Election Tick: 3 Dispatcher: Heartbeat Period: 5 seconds CA Configuration: Expiry Duration: 3 months Node Address: 192.168.100.3 Runtimes: runc Default Runtime: runc Security Options: seccomp Kernel Version: 4.4.0-34-generic Operating System: Ubuntu 16.04.1 LTS OSType: linux Architecture: x86_64 CPUs: 4 Total Memory: 7.796 GiB Name: i-yyk6gta5 ID: VXWN:I4AA:EIY7:4NKF:OQJW:GLIJ:43TJ:L6FO:RQB4:Z4L2:6A7D:EGIP Docker Root Dir: /var/lib/docker Debug Mode (client): false Debug Mode (server): false Registry: https://index.docker.io/v1/ WARNING: No swap limit support Insecure Registries: 127.0.0.0/8
和泊坞版
Client: Version: 1.12.1 API version: 1.24 Go version: go1.6.3 Git commit: 23cf638 Built: Thu Aug 18 05:33:38 2016 OS/Arch: linux/amd64 Server: Version: 1.12.1 API version: 1.24 Go version: go1.6.3 Git commit: 23cf638 Built: Thu Aug 18 05:33:38 2016 OS/Arch: linux/amd64