Page MenuHomeDevCentral

Troubleshoot Openfire Docker image
Open, NormalPublic

Description

Hi,

I have run the Openfire using the docker file but the application is running or not. Not able to access the application from web.

I checked the ports are also not running.

Please help to resolve the issue.

Event Timeline

Giri512 triaged this task as High priority.Mar 8 2022, 07:12
Giri512 created this task.
dereckson renamed this task from Openfire to Troubleshoot Openfire Docker image.Mar 8 2022, 23:12

Hi,

How do you run the Docker image?

For reference, we deploy it through Salt with the following configuration:

paas-docker/containers/openfire.sls
     {{ instance }}:
	  docker_container.running:
	    - detach: True
	    - interactive: True
	    - image: nasqueron/openfire
	    - binds: /srv/{{ instance }}:/var/lib/openfire
	    - hostname: {{ container['host'] }}
	    - ports: {{ pillar['xmpp_ports'] }}
	    - port_bindings:
	{% for port in pillar['xmpp_ports'] %}
	      - {{ container['ip'] }}:{{ port }}:{{ port }}
	{% endfor %}

Meanwhile, the image readme suggests:

$ docker run --name openfire -d --restart=always \
    --publish 9090:9090 --publish 5222:5222 --publish 7777:7777 \
    --volume /srv/docker/openfire:/var/lib/openfire \
    nasqueron/openfire:4.7.1

If you used that command, your webserver should listen to the port 9090 and clients should use port 5222.
Both are the standard ports. You're good!

With docker ps you can check the ports currently listened. You should have 9090->9090 (not only 9090) and
5222->5222 if you've bind correctly the ports.

Then, you can check if you can connect locally:

$ nc -zv localhost 9090
Ncat: Version 7.70 ( https://nmap.org/ncat )
Ncat: Connected to 51.255.124.9:9090.
Ncat: 0 bytes sent, 0 bytes received in 0.07 seconds.

(if you bind to a specific external IP, use that IP instead)

Ports

There are indeed a bunch of ports for XMPP to open, depending of your use case:
https://devcentral.nasqueron.org/source/operations/browse/main/pillar/paas/docker.sls$498
I see the 3478 isn't documented, it's the STUN port, to help connections to the XMPP server when there is a need to traverse a NAT.

By default, the image exposes the following ports: https://devcentral.nasqueron.org/source/docker-openfire/browse/main/Dockerfile$21 (both list should be similar).

@Giri512 How things are going on? Did you deploy your XMPP server? Still need help on that issue or any other?

dereckson lowered the priority of this task from High to Normal.Mar 10 2022, 23:29
dereckson claimed this task.

I hope those ports elements can help you to debug and run your server.

If you've further questions, don't hesitate to reopen this it will be a pleasure to further assist you.

dereckson changed the task status from Spite to Resolved.Mar 11 2022, 10:49

Sorry, i missed your messages.

Still, i'm not able to run. if possible can we connect and check.

I'm running the same docker file as given below in centos 7.

https://hub.docker.com/r/nasqueron/openfire/dockerfile

The steps I did,

  1. I have taken the docker file from the above link and created a repo. In a repo, created Dockerfile, deployment files.
  2. Deployed to Kubernetes cluster and applied ingress.
  3. But we have seen that the ports are not opening and are not able to access the Openfire dashboard.

Please help any modifications need to do and how to expose all the ports in ingress files.

So Kubernetes have two notions:

  • a pod, which can be one or several containers (here there will be one for Openfire normally)
  • a service, which is a layer to access that pod from the external world

You've to define the ports in the YAML configuration of your Kubernetes deployment.

For example at https://docs.docker.com/get-started/kube-deploy/ you've this part of the YAML config to define the service:

---
apiVersion: v1
kind: Service
metadata:
  name: bb-entrypoint
  namespace: default
spec:
  type: NodePort
  selector:
    bb: web
  ports:
  - port: 3000
    targetPort: 3000
    nodePort: 30001

That's probably what's missing in your current Kubernetes deployment.

Ah, and I've found one example of configuration for Openfire here: http://ecimio.com/posts/k8s-openfire/

Hi,

Below is my YAML file:

apiVersion: extensions/v1beta1
kind: Ingress
metadata:

annotations:
  nginx.ingress.kubernetes.io/proxy-body-size: "100m"
  nginx.ingress.kubernetes.io/auth-tls-verify-client: \"on\"
  nginx.ingress.kubernetes.io/auth-tls-secret: \"dev/dev-ssl-tls\"
  nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
  kubernetes.io/ingress.class: "nginx"
  nginx.org/proxy-connect-timeout: "180s"
  nginx.ingress.kubernetes.io/proxy-read-timeout: "3600s"
  nginx.ingress.kubernetes.io/proxy-send-timeout: "3600s"
  nginx.ingress.kubernetes.io/proxy-connect-timeout: "3600s"
name: openfire-ing
namespace: dev

spec:

rules:
- host: openfire-dev.net
  http:
    paths:
    - path: /
      backend:
        serviceName: openfire
        servicePort: 9090
    - path: /
      backend:
        serviceName: openfire
        servicePort: 9091

tls:
- hosts:
  -openfire-dev.net
  secretName: dev-ssl-tls

Pls let me know, if I miss anything.

Look at the sample I posted a port definition:

ports:
- port: 3000
  targetPort: 3000
  nodePort: 30001

That's a NodePort spec definition, you don't have that.

Try to create one file from the ports part of http://ecimio.com/posts/k8s-openfire/