-
Notifications
You must be signed in to change notification settings - Fork 35
Why random external port does not work? #6
Comments
Ho, and I guessed it was some IPv6 missbinding joke... but in fact no: $ docker exec -it eventstore netstat -nptl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:1113 0.0.0.0:* LISTEN 1/eventstored
tcp 0 0 0.0.0.0:2113 0.0.0.0:* LISTEN 1/eventstored So looks like it's not either docker or Linux tcp/ip fault, there's something special in the way eventstored bind its ports? |
Hi Could you please curl the node's stats url and see if that works?
|
The reason I ask you to do this is because the url you are trying to open is for the admin UI, which does not work when the ports between docker and the host don't match up. This is because the UI redirects you to the external-http port that's set in configuration (2113 by default) when you try to open it from a different port. |
@hayley-jean yes in fact I'm redirected if point to curl -i "http://"$(docker-machine ip)":"$(docker inspect --type container --format '{{ (index (index .NetworkSettings.Ports "2113/tcp") 0).HostPort }}' eventstore)"/" 18:30:53 default
HTTP/1.1 302 Found
Access-Control-Allow-Methods: GET, OPTIONS
Access-Control-Allow-Headers: Content-Type, X-Requested-With, X-Forwarded-Host, X-PINGOTHER, Authorization, ES-LongPoll, ES-ExpectedVersion, ES-EventId, ES-EventType, ES-RequiresMaster, ES-HardDelete, ES-ResolveLinkTo, ES-ExpectedVersion
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: Location, ES-Position
Location: http://192.168.99.100:2113/web/index.html
Content-Type: text/plain; charset=utf-8
Server: Mono-HTTPAPI/1.0
Date: Fri, 08 Apr 2016 16:31:00 GMT
Content-Length: 5
Keep-Alive: timeout=15,max=100
Moved
curl -i "http://"$(docker-machine ip)":"$(docker inspect --type container --format '{{ (index (index .NetworkSettings.Ports "2113/tcp") 0).HostPort }}' eventstore)"/stats"
HTTP/1.1 200 OK
Access-Control-Allow-Methods: GET, OPTIONS
Access-Control-Allow-Headers: Content-Type, X-Requested-With, X-Forwarded-Host, X-PINGOTHER, Authorization, ES-LongPoll, ES-ExpectedVersion, ES-EventId, ES-EventType, ES-RequiresMaster, ES-HardDelete, ES-ResolveLinkTo, ES-ExpectedVersion
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: Location, ES-Position
Cache-Control: max-age=1, public
Vary: Accept
Content-Type: application/json; charset=utf-8
Server: Mono-HTTPAPI/1.0
Date: Fri, 08 Apr 2016 16:33:04 GMT
Content-Length: 12024
Keep-Alive: timeout=15,max=100
{
"proc": {
"startTime": "2016-04-08T13:23:57.0000000Z",
"id": 1,
"mem": 99536896,
"cpu": 0.0,
"cpuScaled": 0.0,
"threadsCount": 0,
"contentionsRate": 0.0,
"thrownExceptionsRate": 0.0,
"tcp": {
"connections": 0,
"receivingSpeed": 0.0,
"sendingSpeed": 0.0,
"inSend": 0,
"measureTime": "00:00:18.1100800",
"pendingReceived": 0,
"pendingSend": 0,
"receivedBytesSinceLastRun": 0,
"receivedBytesTotal": 0,
"sentBytesSinceLastRun": 0,
"sentBytesTotal": 0
},
"gc": {
"allocationSpeed": 0.0,
"gen0ItemsCount": 0,
"gen0Size": 0,
"gen1ItemsCount": 0,
"gen1Size": 0,
"gen2ItemsCount": 0,
"gen2Size": 0,
"largeHeapSize": 0,
"timeInGc": 0.0,
"totalBytesInHeaps": 0
}
},
"sys": {
"cpu": 7.55379,
"freeMem": 150528000,
"drive": {
"/var/lib/eventstore": {
"availableBytes": 15569285120,
"totalBytes": 19507089408,
"usage": "20%",
"usedBytes": 3937804288
}
}
},
"es": {
"checksum": 4165457,
"checksumNonFlushed": 4165457,
"queue": {
"mainQueue": {
"queueName": "MainQueue",
"groupName": "",
"avgItemsPerSecond": 13,
"avgProcessingTime": 0.02513125,
"currentIdleTime": "0:00:00:00.6394198",
"currentItemProcessingTime": null,
"idleTimePercent": 99.966651049282476,
"length": 0,
"lengthCurrentTryPeak": 3,
"lengthLifetimePeak": 10,
"totalItemsProcessed": 101475,
"inProgressMessage": "<none>",
"lastProcessedMessage": "Schedule"
},
"monitoringQueue": {
"queueName": "MonitoringQueue",
"groupName": "",
"avgItemsPerSecond": 0,
"avgProcessingTime": 0.0,
"currentIdleTime": null,
"currentItemProcessingTime": "0:00:00:00.3030952",
"idleTimePercent": 98.324564313484274,
"length": 0,
"lengthCurrentTryPeak": 0,
"lengthLifetimePeak": 2,
"totalItemsProcessed": 14,
"inProgressMessage": "GetFreshStats",
"lastProcessedMessage": "GetFreshStats"
},
"projection Core #0": {
"queueName": "Projection Core #0",
"groupName": "Projection Core",
"avgItemsPerSecond": 0,
"avgProcessingTime": 0.20747142857142856,
"currentIdleTime": "0:00:00:18.0755544",
"currentItemProcessingTime": null,
"idleTimePercent": 99.99197259289987,
"length": 0,
"lengthCurrentTryPeak": 2,
"lengthLifetimePeak": 9,
"totalItemsProcessed": 2104,
"inProgressMessage": "<none>",
"lastProcessedMessage": "EventReaderIdle"
},
"projection Core #1": {
"queueName": "Projection Core #1",
"groupName": "Projection Core",
"avgItemsPerSecond": 0,
"avgProcessingTime": 0.072628571428571417,
"currentIdleTime": "0:00:00:18.0751062",
"currentItemProcessingTime": null,
"idleTimePercent": 99.997189688906687,
"length": 0,
"lengthCurrentTryPeak": 1,
"lengthLifetimePeak": 9,
"totalItemsProcessed": 2079,
"inProgressMessage": "<none>",
"lastProcessedMessage": "EventReaderIdle"
},
"projection Core #2": {
"queueName": "Projection Core #2",
"groupName": "Projection Core",
"avgItemsPerSecond": 0,
"avgProcessingTime": 0.15348571428571428,
"currentIdleTime": "0:00:00:18.0755387",
"currentItemProcessingTime": null,
"idleTimePercent": 99.994061531882664,
"length": 0,
"lengthCurrentTryPeak": 2,
"lengthLifetimePeak": 9,
"totalItemsProcessed": 2072,
"inProgressMessage": "<none>",
"lastProcessedMessage": "EventReaderIdle"
},
"projections Master": {
"queueName": "Projections Master",
"groupName": "",
"avgItemsPerSecond": 19,
"avgProcessingTime": 0.014503072625698324,
"currentIdleTime": "0:00:00:00.0764715",
"currentItemProcessingTime": null,
"idleTimePercent": 99.971274463595137,
"length": 0,
"lengthCurrentTryPeak": 0,
"lengthLifetimePeak": 9,
"totalItemsProcessed": 154393,
"inProgressMessage": "<none>",
"lastProcessedMessage": "Schedule"
},
"storage Chaser": {
"queueName": "Storage Chaser",
"groupName": "",
"avgItemsPerSecond": 10,
"avgProcessingTime": 0.018446448087431695,
"currentIdleTime": "0:00:00:00.0075074",
"currentItemProcessingTime": null,
"idleTimePercent": 99.981837452479752,
"length": 0,
"lengthCurrentTryPeak": 0,
"lengthLifetimePeak": 0,
"totalItemsProcessed": 78213,
"inProgressMessage": "<none>",
"lastProcessedMessage": "ChaserCheckpointFlush"
},
"storageReaderQueue #1": {
"queueName": "StorageReaderQueue #1",
"groupName": "StorageReaderQueue",
"avgItemsPerSecond": 0,
"avgProcessingTime": 0.088885714285714276,
"currentIdleTime": "0:00:00:00.6395203",
"currentItemProcessingTime": null,
"idleTimePercent": 99.996562288594433,
"length": 0,
"lengthCurrentTryPeak": 0,
"lengthLifetimePeak": 0,
"totalItemsProcessed": 2462,
"inProgressMessage": "<none>",
"lastProcessedMessage": "ReadStreamEventsForward"
},
"storageReaderQueue #2": {
"queueName": "StorageReaderQueue #2",
"groupName": "StorageReaderQueue",
"avgItemsPerSecond": 0,
"avgProcessingTime": 0.067566666666666664,
"currentIdleTime": "0:00:00:03.6460471",
"currentItemProcessingTime": null,
"idleTimePercent": 99.997760706065137,
"length": 0,
"lengthCurrentTryPeak": 0,
"lengthLifetimePeak": 1,
"totalItemsProcessed": 2461,
"inProgressMessage": "<none>",
"lastProcessedMessage": "ReadStreamEventsForward"
},
"storageReaderQueue #3": {
"queueName": "StorageReaderQueue #3",
"groupName": "StorageReaderQueue",
"avgItemsPerSecond": 0,
"avgProcessingTime": 0.17368333333333333,
"currentIdleTime": "0:00:00:02.6424068",
"currentItemProcessingTime": null,
"idleTimePercent": 99.994241736532615,
"length": 0,
"lengthCurrentTryPeak": 0,
"lengthLifetimePeak": 0,
"totalItemsProcessed": 2461,
"inProgressMessage": "<none>",
"lastProcessedMessage": "ReadStreamEventsForward"
},
"storageReaderQueue #4": {
"queueName": "StorageReaderQueue #4",
"groupName": "StorageReaderQueue",
"avgItemsPerSecond": 0,
"avgProcessingTime": 0.13745,
"currentIdleTime": "0:00:00:01.6407077",
"currentItemProcessingTime": null,
"idleTimePercent": 99.995442365144612,
"length": 0,
"lengthCurrentTryPeak": 0,
"lengthLifetimePeak": 1,
"totalItemsProcessed": 2461,
"inProgressMessage": "<none>",
"lastProcessedMessage": "ReadStreamEventsForward"
},
"storageWriterQueue": {
"queueName": "StorageWriterQueue",
"groupName": "",
"avgItemsPerSecond": 0,
"avgProcessingTime": 11.0902,
"currentIdleTime": "0:00:00:18.0779318",
"currentItemProcessingTime": null,
"idleTimePercent": 99.93869607995974,
"length": 0,
"lengthCurrentTryPeak": 0,
"lengthLifetimePeak": 2,
"totalItemsProcessed": 313,
"inProgressMessage": "<none>",
"lastProcessedMessage": "WritePrepares"
},
"subscriptions": {
"queueName": "Subscriptions",
"groupName": "",
"avgItemsPerSecond": 1,
"avgProcessingTime": 0.013905263157894737,
"currentIdleTime": "0:00:00:00.8139527",
"currentItemProcessingTime": null,
"idleTimePercent": 99.99854398905893,
"length": 0,
"lengthCurrentTryPeak": 0,
"lengthLifetimePeak": 6,
"totalItemsProcessed": 8115,
"inProgressMessage": "<none>",
"lastProcessedMessage": "CheckPollTimeout"
},
"timer": {
"queueName": "Timer",
"groupName": "",
"avgItemsPerSecond": 32,
"avgProcessingTime": 0.13935670103092782,
"currentIdleTime": "0:00:00:00.0006571",
"currentItemProcessingTime": null,
"idleTimePercent": 99.547836739471208,
"length": 9,
"lengthCurrentTryPeak": 9,
"lengthLifetimePeak": 10,
"totalItemsProcessed": 250885,
"inProgressMessage": "<none>",
"lastProcessedMessage": "ExecuteScheduledTasks"
},
"worker #1": {
"queueName": "Worker #1",
"groupName": "Workers",
"avgItemsPerSecond": 1,
"avgProcessingTime": 0.029969230769230769,
"currentIdleTime": "0:00:00:00.3031109",
"currentItemProcessingTime": null,
"idleTimePercent": 99.995690561414648,
"length": 0,
"lengthCurrentTryPeak": 0,
"lengthLifetimePeak": 1,
"totalItemsProcessed": 10915,
"inProgressMessage": "<none>",
"lastProcessedMessage": "AuthenticatedHttpRequestMessage"
},
"worker #2": {
"queueName": "Worker #2",
"groupName": "Workers",
"avgItemsPerSecond": 1,
"avgProcessingTime": 0.0192,
"currentIdleTime": "0:00:00:00.9969058",
"currentItemProcessingTime": null,
"idleTimePercent": 99.997314063399315,
"length": 0,
"lengthCurrentTryPeak": 0,
"lengthLifetimePeak": 1,
"totalItemsProcessed": 10915,
"inProgressMessage": "<none>",
"lastProcessedMessage": "PurgeTimedOutRequests"
},
"worker #3": {
"queueName": "Worker #3",
"groupName": "Workers",
"avgItemsPerSecond": 1,
"avgProcessingTime": 0.012428,
"currentIdleTime": "0:00:00:00.6398037",
"currentItemProcessingTime": null,
"idleTimePercent": 99.998273681845816,
"length": 0,
"lengthCurrentTryPeak": 0,
"lengthLifetimePeak": 1,
"totalItemsProcessed": 10915,
"inProgressMessage": "<none>",
"lastProcessedMessage": "IODispatcherDelayedMessage"
},
"worker #4": {
"queueName": "Worker #4",
"groupName": "Workers",
"avgItemsPerSecond": 1,
"avgProcessingTime": 0.015911538461538463,
"currentIdleTime": "0:00:00:00.6395140",
"currentItemProcessingTime": null,
"idleTimePercent": 99.997722564549079,
"length": 0,
"lengthCurrentTryPeak": 0,
"lengthLifetimePeak": 1,
"totalItemsProcessed": 10914,
"inProgressMessage": "<none>",
"lastProcessedMessage": "ReadStreamEventsForwardCompleted"
},
"worker #5": {
"queueName": "Worker #5",
"groupName": "Workers",
"avgItemsPerSecond": 1,
"avgProcessingTime": 0.012361538461538462,
"currentIdleTime": "0:00:00:00.3032140",
"currentItemProcessingTime": null,
"idleTimePercent": 99.998224484779428,
"length": 0,
"lengthCurrentTryPeak": 0,
"lengthLifetimePeak": 1,
"totalItemsProcessed": 10914,
"inProgressMessage": "<none>",
"lastProcessedMessage": "IncomingHttpRequestMessage"
}
},
"writer": {
"lastFlushSize": 16066,
"lastFlushDelayMs": 10.9045,
"meanFlushSize": 14167,
"meanFlushDelayMs": 9.8155105442176875,
"maxFlushSize": 16179,
"maxFlushDelayMs": 91.0055,
"queuedFlushMessages": 0
},
"readIndex": {
"cachedRecord": 1300,
"notCachedRecord": 0,
"cachedStreamInfo": 27542,
"notCachedStreamInfo": 78,
"cachedTransInfo": 0,
"notCachedTransInfo": 0
}
}
} |
@shouze Thanks for checking that, that's what I expected. The admin UI will not work when the ports are not the same. Atom feeds won't work either, as any links returned by ES will use port 2113, not the port you are binding to. For an example of this, you can try
In short, while it still works with dynamically assigned ports, you are better off making sure that the ports you bind to match the ones EventStore is using. I will add a note about this in the readme on docker-hub |
This could likely be supported by adding an override to the port On Mon, Apr 11, 2016 at 9:58 AM, Hayley Campbell notifications@github.com
Studying for the Turing test |
@gregoryyoung yes, for that we have to resolve at runtime just before eventstore start the port attributed dynamically by docker, it should come from the outside of the container, passed as an env var. I'm not sure though this is so easy in docker, this is not the business of the containerised binary to know how port are mapped outside by design. |
@gregoryyoung Do you mean that I could (correctly) use settings of ExtIp, ExtHttpPort, ExtTcpPort to make this scenario work? |
see adevrtise as.
…On Thu, Mar 23, 2017 at 5:42 PM, Dave Smith ***@***.***> wrote:
@gregoryyoung <https://github.com/gregoryyoung> Do you mean that I could
(correctly) use settings of ExtIp, ExtHttpPort, ExtTcpPort to make this
scenario work?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#6 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAXRWsSLBK_MOCqEHBD5TBdUsj9mmxuXks5roq78gaJpZM4IDALD>
.
--
Studying for the Turing test
|
As in use the *_ADVERTISE_AS settings in addition to the ones I mentioned above so that gossip is also corrected along with the UI and Feeds? |
Hello, This issue has been close due to management of Docker builds moving to EventStore/EventStore, and this repository is due to be archived. If you are still experiencing this issue, please re-open this issue in the new repository. Thank you. |
If I run event store that way:
instead of:
TCP & HTTP ports will be dynamically attributed by docker, but if I then open the url:
The connection can't be established!
The text was updated successfully, but these errors were encountered: