问题描述:

Is it possible to open a port for hazelcast on openshift? No matter what port I try, I get the same exception:

SocketException: Permission denied

I am not trying to open the port to the world. I just want to open a port so the gears can use Hazelcast. It seems like this should be possible.

网友答案:

You're probably have to use a HTTP tunnel to connect Hazelcast, not a nice solution but I prototyped it some time ago: https://github.com/noctarius/https-tunnel-openshift-hazelcast

Anyhow gears should be openshift V2, isn't it? Never tried it with V2, if you get the chance, there's support for V3 (and V3.1) - http://blog.hazelcast.com/openshift/

网友答案:

What cartridge type do you use?

You can bind to any port from 15000 to 35530 internally, but other gears won't be able to access it.

From my experience - I had to open the public proxy port for other members of the cluster to join.

For example, Vert.x cartridge uses Hazelcast for clustering and has some additional public proxy ports open (see https://github.com/vert-x/openshift-cartridge/blob/master/metadata/manifest.yml).

Endpoints:
  - Private-IP-Name:   IP
    Private-Port-Name: PORT
    Private-Port:      8080
    Public-Port-Name:  PROXY_PORT
    Mappings:
      - Frontend:      ""
        Backend:       ""
        Options:       { "websocket": 1}
  - Private-IP-Name:   IP
    Private-Port-Name: HAZELCAST_PORT
    Private-Port:      5701
    Public-Port-Name:  HAZELCAST_PROXY_PORT
  - Private-IP-Name:   IP
    Private-Port-Name: CLUSTER_PORT
    Private-Port:      9123
    Public-Port-Name:  CLUSTER_PROXY_PORT

(see https://access.redhat.com/documentation/en-US/OpenShift_Online/2.0/html/Cartridge_Specification_Guide/chap-Exposing_Services.html).

网友答案:

On OpenShift, you should only bind websockets to either port 8000 or 8443.

See:

  • https://developers.openshift.com/en/managing-port-binding-routing.html
  • https://blog.openshift.com/paas-websockets/
相关阅读:
Top