6 Replies Latest reply on Nov 25, 2010 4:28 PM by jpsabadini

    How to start JBoss AS with external IP NAT adresse

    ingedeut

      Hello,

      can someone please help me to start JBoss AS with external IP NAT adresse. I have hosted JBoss AS in an Amazon EC2 Instance. Amazon EC2 manages two categories of adressen: public and private ip adresse (also public and private dns). I have started JBoss AS binded to public DNS using run.sh -b public_dns but in the console showed the the JBoss AS is starting with private dns. Also when trying to connect to the server with an external client that don't exists in Amazon EC2 Network, an exception is thrown as in Cann't connect to JBoss ESB hosted in Amazon EC2 Machine and the server don't answer.

      I use JBoss 4.2.3GA with the all Profile

      Please help me. It's urgent!!

      Thanks in advance

      regards

      Younes

        • 1. Re: How to start JBoss AS with external IP NAT adresse
          jpsabadini

          Hi Younes,

           

          -b option is for bin an address for all Jboss services. So I don't see why do you need to bind your Jboss to a DNS server! It doesn't make any sense to me (unless I'm missing something). I think that you have to use the run.sh with -b option aimed to the public IP. Be aware with router loopbacks restrictions... ie.: if you are consuming a WS internally (through 127.0.0.1) and you bind Jboss to public IP, maybe the router is restricting the request because the loopback restriction.

           

          Another way is bind to 0.0.0.0 (all IP addresses).

           

          Regards,

          JP

          • 2. Re: How to start JBoss AS with external IP NAT adresse
            ingedeut

            Thanks J.Pablo,

             

            i have already used these solution. First i have used -b 0.0.0.0 and then i have used run.sh -b  <my_public_ip> but in the console it's apperead the priavte_ip of the machine. Remenber that i run JBoss AS in Amazon EC2 Cloud.

             

             

            regards

             

            younes

            • 3. Re: How to start JBoss AS with external IP NAT adresse
              jpsabadini

              Could you post some more details? Like which service are you trying to use, at which port, the exception thorwed, etc.?

               

              regards

              • 4. Re: How to start JBoss AS with external IP NAT adresse
                jpsabadini

                As far as I got it, you have two network interfaces, isn't it? Because another think that cames up to my mind: try to shutdown the private interface (ifdown) and then start up Jboss (just to isolate the problem and ensure that the problem is that Jboss is seeing the private interace), with a little luck should work...

                 

                Regards.

                • 5. Re: How to start JBoss AS with external IP NAT adresse
                  ingedeut

                  Thanks J.Pablo,

                   

                  You can find all details under this link http://stackoverflow.com/questions/4238567/cannt-connect-to-jboss-esb-hosted-in-amazon-ec2-machine

                  Can you tell me how i can shutdown the private interface Please. I thinks that is not possible under Amazon EC2 Network.

                   

                  regards

                   

                  Younes

                  • 6. Re: How to start JBoss AS with external IP NAT adresse
                    jpsabadini

                    1) Execute ifconfig in any console. You will get all info about your interfaces. The result will be like this:

                     

                    eth0      Link encap:Ethernet  HWaddr 00:26:B9:56:CC:CC
                              inet addr:200.80.XXX.XXX  Bcast:200.80.XXX.XXX  Mask:255.255.255.248
                              inet6 addr: fe80::226:b9ff:fe56:382c/64 Scope:Link
                              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
                              RX packets:840858048 errors:0 dropped:0 overruns:0 frame:0
                              TX packets:798664546 errors:0 dropped:0 overruns:0 carrier:0
                              collisions:0 txqueuelen:1000
                              RX bytes:2031657184 (1.8 GiB)  TX bytes:1259113979 (1.1 GiB)
                              Interrupt:82 Memory:d6000000-d6012100

                     

                    lo        Link encap:Local Loopback
                              inet addr:127.0.0.1  Mask:255.0.0.0
                              inet6 addr: ::1/128 Scope:Host
                              UP LOOPBACK RUNNING  MTU:16436  Metric:1
                              RX packets:1665168889 errors:0 dropped:0 overruns:0 frame:0
                              TX packets:1665168889 errors:0 dropped:0 overruns:0 carrier:0
                              collisions:0 txqueuelen:0
                              RX bytes:3020197572 (2.8 GiB)  TX bytes:3020197572 (2.8 GiB)

                     

                    Note: You probably will have an eth1 with a private range IP

                     

                    2) Identify which interface is private, let's assume that is eth1

                    3) Execute ifdown eth1. The OS will confirm that the interface is down

                    4) Start your Jboss.

                    5) Execute ifup eht1 to turn on your interface again.

                     

                    Hope it helps.