You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by MDiamond <Mi...@noaa.gov> on 2009/11/19 18:46:03 UTC

Remote Deployment: Connection Refused

I'm try to use deploy.sh to deploy a WAR to a remote Geronimo 2.1.4 server,
but I can't even get list-modules to work.
Basically, I have two machines, A and B. A Geronimo server is running on B.
On A, I try the following:
./deploy.sh --host B list-modules
and get the following error:

    Error: Unable to connect to server at
    deployer:geronimo:jmx://B:1099 -- Connection refused to host:
    127.0.0.1; nested exception is: 

        java.net.ConnectException: Connection refused
javax.enterprise.deploy.spi.exceptions.DeploymentManagerCreationException:
Connection refused to host: 127.0.0.1; nested exception is: 
        java.net.ConnectException: Connection refused
        at
org.apache.geronimo.deployment.plugin.factories.BaseDeploymentFactory.newRemoteDeploymentManager(BaseDeploymentFactory.java:190)
        at
org.apache.geronimo.deployment.plugin.factories.BaseDeploymentFactory.getDeploymentManager(BaseDeploymentFactory.java:140)
        at
javax.enterprise.deploy.shared.factories.DeploymentFactoryManager.getDeploymentManager(DeploymentFactoryManager.java:111)
        at
org.apache.geronimo.deployment.cli.ServerConnection.tryToConnect(ServerConnection.java:148)
        at
org.apache.geronimo.deployment.cli.ServerConnection.<init>(ServerConnection.java:88)
        at
org.apache.geronimo.deployment.cli.ServerConnection.<init>(ServerConnection.java:57)
        at
org.apache.geronimo.deployment.cli.DeployTool.execute(DeployTool.java:161)
        at
org.apache.geronimo.kernel.util.MainConfigurationBootstrapper.main(MainConfigurationBootstrapper.java:45)
        at
org.apache.geronimo.cli.AbstractCLI.executeMain(AbstractCLI.java:67)
        at
org.apache.geronimo.cli.deployer.DeployerCLI.main(DeployerCLI.java:31)
Caused by: java.rmi.ConnectException: Connection refused to host: 127.0.0.1;
nested exception is: 
        java.net.ConnectException: Connection refused
        at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:601)
        at
sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:198)
        at
sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:184)
        at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:110)
        at javax.management.remote.rmi.RMIServerImpl_Stub.newClient(Unknown
Source)
        at
javax.management.remote.rmi.RMIConnector.getConnection(RMIConnector.java:2327)
        at
javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:279)
        at
javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:248)
        at
org.apache.geronimo.deployment.plugin.factories.BaseDeploymentFactory.newRemoteDeploymentManager(BaseDeploymentFactory.java:182)
        ... 9 more
Caused by: java.net.ConnectException: Connection refused
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
        at
java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
        at java.net.Socket.connect(Socket.java:525)
        at java.net.Socket.connect(Socket.java:475)
        at java.net.Socket.<init>(Socket.java:372)
        at java.net.Socket.<init>(Socket.java:186)
        at
sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
        at
sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
        at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:595)
        ... 17 more


Both machines are in each other's /etc/hosts file and the iptables on
machine B are set to allow connections on ports 1099, 9999, 9998, 8080, and
8443 (not that all of those are necessary). Any ideas as to what's going
wrong?
-- 
View this message in context: http://old.nabble.com/Remote-Deployment%3A-Connection-Refused-tp26421415s134p26421415.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Re: Remote Deployment: Connection Refused

Posted by MDiamond <Mi...@noaa.gov>.
Yep, that did it. Thanks a bunch guys!
-- 
View this message in context: http://old.nabble.com/Remote-Deployment%3A-Connection-Refused-tp26421415s134p26594243.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Re: Remote Deployment: Connection Refused

Posted by Forrest Xia <fo...@gmail.com>.
On Tue, Dec 1, 2009 at 5:25 AM, MDiamond <Mi...@noaa.gov> wrote:

>
>
> Shawn Jiang wrote:
> >
> > Please do following to see if B instance is listening to the right
> > ip:port.
> >
> > 1, *shawn@geronimo>**  netstat -na|grep 1099*
> >
>
> I see this:
> tcp        0      0 :::1099                     :::*
> LISTEN
> unix  3      [ ]         STREAM     CONNECTED     471099
>
>
> Forrest Xia wrote:
> >
> > 2. If the machine B is linux, check if /etc/hosts includes entries like
> > follows:
> > 127.0.0.1 localhost localhost.localdomain
> > <machine B's IP> <machine B's hostname>
> >
>
> My /etc/hosts file has the following:
> 127.0.0.1              <machine B's hostname>  localhost.localdomain
> localhost
>

It should be like this:
127.0.0.1              localhost.localdomain localhost
<machine B's external IP> <machine B's hostname>

::1             localhost6.localdomain6 localhost6
>
> --
> View this message in context:
> http://old.nabble.com/Remote-Deployment%3A-Connection-Refused-tp26421415s134p26582166.html
> Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
>
> Please try and let me know if still problem.

Forrest

Re: Remote Deployment: Connection Refused

Posted by MDiamond <Mi...@noaa.gov>.

Shawn Jiang wrote:
> 
> Please do following to see if B instance is listening to the right
> ip:port.
> 
> 1, *shawn@geronimo>**  netstat -na|grep 1099*
> 

I see this:
tcp        0      0 :::1099                     :::*                       
LISTEN      
unix  3      [ ]         STREAM     CONNECTED     471099 


Forrest Xia wrote:
> 
> 2. If the machine B is linux, check if /etc/hosts includes entries like
> follows:
> 127.0.0.1 localhost localhost.localdomain
> <machine B's IP> <machine B's hostname>
> 
 
My /etc/hosts file has the following:
127.0.0.1              <machine B's hostname>  localhost.localdomain
localhost
::1             localhost6.localdomain6 localhost6

-- 
View this message in context: http://old.nabble.com/Remote-Deployment%3A-Connection-Refused-tp26421415s134p26582166.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Re: Remote Deployment: Connection Refused

Posted by Forrest Xia <fo...@gmail.com>.
Quoted from "
https://www.ibm.com/developerworks/forums/thread.jspa?messageID=14001599&#14001599
"

Assume you have two machines: machin A and machine B. To do deployment from
A to B. You can follow these steps:
1. On machine B, open var/config/config-substitutions.properties and modify
as follows
RemoteDeployHostname=<machine B's IP>
2. If the machine B is linux, check if /etc/hosts includes entries like
follows:
127.0.0.1 localhost localhost.localdomain
<machine B's IP> <machine B's hostname>
3. start wasce default server instance on machine B
4. On machine A, execute your remote deployment command like follows:
deploy.sh|bat -u system -p manager --host <machine B's IP> deploy
<pathtoapp>

Forrest

Re: Remote Deployment: Connection Refused

Posted by Shawn Jiang <ge...@gmail.com>.
Please do following to see if B instance is listening to the right ip:port.

1, *shawn@geronimo>**  netstat -na|grep 1099*

If everything is OK, you should see this

*B_IP_address:1099        0.0.0.0:*               LISTEN*

or this

*0.0.0.0:1099         0.0.0.0:*               LISTEN*

which means you instance B is listening to the right ip:port. Then,  you can
try the deployment again in machine A.  You can also try to use ip address
of B instead of B as hostname with deploy script.

On Thu, Nov 26, 2009 at 12:03 AM, MDiamond <Mi...@noaa.gov> wrote:

>
>
>
> RunHua Chi wrote:
> >
> > If you want to deploy applications to B, then edit the value of
> > RemoteDeployHostname in config-subsitutions.properties file on B.
> >
> > Then on A, use the deploy command like
> >
> > ./deploy.sh -host <ip of B> -u system -p manager deploy <application on
> A>
> >
>
> Yes, this is what I am doing and it doesn't work. I get the same error as
> above. And this is with Geronimo-Tomcat.
> --
> View this message in context:
> http://old.nabble.com/Remote-Deployment%3A-Connection-Refused-tp26421415s134p26515354.html
> Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
>
>


-- 
Shawn

Re: Remote Deployment: Connection Refused

Posted by MDiamond <Mi...@noaa.gov>.


RunHua Chi wrote:
> 
> If you want to deploy applications to B, then edit the value of
> RemoteDeployHostname in config-subsitutions.properties file on B.
> 
> Then on A, use the deploy command like
> 
> ./deploy.sh -host <ip of B> -u system -p manager deploy <application on A>
> 

Yes, this is what I am doing and it doesn't work. I get the same error as
above. And this is with Geronimo-Tomcat.
-- 
View this message in context: http://old.nabble.com/Remote-Deployment%3A-Connection-Refused-tp26421415s134p26515354.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Re: Remote Deployment: Connection Refused

Posted by chi runhua <ch...@gmail.com>.
If you want to deploy applications to B, then edit the value of
RemoteDeployHostname in config-subsitutions.properties file on B.

Then on A, use the deploy command like

./deploy.sh -host <ip of B> -u system -p manager deploy <application on A>

BTW, Kevan opened a
JIRA(*GERONIMO-4959<https://issues.apache.org/jira/browse/GERONIMO-4959>
*) for 2.1.4 Geronimo-Jetty assembly. You may want to try remote deploy on
Geronimo-Tomcat one.

Any questions, please let us know.

Jeff

On Wed, Nov 25, 2009 at 12:27 AM, MDiamond <Mi...@noaa.gov> wrote:

>
> On which machine should I change that information? A or B?
>
> I tried it on both in various combinations and still get the same error. As
> I understand it, I'm supposed to change it on B only, but, again, this
> results in the same error. Thoughts?
>
> P.S. If it matters, the relevant portion of my config.xml is (which I
> believe is the default):
>    <module
> name="org.apache.geronimo.framework/geronimo-gbean-deployer/2.1.4/car">
>        <gbean name="Deployer">
>            <attribute
> name="remoteDeployAddress">http://${RemoteDeployHostname}:${HTTPPort
> +PortOffset}</attribute>
>        </gbean>
>    </module>
>
> --
> View this message in context:
> http://old.nabble.com/Remote-Deployment%3A-Connection-Refused-tp26421415s134p26498548.html
> Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
>
>

Re: Remote Deployment: Connection Refused

Posted by MDiamond <Mi...@noaa.gov>.
On which machine should I change that information? A or B?

I tried it on both in various combinations and still get the same error. As
I understand it, I'm supposed to change it on B only, but, again, this
results in the same error. Thoughts?

P.S. If it matters, the relevant portion of my config.xml is (which I
believe is the default):
    <module
name="org.apache.geronimo.framework/geronimo-gbean-deployer/2.1.4/car">
        <gbean name="Deployer">
            <attribute
name="remoteDeployAddress">http://${RemoteDeployHostname}:${HTTPPort
+PortOffset}</attribute>
        </gbean>
    </module>

-- 
View this message in context: http://old.nabble.com/Remote-Deployment%3A-Connection-Refused-tp26421415s134p26498548.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Re: Remote Deployment: Connection Refused

Posted by Kevan Miller <ke...@gmail.com>.
On Nov 19, 2009, at 12:46 PM, MDiamond wrote:

<snip>

> Both machines are in each other's /etc/hosts file and the iptables on
> machine B are set to allow connections on ports 1099, 9999, 9998, 8080, and
> 8443 (not that all of those are necessary). Any ideas as to what's going
> wrong?

Edit the file var/config/config-substitutions.properties

Locate the following:

RemoteDeployHostname=localhost

and change to configure the ip address of machine B (hostname or dotted ip).

RemoteDeployHostname=B

This isn't very intuitive... Would be nice to simplify this...

--kevan