Uploaded image for project: 'Help-Desk'
  1. Help-Desk
  2. HELP-1540

FIWARE.Request.Tech.Data.OrionContextBroker.MultipleInstances

    Details

      Description

      Hi,
      I'm trying to use FiLab GEs.
      I would create two Orion Context Broker instances on FiLab, but i have only
      one public IP address.
      How can i execute two Orion instances on the same VM and access them
      through the same public IP?
      I tried using Blueprint template with two tiers. One Orion for each tier.
      But it doesn't work.
      Any suggestions?

      Thanks in advance

      Gioacchino

      _______________________________________________
      Fiware-lab-help mailing list
      Fiware-lab-help@lists.fi-ware.org
      https://lists.fi-ware.org/listinfo/fiware-lab-help

      [Created via e-mail received from: Gioacchino Bombaci <gioakbombaci@gmail.com>]

        Activity

        fw.ext.user FW External User created issue -
        sandor Sándor Laki made changes -
        Field Original Value New Value
        Component/s FIWARE-LAB-HELP [ 10279 ]
        Hide
        sandor Sándor Laki added a comment -

        Dear Gioacchino,

        I've forwarded your question to the Orion developers, and they will
        answer if it is possible to launch two Orion instances in the same VM or
        not.

        However, if you create two VMs with Orion in the same virtual network,
        and assign a floating IP to one of them. You can simply add a forwarding
        rule to the machine having the public IP address so that you can reach
        the second orion instance (running in the VM with local address only)
        through the public ip.

        For that:
        1. add the following iptables rules on the VM with public IP address:
        iptables -t nat -A PREROUTING -p tcp -m tcp --dport 1027 -j DNAT
        --to-destination <private IP of the second orion vm>:1026
        iptables -t nat -A POSTROUTING -p tcp -m tcp --dport 1027 -j MASQUERADE

        2. and enable packet forwarding:
        sysctl -w net.ipv4.ip_forward=1

        3. After that add a new security rule in the cloud portal so that port
        1027 would be open.
        After that the second Orion can be accessed on <public ip>:1027

        Another option to use a proxy like PEPProxy or something similar on the
        machine with public ip:
        https://github.com/ging/fi-ware-pep-proxy

        I hope it helps you,
        Best,
        Sandor


        Sándor Laki
        EU FP7 FI-PPP XIFI project,
        Wigner Research Centre for Physics,
        Hungarian Academy of Sciences
        Konkoly Thege Miklós út 29-33.
        H-1121, Budapest, Hungary
        Cell: +36 70 374 2646
        Skype: sandor.laki

        XIFI: https://fi-xifi.eu/home.html
        FI-PPP: http://www.fi-ppp.eu/

        _______________________________________________
        Fiware-lab-help mailing list
        Fiware-lab-help@lists.fi-ware.org
        https://lists.fi-ware.org/listinfo/fiware-lab-help

        Show
        sandor Sándor Laki added a comment - Dear Gioacchino, I've forwarded your question to the Orion developers, and they will answer if it is possible to launch two Orion instances in the same VM or not. However, if you create two VMs with Orion in the same virtual network, and assign a floating IP to one of them. You can simply add a forwarding rule to the machine having the public IP address so that you can reach the second orion instance (running in the VM with local address only) through the public ip. For that: 1. add the following iptables rules on the VM with public IP address: iptables -t nat -A PREROUTING -p tcp -m tcp --dport 1027 -j DNAT --to-destination <private IP of the second orion vm>:1026 iptables -t nat -A POSTROUTING -p tcp -m tcp --dport 1027 -j MASQUERADE 2. and enable packet forwarding: sysctl -w net.ipv4.ip_forward=1 3. After that add a new security rule in the cloud portal so that port 1027 would be open. After that the second Orion can be accessed on <public ip>:1027 Another option to use a proxy like PEPProxy or something similar on the machine with public ip: https://github.com/ging/fi-ware-pep-proxy I hope it helps you, Best, Sandor – Sándor Laki EU FP7 FI-PPP XIFI project, Wigner Research Centre for Physics, Hungarian Academy of Sciences Konkoly Thege Miklós út 29-33. H-1121, Budapest, Hungary Cell: +36 70 374 2646 Skype: sandor.laki XIFI: https://fi-xifi.eu/home.html FI-PPP: http://www.fi-ppp.eu/ _______________________________________________ Fiware-lab-help mailing list Fiware-lab-help@lists.fi-ware.org https://lists.fi-ware.org/listinfo/fiware-lab-help
        sandor Sándor Laki made changes -
        Assignee Fermín Galán Márquez [ fermin ]
        Hide
        sandor Sándor Laki added a comment -

        Dear Fermin,

        If you answer the question, please send your answer to gioakbombaci@gmail.com as well.

        Thanks,
        Best regards,
        Sandor
        – level-1 support team

        Show
        sandor Sándor Laki added a comment - Dear Fermin, If you answer the question, please send your answer to gioakbombaci@gmail.com as well. Thanks, Best regards, Sandor – level-1 support team
        Hide
        mcp Miguel Carrillo added a comment -

        Replied by Ken on Dec,1 at 15:32
        ===========
        Hi Gioacchino,

        yes, you can have two instances of the orion context broker running in the same machine.
        You need to be a little careful on how you start them though, e.g. they cannot both listen to the same port, obviously.
        The listen port is chosen using the '-port' option.

        The first instance of orion you can start without any options, just using the default values.
        The second instance however, must be told to use different ports, paths etc, in order not to use the same stuff as the first instance.

        You will want separate log files for the instances, this is fixed using the -logDir option
        (just give one of them a directory != the default directory, which is '/tmp').

        The file where the Process IDentifier is stored should also be changed for the second instance of orion. Option: -pidpath <path to pidfile>.
        You probaly don't want the second instance attacking the same database as the first one: option: -db <name of database>.

        So, an example on successfully running two brokers in the same machine:

        $ contextBroker
        $ contextBroker -db secondBroker -pidpath /tmp/secondBroker.pid -logDir /tmp/secondBroker -port 1099

        [ The directory '/tmp/secondBroker' must exist and be writable ]
        [ The mongo database named 'secondBroker' is created automatically ]

        Good luck,

        /KZ

        Show
        mcp Miguel Carrillo added a comment - Replied by Ken on Dec,1 at 15:32 =========== Hi Gioacchino, yes, you can have two instances of the orion context broker running in the same machine. You need to be a little careful on how you start them though, e.g. they cannot both listen to the same port, obviously. The listen port is chosen using the '-port' option. The first instance of orion you can start without any options, just using the default values. The second instance however, must be told to use different ports, paths etc, in order not to use the same stuff as the first instance. You will want separate log files for the instances, this is fixed using the -logDir option (just give one of them a directory != the default directory, which is '/tmp'). The file where the Process IDentifier is stored should also be changed for the second instance of orion. Option: -pidpath <path to pidfile>. You probaly don't want the second instance attacking the same database as the first one: option: -db <name of database>. So, an example on successfully running two brokers in the same machine: $ contextBroker $ contextBroker -db secondBroker -pidpath /tmp/secondBroker.pid -logDir /tmp/secondBroker -port 1099 [ The directory '/tmp/secondBroker' must exist and be writable ] [ The mongo database named 'secondBroker' is created automatically ] Good luck, /KZ
        mcp Miguel Carrillo made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        mcp Miguel Carrillo made changes -
        Status In Progress [ 3 ] Answered [ 10104 ]
        mcp Miguel Carrillo made changes -
        Resolution Done [ 10000 ]
        Status Answered [ 10104 ] Closed [ 6 ]
        mev Manuel Escriche made changes -
        Fix Version/s Sprint 4.1.3 [ 10739 ]
        fermin Fermín Galán made changes -
        Summary [Fiware-lab-help] Help Multiple Orion Instances on FiLab FIWARE.Request.Lab.Data.OrionContextBroker.MultipleInstances
        mev Manuel Escriche made changes -
        Component/s FIWARE-TECH-HELP [ 10278 ]
        Component/s FIWARE-LAB-HELP [ 10279 ]
        mev Manuel Escriche made changes -
        Summary FIWARE.Request.Lab.Data.OrionContextBroker.MultipleInstances FIWARE.Request.Tech.Data.OrionContextBroker.MultipleInstances
        mev Manuel Escriche made changes -
        Sender Email gioakbombaci@gmail.com
        mev Manuel Escriche made changes -
        HD-Chapter Data [ 10838 ]
        HD-Enabler Orion [ 10875 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open In Progress In Progress
        2d 21h 45m 1 Miguel Carrillo 01/Dec/14 4:20 PM
        In Progress In Progress Answered Answered
        1s 1 Miguel Carrillo 01/Dec/14 4:20 PM
        Answered Answered Closed Closed
        1s 1 Miguel Carrillo 01/Dec/14 4:20 PM

          People

          • Assignee:
            fermin Fermín Galán
            Reporter:
            fw.ext.user FW External User
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: