open-port: command not found

Andrew Wilkins andrew.wilkins at canonical.com
Mon Oct 23 01:58:59 UTC 2017


On Mon, Oct 23, 2017 at 4:20 AM Akshat Jiwan Sharma <akshatjiwan at gmail.com>
wrote:

> HI,
>
> I'm trying to manually expose a port on a juju machine. According to this
> answer
> <https://askubuntu.com/questions/808176/how-to-manually-open-a-port-in-juju>
> I should be able to do something like this:-
>
>  juju run  "open-port 443" --all
>
> However when I type this in my shell it throws an error
>
> open-port: command not found
>

The different between the command you're running, and the one on AskUbuntu,
is that you're not passing --unit. When you pass --unit, it runs the
command in the context of a unit on the machine. You must be running in the
context of a unit to use "hook tools", such as open-port.

I can verify that the application on this particular controller is already
> exposed and it thus satisfies the requirement for running this command.
>
> >"The port range will only be open while the application is exposed."
>
> Can you help me understand what I'm doing wrong?
>

Ports are managed on a per-unit basis, so you need to execute the "run"
command against a unit or application, using --unit or --application
respectively.

Once you've run open-port, you'll need to run "juju expose <application>"
for the ports to actually be opened up.

Thanks,
> Akshat
> --
> Juju mailing list
> Juju at lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/juju
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/juju/attachments/20171023/d3f51e20/attachment.html>


More information about the Juju mailing list