无法连接到 Portainer 社区版

huangapple go评论104阅读模式
英文:

No connection to portainer community edition

问题

I try to install portainer via the docker image:

  • Portainer BE
docker run -d -p 8000:8000 -p 443:9443 --name portainer-be --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ee:latest

I can connect to https://myhost and see portainer

docker stop d31b6a21fc60
d31b6a21fc60
root@myhost:~# docker run -d -p 8000:8000 -p 9443:9443 --name portainer-ce --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest

I can not connect to https://myhost and see portainer. Just as if portainer would not run.

What might I have done wrong?

Docker version 23.0.1, build a5ee5b1
Ubuntu 22.04.2 LTS
Latest Portainer as of Feb 23, 2023

英文:

I try to install portainer via the docker image:

  • Portainer BE
 docker run -d -p 8000:8000 -p 443:9443 --name portainer-be --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ee:latest
docker ps
CONTAINER ID   IMAGE                           COMMAND        CREATED          STATUS          PORTS                                                                                          NAMES
d31b6a21fc60   portainer/portainer-ee:latest   "/portainer"   43 seconds ago   Up 42 seconds   0.0.0.0:8000->8000/tcp, :::8000->8000/tcp, 9000/tcp, 0.0.0.0:443->9443/tcp, :::443->9443/tcp   portainer-be

I can connect to https://myhost and see portainer

docker stop d31b6a21fc60
d31b6a21fc60
root@myhost:~# docker run -d -p 8000:8000 -p 9443:9443 --name portainer-ce --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest
docker ps
CONTAINER ID   IMAGE                           COMMAND        CREATED          STATUS                        PORTS     NAMES
7bf0d60a8f47   portainer/portainer-ce:latest   "/portainer"   32 seconds ago   Restarting (1) 1 second ago             portainer-ce

I can not connect to https://myhost and see portainer. Just as if portainer would not run.

What might I have done wrong?

Docker version 23.0.1, build a5ee5b1
Ubuntu 22.04.2 LTS
Latest Portainer as of feb 23 2023

答案1

得分: 0

根据我所看到的情况,你安装了两个 Portainer 容器,是并行安装的吗?

尽管如此,如果你至少安装了其中一个,你应该能够通过输入 https://localhost:9443 连接。9443 是你的虚拟机/服务器的预定义端口。如果你想访问位于不在你的计算机上的容器(例如通过 VirtualBox),你可以将 localhost 替换为服务器的IP地址,以防 myhost 确实不起作用。

警告:端口

你应该知道你已经同时安装了商业版(portainer-ee)和社区版(portainer-ce),它们使用相同的端口。也许你应该首先将其中一个默认的端口更改为另一个端口。我建议使用你喜爱的搜索引擎来获取有关哪个端口未被未来可能安装的任何其他服务使用的信息。

你可以通过输入 netstat -plant 来查找已经被使用的端口。-plant 是过滤条件。-ant 会给你一个列表,其中包括系统中已打开和关闭的端口。

如果你是通过 SSH 连接到虚拟机,例如在 Windows 上使用 PuTTY,你可以在命令提示符中检查是否打开了设备端口,方法是输入 netstat -ant | findstr XXXXXXXX 代表你的计算机上的端口,你是通过 SSH 远程连接到虚拟机的。在这种情况下,它应该属于你的IP地址和端口。默认情况下,我认为端口是 2522,我用它来连接到VirtualBox中的虚拟机,但也可能只属于VirtualBox,对于你来说是另一个端口。

我自己有一个问题,无法正确卸载 portainer-ee 以安装 portainer-ce,但它仍然需要商业版的许可密钥,所以卸载未成功。但如果我像你一样并行安装第二个,我还没有尝试过...

英文:

So far as I can see you have two portainer containers installed, parallely?

Nevertheless you should be able to connect, if you have installed at least one of them, by typing https://localhost:9443.
9443 is pre-defined Port of your virtual machine / server. If you want to get to the container witch is located not on yout computer (via VirtualBox e.g.) so you replace localhost with the IP of your server, in case if myhost really doesn't work.

Warning: Ports

You should know that you have installed both versions, the Buisness Edition (portainer-ee) and Community Edition (portainer-ce) on the same port. Maybe you should first change one of the ports settet by default to another one. I recomend to use your favourite search engine to get information about witch port is not used by any other service you potentially may install in the future.

You can find out which ports are already used by typing netstat -plant. -plant is the filter for that. -ant gives you a list of all opened and closed ports of your system.

If you are connected to the VM via SSH in e.g. PuTTY on Windows, you can check in the cmd, if you have your device port open by typing netstat -ant | findstr XXXX. XXXX stands for the port on your computer you are remotly connecting to you VM via SSH. In this case it is belonged to your IP address and port. By default, I think, the port is 2522, I used it to connect to my VM in VirtualBox, but maybe it just belongs to VirtualBox and for you it is another one.

I have my own problem to de-install portainer-ee properly to install portainer-ce, but it still wants a license key for buisness edition, so the proper de-installation wasn't successful. But what if I really install the second one parallely, like you did, which I haven't tried yet...

huangapple
  • 本文由 发表于 2023年2月23日 21:15:12
  • 转载请务必保留本文链接:https://go.coder-hub.com/75545345.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定