You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cloudstack.apache.org by Rui Mao <ma...@163.com> on 2016/01/21 11:39:56 UTC

Cannot add host in Cloudstack 4.7

I'm new to CloudStack, and just installed Cloudstack 4.7.0 in two computers.

 

I got a problem when I tried to add a host.

 

The management node is 10.4.0.11, and the other compute node is 10.4.0.12.

 

In the mgmt. log, I saw successful messages.

 

2016-01-21 17:02:57,417 DEBUG [c.c.u.s.SSHCmdHelper]
(catalina-exec-1:ctx-5c87e5f4 ctx-1d155b58) (logid:ecbd70ac)
cloudstack-setup-agent  -m 10.4.0.11 -z 1 -p 1 -c 1 -g
3aeb10a1-12ee-392d-ab8a-db571c529e1f -a --pubNic=cloudbr0 --prvNic=cloudbr0
--guestNic=cloudbr0 --hypervisor=kvm output:Starting to configure your
system:

Configure Cgroup ...          [OK]

Configure SElinux ...         [OK]

Configure Network ...         [OK]

Configure Libvirt ...         [OK]

Configure Firewall ...        [OK]

Configure Nfs ...             [OK]

Configure cloudAgent ...      [OK]

CloudStack Agent setup is done!

 

But in the agent.log, a connection error happened!

 

2016-01-21 17:02:58,042 INFO  [cloud.agent.AgentShell] (main:null) (logid:)
Agent started

2016-01-21 17:02:58,046 INFO  [cloud.agent.AgentShell] (main:null) (logid:)
Implementation Version is 4.7.0

2016-01-21 17:02:58,047 INFO  [cloud.agent.AgentShell] (main:null) (logid:)
agent.properties found at /etc/cloudstack/agent/agent.properties

2016-01-21 17:02:58,054 INFO  [cloud.agent.AgentShell] (main:null) (logid:)
Defaulting to using properties file for storage

2016-01-21 17:02:58,056 INFO  [cloud.agent.AgentShell] (main:null) (logid:)
Defaulting to the constant time backoff algorithm

2016-01-21 17:02:58,077 INFO  [cloud.utils.LogUtils] (main:null) (logid:)
log4j configuration found at /etc/cloudstack/agent/log4j-cloud.xml

2016-01-21 17:02:58,097 INFO  [cloud.agent.AgentShell] (main:null) (logid:)
Preferring IPv4 address family for agent connection

2016-01-21 17:02:58,183 INFO  [cloud.agent.Agent] (main:null) (logid:) id is


2016-01-21 17:02:58,235 INFO  [kvm.resource.LibvirtConnection] (main:null)
(logid:) No existing libvirtd connection found. Opening a new one

2016-01-21 17:02:58,725 INFO  [org.reflections.Reflections] (main:null)
(logid:) Reflections took 113 ms to scan 1 urls, producing 7 keys and 10
values 

2016-01-21 17:02:58,901 INFO  [kvm.resource.LibvirtComputingResource]
(main:null) (logid:) No libvirt.vif.driver specified. Defaults to
BridgeVifDriver.

2016-01-21 17:02:58,941 INFO  [cloud.agent.Agent] (main:null) (logid:) Agent
[id = new : type = LibvirtComputingResource : zone = 1 : pod = 1 : workers =
5 : host = 10.4.0.11 : port = 8250

2016-01-21 17:02:58,946 INFO  [utils.nio.NioClient] (main:null) (logid:)
Connecting to 10.4.0.11:8250

2016-01-21 17:03:59,131 ERROR [utils.nio.NioConnection] (main:null) (logid:)
Unable to initialize the threads.

java.io.IOException: Connection closed with -1 on reading size.

        at com.cloud.utils.nio.Link.doHandshake(Link.java:513)

        at com.cloud.utils.nio.NioClient.init(NioClient.java:80)

        at com.cloud.utils.nio.NioConnection.start(NioConnection.java:88)

        at com.cloud.agent.Agent.start(Agent.java:228)

        at com.cloud.agent.AgentShell.launchAgent(AgentShell.java:399)

        at
com.cloud.agent.AgentShell.launchAgentFromClassInfo(AgentShell.java:367)

        at com.cloud.agent.AgentShell.launchAgent(AgentShell.java:351)

        at com.cloud.agent.AgentShell.start(AgentShell.java:461)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57
)

        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:43)

        at java.lang.reflect.Method.invoke(Method.java:606)

        at
org.apache.commons.daemon.support.DaemonLoader.start(DaemonLoader.java:177)

2016-01-21 17:03:59,135 INFO  [utils.exception.CSExceptionErrorCode]
(main:null) (logid:) Could not find exception:
com.cloud.utils.exception.NioConnectionException in error code list for
exceptions

2016-01-21 17:03:59,135 ERROR [cloud.agent.AgentShell] (main:null) (logid:)
Unable to start agent: 

com.cloud.utils.exception.CloudRuntimeException: Unable to start the
connection!

        at com.cloud.agent.Agent.start(Agent.java:230)

        at com.cloud.agent.AgentShell.launchAgent(AgentShell.java:399)

        at
com.cloud.agent.AgentShell.launchAgentFromClassInfo(AgentShell.java:367)

        at com.cloud.agent.AgentShell.launchAgent(AgentShell.java:351)

        at com.cloud.agent.AgentShell.start(AgentShell.java:461)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57
)

        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:43)

        at java.lang.reflect.Method.invoke(Method.java:606)

        at
org.apache.commons.daemon.support.DaemonLoader.start(DaemonLoader.java:177)

Caused by: com.cloud.utils.exception.NioConnectionException: Connection
closed with -1 on reading size.

        at com.cloud.utils.nio.NioConnection.start(NioConnection.java:94)

        at com.cloud.agent.Agent.start(Agent.java:228)

        ... 9 more

Caused by: java.io.IOException: Connection closed with -1 on reading size.

        at com.cloud.utils.nio.Link.doHandshake(Link.java:513)

        at com.cloud.utils.nio.NioClient.init(NioClient.java:80)

        at com.cloud.utils.nio.NioConnection.start(NioConnection.java:88)

        ... 10 more

2016-01-21 17:03:59,137 INFO  [cloud.agent.Agent] (AgentShutdownThread:null)
(logid:) Stopping the agent: Reason = sig.kill

 

The 8250 port of mgmt node seemed opened, and I could telnet to it.

 

[root@mgmt ~]# netstat -ln

Active Internet connections (only servers)

Proto Recv-Q Send-Q Local Address               Foreign Address
State      

tcp        0      0 192.168.122.1:53            0.0.0.0:*
LISTEN      

tcp        0      0 0.0.0.0:22                  0.0.0.0:*
LISTEN      

tcp        0      0 0.0.0.0:662                 0.0.0.0:*
LISTEN      

tcp        0      0 127.0.0.1:25                0.0.0.0:*
LISTEN      

tcp        0      0 0.0.0.0:892                 0.0.0.0:*
LISTEN      

tcp        0      0 0.0.0.0:16509               0.0.0.0:*
LISTEN      

tcp        0      0 0.0.0.0:2049                0.0.0.0:*
LISTEN      

tcp        0      0 0.0.0.0:32803               0.0.0.0:*
LISTEN      

tcp        0      0 0.0.0.0:3306                0.0.0.0:*
LISTEN      

tcp        0      0 0.0.0.0:111                 0.0.0.0:*
LISTEN      

tcp        0      0 :::36626                    :::*
LISTEN      

tcp        0      0 :::22                       :::*
LISTEN      

tcp        0      0 :::662                      :::*
LISTEN      

tcp        0      0 ::1:25                      :::*
LISTEN      

tcp        0      0 :::8250                     :::*
LISTEN      

tcp        0      0 :::892                      :::*
LISTEN      

tcp        0      0 :::16509                    :::*
LISTEN      

tcp        0      0 :::2049                     :::*
LISTEN      

tcp        0      0 :::9090                     :::*
LISTEN      

tcp        0      0 :::44354                    :::*
LISTEN      

tcp        0      0 :::32803                    :::*
LISTEN      

tcp        0      0 ::ffff:127.0.0.1:8005       :::*
LISTEN      

tcp        0      0 :::111                      :::*
LISTEN      

tcp        0      0 :::20400                    :::*
LISTEN      

tcp        0      0 :::8080                     :::*
LISTEN

 

[root@mgmt ~]# iptables --list

Chain INPUT (policy ACCEPT)

target     prot opt source               destination         

ACCEPT     udp  --  anywhere             anywhere            udp dpt:domain 

ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:domain 

ACCEPT     udp  --  anywhere             anywhere            udp dpt:bootps 

ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:bootps 

ACCEPT     tcp  --  anywhere             anywhere            tcp
dpts:49152:49216 

ACCEPT     tcp  --  anywhere             anywhere            tcp
dpts:vnc-server:synchronet-db 

ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:16509 

ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:ssh 

ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:websm 

ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:8250 

ACCEPT     tcp  --  anywhere             anywhere            tcp
dpt:webcache 

ACCEPT     udp  --  localhost/24         anywhere            state NEW udp
dpt:sunrpc 

ACCEPT     tcp  --  localhost/24         anywhere            state NEW tcp
dpt:sunrpc 

ACCEPT     tcp  --  localhost/24         anywhere            state NEW tcp
dpt:nfs 

ACCEPT     tcp  --  localhost/24         anywhere            state NEW tcp
dpt:32803 

ACCEPT     udp  --  localhost/24         anywhere            state NEW udp
dpt:filenet-rpc 

ACCEPT     tcp  --  localhost/24         anywhere            state NEW tcp
dpt:892 

ACCEPT     udp  --  localhost/24         anywhere            state NEW udp
dpt:892 

ACCEPT     tcp  --  localhost/24         anywhere            state NEW tcp
dpt:rquotad 

ACCEPT     udp  --  localhost/24         anywhere            state NEW udp
dpt:rquotad 

ACCEPT     tcp  --  localhost/24         anywhere            state NEW tcp
dpt:pftp 

ACCEPT     udp  --  localhost/24         anywhere            state NEW udp
dpt:pftp 

 

Chain FORWARD (policy ACCEPT)

target     prot opt source               destination         

ACCEPT     all  --  anywhere             localhost/24        state
RELATED,ESTABLISHED 

ACCEPT     all  --  localhost/24         anywhere            

ACCEPT     all  --  anywhere             anywhere            

REJECT     all  --  anywhere             anywhere            reject-with
icmp-port-unreachable 

REJECT     all  --  anywhere             anywhere            reject-with
icmp-port-unreachable 

 

Chain OUTPUT (policy ACCEPT)

target     prot opt source               destination         

 

I don't know what wrong. Pls help!

 

Best regards,

Rui Mao

 


答复: Cannot add host in Cloudstack 4.7

Posted by Rui Mao <ma...@163.com>.
The OS is CentOS 6.6, fresh installed, and installed CloudStack by yum. I
could do ssh and telnet. I stopped/flushed the iptables, but still same
result. I installed the agent in mgmt server, but could not add host too.

[root@mgmt ~]# java -version
java version "1.7.0_91"
OpenJDK Runtime Environment (rhel-2.6.2.2.el6_7-x86_64 u91-b00)
OpenJDK 64-Bit Server VM (build 24.91-b01, mixed mode)
[root@mgmt ~]# telnet localhost 8250
Trying ::1...
Connected to localhost.
Escape character is '^]'.
aaaaa
Connection closed by foreign host.
[root@mgmt ~]# ssh node1
root@node1's password: 
Last login: Fri Jan 22 09:50:33 2016 from mgmt
[root@node1 ~]# telnet mgmt 8250
Trying 10.4.0.11...
Connected to mgmt.
Escape character is '^]'.
asdsdsa
Connection closed by foreign host. 
[root@node1 ~]# exit
logout
Connection to node1 closed.

Best regards,
Rui Mao

-----邮件原件-----
发件人: users-return-24353-maorui2k=163.com@cloudstack.apache.org
[mailto:users-return-24353-maorui2k=163.com@cloudstack.apache.org] 代表 ilya
发送时间: 2016年1月22日 05:03
收件人: users@cloudstack.apache.org
主题: Re: Cannot add host in Cloudstack 4.7

Please see response in line

On 1/21/16 2:39 AM, Rui Mao wrote:
> I'm new to CloudStack, and just installed Cloudstack 4.7.0 in two
computers.
> 
>  
> 
> I got a problem when I tried to add a host.
> 
>  
> 
> The management node is 10.4.0.11, and the other compute node is 10.4.0.12.

What are these versions reference?

> In the mgmt. log, I saw successful messages.
> 
>

>From mgmt server, try to ssh to KVM host with root and confirm it works.


>From KVM host, try to reach mgmt server on 8250 via netcat or telnet..


Lastly, what versions of java do you have installed on both hosts?

You can try stopping iptables on both hosts to confirm its not causing any
issues.

Regards
ilya

> 
> 2016-01-21 17:02:57,417 DEBUG [c.c.u.s.SSHCmdHelper]
> (catalina-exec-1:ctx-5c87e5f4 ctx-1d155b58) (logid:ecbd70ac) 
> cloudstack-setup-agent  -m 10.4.0.11 -z 1 -p 1 -c 1 -g 
> 3aeb10a1-12ee-392d-ab8a-db571c529e1f -a --pubNic=cloudbr0 
> --prvNic=cloudbr0
> --guestNic=cloudbr0 --hypervisor=kvm output:Starting to configure your
> system:
> 
> Configure Cgroup ...          [OK]
> 
> Configure SElinux ...         [OK]
> 
> Configure Network ...         [OK]
> 
> Configure Libvirt ...         [OK]
> 
> Configure Firewall ...        [OK]
> 
> Configure Nfs ...             [OK]
> 
> Configure cloudAgent ...      [OK]
> 
> CloudStack Agent setup is done!
> 
>  
> 
> But in the agent.log, a connection error happened!
> 
>  
> 
> 2016-01-21 17:02:58,042 INFO  [cloud.agent.AgentShell] (main:null) 
> (logid:) Agent started
> 
> 2016-01-21 17:02:58,046 INFO  [cloud.agent.AgentShell] (main:null) 
> (logid:) Implementation Version is 4.7.0
> 
> 2016-01-21 17:02:58,047 INFO  [cloud.agent.AgentShell] (main:null) 
> (logid:) agent.properties found at 
> /etc/cloudstack/agent/agent.properties
> 
> 2016-01-21 17:02:58,054 INFO  [cloud.agent.AgentShell] (main:null) 
> (logid:) Defaulting to using properties file for storage
> 
> 2016-01-21 17:02:58,056 INFO  [cloud.agent.AgentShell] (main:null) 
> (logid:) Defaulting to the constant time backoff algorithm
> 
> 2016-01-21 17:02:58,077 INFO  [cloud.utils.LogUtils] (main:null) 
> (logid:) log4j configuration found at 
> /etc/cloudstack/agent/log4j-cloud.xml
> 
> 2016-01-21 17:02:58,097 INFO  [cloud.agent.AgentShell] (main:null) 
> (logid:) Preferring IPv4 address family for agent connection
> 
> 2016-01-21 17:02:58,183 INFO  [cloud.agent.Agent] (main:null) (logid:) 
> id is
> 
> 
> 2016-01-21 17:02:58,235 INFO  [kvm.resource.LibvirtConnection] 
> (main:null)
> (logid:) No existing libvirtd connection found. Opening a new one
> 
> 2016-01-21 17:02:58,725 INFO  [org.reflections.Reflections] 
> (main:null)
> (logid:) Reflections took 113 ms to scan 1 urls, producing 7 keys and 
> 10 values
> 
> 2016-01-21 17:02:58,901 INFO  [kvm.resource.LibvirtComputingResource]
> (main:null) (logid:) No libvirt.vif.driver specified. Defaults to 
> BridgeVifDriver.
> 
> 2016-01-21 17:02:58,941 INFO  [cloud.agent.Agent] (main:null) (logid:) 
> Agent [id = new : type = LibvirtComputingResource : zone = 1 : pod = 1 
> : workers =
> 5 : host = 10.4.0.11 : port = 8250
> 
> 2016-01-21 17:02:58,946 INFO  [utils.nio.NioClient] (main:null) 
> (logid:) Connecting to 10.4.0.11:8250
> 
> 2016-01-21 17:03:59,131 ERROR [utils.nio.NioConnection] (main:null) 
> (logid:) Unable to initialize the threads.
> 
> java.io.IOException: Connection closed with -1 on reading size.
> 
>         at com.cloud.utils.nio.Link.doHandshake(Link.java:513)
> 
>         at com.cloud.utils.nio.NioClient.init(NioClient.java:80)
> 
>         at 
> com.cloud.utils.nio.NioConnection.start(NioConnection.java:88)
> 
>         at com.cloud.agent.Agent.start(Agent.java:228)
> 
>         at com.cloud.agent.AgentShell.launchAgent(AgentShell.java:399)
> 
>         at
> com.cloud.agent.AgentShell.launchAgentFromClassInfo(AgentShell.java:36
> 7)
> 
>         at com.cloud.agent.AgentShell.launchAgent(AgentShell.java:351)
> 
>         at com.cloud.agent.AgentShell.start(AgentShell.java:461)
> 
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.j
> ava:57
> )
> 
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
> orImpl
> .java:43)
> 
>         at java.lang.reflect.Method.invoke(Method.java:606)
> 
>         at
> org.apache.commons.daemon.support.DaemonLoader.start(DaemonLoader.java
> :177)
> 
> 2016-01-21 17:03:59,135 INFO  [utils.exception.CSExceptionErrorCode]
> (main:null) (logid:) Could not find exception:
> com.cloud.utils.exception.NioConnectionException in error code list 
> for exceptions
> 
> 2016-01-21 17:03:59,135 ERROR [cloud.agent.AgentShell] (main:null) 
> (logid:) Unable to start agent:
> 
> com.cloud.utils.exception.CloudRuntimeException: Unable to start the 
> connection!
> 
>         at com.cloud.agent.Agent.start(Agent.java:230)
> 
>         at com.cloud.agent.AgentShell.launchAgent(AgentShell.java:399)
> 
>         at
> com.cloud.agent.AgentShell.launchAgentFromClassInfo(AgentShell.java:36
> 7)
> 
>         at com.cloud.agent.AgentShell.launchAgent(AgentShell.java:351)
> 
>         at com.cloud.agent.AgentShell.start(AgentShell.java:461)
> 
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.j
> ava:57
> )
> 
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
> orImpl
> .java:43)
> 
>         at java.lang.reflect.Method.invoke(Method.java:606)
> 
>         at
> org.apache.commons.daemon.support.DaemonLoader.start(DaemonLoader.java
> :177)
> 
> Caused by: com.cloud.utils.exception.NioConnectionException: 
> Connection closed with -1 on reading size.
> 
>         at 
> com.cloud.utils.nio.NioConnection.start(NioConnection.java:94)
> 
>         at com.cloud.agent.Agent.start(Agent.java:228)
> 
>         ... 9 more
> 
> Caused by: java.io.IOException: Connection closed with -1 on reading size.
> 
>         at com.cloud.utils.nio.Link.doHandshake(Link.java:513)
> 
>         at com.cloud.utils.nio.NioClient.init(NioClient.java:80)
> 
>         at 
> com.cloud.utils.nio.NioConnection.start(NioConnection.java:88)
> 
>         ... 10 more
> 
> 2016-01-21 17:03:59,137 INFO  [cloud.agent.Agent] 
> (AgentShutdownThread:null)
> (logid:) Stopping the agent: Reason = sig.kill
> 
>  
> 
> The 8250 port of mgmt node seemed opened, and I could telnet to it.
> 
>  
> 
> [root@mgmt ~]# netstat -ln
> 
> Active Internet connections (only servers)
> 
> Proto Recv-Q Send-Q Local Address               Foreign Address
> State      
> 
> tcp        0      0 192.168.122.1:53            0.0.0.0:*
> LISTEN      
> 
> tcp        0      0 0.0.0.0:22                  0.0.0.0:*
> LISTEN      
> 
> tcp        0      0 0.0.0.0:662                 0.0.0.0:*
> LISTEN      
> 
> tcp        0      0 127.0.0.1:25                0.0.0.0:*
> LISTEN      
> 
> tcp        0      0 0.0.0.0:892                 0.0.0.0:*
> LISTEN      
> 
> tcp        0      0 0.0.0.0:16509               0.0.0.0:*
> LISTEN      
> 
> tcp        0      0 0.0.0.0:2049                0.0.0.0:*
> LISTEN      
> 
> tcp        0      0 0.0.0.0:32803               0.0.0.0:*
> LISTEN      
> 
> tcp        0      0 0.0.0.0:3306                0.0.0.0:*
> LISTEN      
> 
> tcp        0      0 0.0.0.0:111                 0.0.0.0:*
> LISTEN      
> 
> tcp        0      0 :::36626                    :::*
> LISTEN      
> 
> tcp        0      0 :::22                       :::*
> LISTEN      
> 
> tcp        0      0 :::662                      :::*
> LISTEN      
> 
> tcp        0      0 ::1:25                      :::*
> LISTEN      
> 
> tcp        0      0 :::8250                     :::*
> LISTEN      
> 
> tcp        0      0 :::892                      :::*
> LISTEN      
> 
> tcp        0      0 :::16509                    :::*
> LISTEN      
> 
> tcp        0      0 :::2049                     :::*
> LISTEN      
> 
> tcp        0      0 :::9090                     :::*
> LISTEN      
> 
> tcp        0      0 :::44354                    :::*
> LISTEN      
> 
> tcp        0      0 :::32803                    :::*
> LISTEN      
> 
> tcp        0      0 ::ffff:127.0.0.1:8005       :::*
> LISTEN      
> 
> tcp        0      0 :::111                      :::*
> LISTEN      
> 
> tcp        0      0 :::20400                    :::*
> LISTEN      
> 
> tcp        0      0 :::8080                     :::*
> LISTEN
> 
>  
> 
> [root@mgmt ~]# iptables --list
> 
> Chain INPUT (policy ACCEPT)
> 
> target     prot opt source               destination         
> 
> ACCEPT     udp  --  anywhere             anywhere            udp
dpt:domain 
> 
> ACCEPT     tcp  --  anywhere             anywhere            tcp
dpt:domain 
> 
> ACCEPT     udp  --  anywhere             anywhere            udp
dpt:bootps 
> 
> ACCEPT     tcp  --  anywhere             anywhere            tcp
dpt:bootps 
> 
> ACCEPT     tcp  --  anywhere             anywhere            tcp
> dpts:49152:49216
> 
> ACCEPT     tcp  --  anywhere             anywhere            tcp
> dpts:vnc-server:synchronet-db
> 
> ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:16509

> 
> ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:ssh 
> 
> ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:websm

> 
> ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:8250 
> 
> ACCEPT     tcp  --  anywhere             anywhere            tcp
> dpt:webcache
> 
> ACCEPT     udp  --  localhost/24         anywhere            state NEW udp
> dpt:sunrpc
> 
> ACCEPT     tcp  --  localhost/24         anywhere            state NEW tcp
> dpt:sunrpc
> 
> ACCEPT     tcp  --  localhost/24         anywhere            state NEW tcp
> dpt:nfs
> 
> ACCEPT     tcp  --  localhost/24         anywhere            state NEW tcp
> dpt:32803
> 
> ACCEPT     udp  --  localhost/24         anywhere            state NEW udp
> dpt:filenet-rpc
> 
> ACCEPT     tcp  --  localhost/24         anywhere            state NEW tcp
> dpt:892
> 
> ACCEPT     udp  --  localhost/24         anywhere            state NEW udp
> dpt:892
> 
> ACCEPT     tcp  --  localhost/24         anywhere            state NEW tcp
> dpt:rquotad
> 
> ACCEPT     udp  --  localhost/24         anywhere            state NEW udp
> dpt:rquotad
> 
> ACCEPT     tcp  --  localhost/24         anywhere            state NEW tcp
> dpt:pftp
> 
> ACCEPT     udp  --  localhost/24         anywhere            state NEW udp
> dpt:pftp
> 
>  
> 
> Chain FORWARD (policy ACCEPT)
> 
> target     prot opt source               destination         
> 
> ACCEPT     all  --  anywhere             localhost/24        state
> RELATED,ESTABLISHED
> 
> ACCEPT     all  --  localhost/24         anywhere            
> 
> ACCEPT     all  --  anywhere             anywhere            
> 
> REJECT     all  --  anywhere             anywhere            reject-with
> icmp-port-unreachable
> 
> REJECT     all  --  anywhere             anywhere            reject-with
> icmp-port-unreachable
> 
>  
> 
> Chain OUTPUT (policy ACCEPT)
> 
> target     prot opt source               destination         
> 
>  
> 
> I don't know what wrong. Pls help!
> 
>  
> 
> Best regards,
> 
> Rui Mao
> 
>  
> 
> 



Re: Cannot add host in Cloudstack 4.7

Posted by ilya <il...@gmail.com>.
Please see response in line

On 1/21/16 2:39 AM, Rui Mao wrote:
> I'm new to CloudStack, and just installed Cloudstack 4.7.0 in two computers.
> 
>  
> 
> I got a problem when I tried to add a host.
> 
>  
> 
> The management node is 10.4.0.11, and the other compute node is 10.4.0.12.

What are these versions reference?

> In the mgmt. log, I saw successful messages.
> 
>

>From mgmt server, try to ssh to KVM host with root and confirm it works.


>From KVM host, try to reach mgmt server on 8250 via netcat or telnet..


Lastly, what versions of java do you have installed on both hosts?

You can try stopping iptables on both hosts to confirm its not causing
any issues.

Regards
ilya

> 
> 2016-01-21 17:02:57,417 DEBUG [c.c.u.s.SSHCmdHelper]
> (catalina-exec-1:ctx-5c87e5f4 ctx-1d155b58) (logid:ecbd70ac)
> cloudstack-setup-agent  -m 10.4.0.11 -z 1 -p 1 -c 1 -g
> 3aeb10a1-12ee-392d-ab8a-db571c529e1f -a --pubNic=cloudbr0 --prvNic=cloudbr0
> --guestNic=cloudbr0 --hypervisor=kvm output:Starting to configure your
> system:
> 
> Configure Cgroup ...          [OK]
> 
> Configure SElinux ...         [OK]
> 
> Configure Network ...         [OK]
> 
> Configure Libvirt ...         [OK]
> 
> Configure Firewall ...        [OK]
> 
> Configure Nfs ...             [OK]
> 
> Configure cloudAgent ...      [OK]
> 
> CloudStack Agent setup is done!
> 
>  
> 
> But in the agent.log, a connection error happened!
> 
>  
> 
> 2016-01-21 17:02:58,042 INFO  [cloud.agent.AgentShell] (main:null) (logid:)
> Agent started
> 
> 2016-01-21 17:02:58,046 INFO  [cloud.agent.AgentShell] (main:null) (logid:)
> Implementation Version is 4.7.0
> 
> 2016-01-21 17:02:58,047 INFO  [cloud.agent.AgentShell] (main:null) (logid:)
> agent.properties found at /etc/cloudstack/agent/agent.properties
> 
> 2016-01-21 17:02:58,054 INFO  [cloud.agent.AgentShell] (main:null) (logid:)
> Defaulting to using properties file for storage
> 
> 2016-01-21 17:02:58,056 INFO  [cloud.agent.AgentShell] (main:null) (logid:)
> Defaulting to the constant time backoff algorithm
> 
> 2016-01-21 17:02:58,077 INFO  [cloud.utils.LogUtils] (main:null) (logid:)
> log4j configuration found at /etc/cloudstack/agent/log4j-cloud.xml
> 
> 2016-01-21 17:02:58,097 INFO  [cloud.agent.AgentShell] (main:null) (logid:)
> Preferring IPv4 address family for agent connection
> 
> 2016-01-21 17:02:58,183 INFO  [cloud.agent.Agent] (main:null) (logid:) id is
> 
> 
> 2016-01-21 17:02:58,235 INFO  [kvm.resource.LibvirtConnection] (main:null)
> (logid:) No existing libvirtd connection found. Opening a new one
> 
> 2016-01-21 17:02:58,725 INFO  [org.reflections.Reflections] (main:null)
> (logid:) Reflections took 113 ms to scan 1 urls, producing 7 keys and 10
> values 
> 
> 2016-01-21 17:02:58,901 INFO  [kvm.resource.LibvirtComputingResource]
> (main:null) (logid:) No libvirt.vif.driver specified. Defaults to
> BridgeVifDriver.
> 
> 2016-01-21 17:02:58,941 INFO  [cloud.agent.Agent] (main:null) (logid:) Agent
> [id = new : type = LibvirtComputingResource : zone = 1 : pod = 1 : workers =
> 5 : host = 10.4.0.11 : port = 8250
> 
> 2016-01-21 17:02:58,946 INFO  [utils.nio.NioClient] (main:null) (logid:)
> Connecting to 10.4.0.11:8250
> 
> 2016-01-21 17:03:59,131 ERROR [utils.nio.NioConnection] (main:null) (logid:)
> Unable to initialize the threads.
> 
> java.io.IOException: Connection closed with -1 on reading size.
> 
>         at com.cloud.utils.nio.Link.doHandshake(Link.java:513)
> 
>         at com.cloud.utils.nio.NioClient.init(NioClient.java:80)
> 
>         at com.cloud.utils.nio.NioConnection.start(NioConnection.java:88)
> 
>         at com.cloud.agent.Agent.start(Agent.java:228)
> 
>         at com.cloud.agent.AgentShell.launchAgent(AgentShell.java:399)
> 
>         at
> com.cloud.agent.AgentShell.launchAgentFromClassInfo(AgentShell.java:367)
> 
>         at com.cloud.agent.AgentShell.launchAgent(AgentShell.java:351)
> 
>         at com.cloud.agent.AgentShell.start(AgentShell.java:461)
> 
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57
> )
> 
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
> .java:43)
> 
>         at java.lang.reflect.Method.invoke(Method.java:606)
> 
>         at
> org.apache.commons.daemon.support.DaemonLoader.start(DaemonLoader.java:177)
> 
> 2016-01-21 17:03:59,135 INFO  [utils.exception.CSExceptionErrorCode]
> (main:null) (logid:) Could not find exception:
> com.cloud.utils.exception.NioConnectionException in error code list for
> exceptions
> 
> 2016-01-21 17:03:59,135 ERROR [cloud.agent.AgentShell] (main:null) (logid:)
> Unable to start agent: 
> 
> com.cloud.utils.exception.CloudRuntimeException: Unable to start the
> connection!
> 
>         at com.cloud.agent.Agent.start(Agent.java:230)
> 
>         at com.cloud.agent.AgentShell.launchAgent(AgentShell.java:399)
> 
>         at
> com.cloud.agent.AgentShell.launchAgentFromClassInfo(AgentShell.java:367)
> 
>         at com.cloud.agent.AgentShell.launchAgent(AgentShell.java:351)
> 
>         at com.cloud.agent.AgentShell.start(AgentShell.java:461)
> 
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57
> )
> 
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
> .java:43)
> 
>         at java.lang.reflect.Method.invoke(Method.java:606)
> 
>         at
> org.apache.commons.daemon.support.DaemonLoader.start(DaemonLoader.java:177)
> 
> Caused by: com.cloud.utils.exception.NioConnectionException: Connection
> closed with -1 on reading size.
> 
>         at com.cloud.utils.nio.NioConnection.start(NioConnection.java:94)
> 
>         at com.cloud.agent.Agent.start(Agent.java:228)
> 
>         ... 9 more
> 
> Caused by: java.io.IOException: Connection closed with -1 on reading size.
> 
>         at com.cloud.utils.nio.Link.doHandshake(Link.java:513)
> 
>         at com.cloud.utils.nio.NioClient.init(NioClient.java:80)
> 
>         at com.cloud.utils.nio.NioConnection.start(NioConnection.java:88)
> 
>         ... 10 more
> 
> 2016-01-21 17:03:59,137 INFO  [cloud.agent.Agent] (AgentShutdownThread:null)
> (logid:) Stopping the agent: Reason = sig.kill
> 
>  
> 
> The 8250 port of mgmt node seemed opened, and I could telnet to it.
> 
>  
> 
> [root@mgmt ~]# netstat -ln
> 
> Active Internet connections (only servers)
> 
> Proto Recv-Q Send-Q Local Address               Foreign Address
> State      
> 
> tcp        0      0 192.168.122.1:53            0.0.0.0:*
> LISTEN      
> 
> tcp        0      0 0.0.0.0:22                  0.0.0.0:*
> LISTEN      
> 
> tcp        0      0 0.0.0.0:662                 0.0.0.0:*
> LISTEN      
> 
> tcp        0      0 127.0.0.1:25                0.0.0.0:*
> LISTEN      
> 
> tcp        0      0 0.0.0.0:892                 0.0.0.0:*
> LISTEN      
> 
> tcp        0      0 0.0.0.0:16509               0.0.0.0:*
> LISTEN      
> 
> tcp        0      0 0.0.0.0:2049                0.0.0.0:*
> LISTEN      
> 
> tcp        0      0 0.0.0.0:32803               0.0.0.0:*
> LISTEN      
> 
> tcp        0      0 0.0.0.0:3306                0.0.0.0:*
> LISTEN      
> 
> tcp        0      0 0.0.0.0:111                 0.0.0.0:*
> LISTEN      
> 
> tcp        0      0 :::36626                    :::*
> LISTEN      
> 
> tcp        0      0 :::22                       :::*
> LISTEN      
> 
> tcp        0      0 :::662                      :::*
> LISTEN      
> 
> tcp        0      0 ::1:25                      :::*
> LISTEN      
> 
> tcp        0      0 :::8250                     :::*
> LISTEN      
> 
> tcp        0      0 :::892                      :::*
> LISTEN      
> 
> tcp        0      0 :::16509                    :::*
> LISTEN      
> 
> tcp        0      0 :::2049                     :::*
> LISTEN      
> 
> tcp        0      0 :::9090                     :::*
> LISTEN      
> 
> tcp        0      0 :::44354                    :::*
> LISTEN      
> 
> tcp        0      0 :::32803                    :::*
> LISTEN      
> 
> tcp        0      0 ::ffff:127.0.0.1:8005       :::*
> LISTEN      
> 
> tcp        0      0 :::111                      :::*
> LISTEN      
> 
> tcp        0      0 :::20400                    :::*
> LISTEN      
> 
> tcp        0      0 :::8080                     :::*
> LISTEN
> 
>  
> 
> [root@mgmt ~]# iptables --list
> 
> Chain INPUT (policy ACCEPT)
> 
> target     prot opt source               destination         
> 
> ACCEPT     udp  --  anywhere             anywhere            udp dpt:domain 
> 
> ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:domain 
> 
> ACCEPT     udp  --  anywhere             anywhere            udp dpt:bootps 
> 
> ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:bootps 
> 
> ACCEPT     tcp  --  anywhere             anywhere            tcp
> dpts:49152:49216 
> 
> ACCEPT     tcp  --  anywhere             anywhere            tcp
> dpts:vnc-server:synchronet-db 
> 
> ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:16509 
> 
> ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:ssh 
> 
> ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:websm 
> 
> ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:8250 
> 
> ACCEPT     tcp  --  anywhere             anywhere            tcp
> dpt:webcache 
> 
> ACCEPT     udp  --  localhost/24         anywhere            state NEW udp
> dpt:sunrpc 
> 
> ACCEPT     tcp  --  localhost/24         anywhere            state NEW tcp
> dpt:sunrpc 
> 
> ACCEPT     tcp  --  localhost/24         anywhere            state NEW tcp
> dpt:nfs 
> 
> ACCEPT     tcp  --  localhost/24         anywhere            state NEW tcp
> dpt:32803 
> 
> ACCEPT     udp  --  localhost/24         anywhere            state NEW udp
> dpt:filenet-rpc 
> 
> ACCEPT     tcp  --  localhost/24         anywhere            state NEW tcp
> dpt:892 
> 
> ACCEPT     udp  --  localhost/24         anywhere            state NEW udp
> dpt:892 
> 
> ACCEPT     tcp  --  localhost/24         anywhere            state NEW tcp
> dpt:rquotad 
> 
> ACCEPT     udp  --  localhost/24         anywhere            state NEW udp
> dpt:rquotad 
> 
> ACCEPT     tcp  --  localhost/24         anywhere            state NEW tcp
> dpt:pftp 
> 
> ACCEPT     udp  --  localhost/24         anywhere            state NEW udp
> dpt:pftp 
> 
>  
> 
> Chain FORWARD (policy ACCEPT)
> 
> target     prot opt source               destination         
> 
> ACCEPT     all  --  anywhere             localhost/24        state
> RELATED,ESTABLISHED 
> 
> ACCEPT     all  --  localhost/24         anywhere            
> 
> ACCEPT     all  --  anywhere             anywhere            
> 
> REJECT     all  --  anywhere             anywhere            reject-with
> icmp-port-unreachable 
> 
> REJECT     all  --  anywhere             anywhere            reject-with
> icmp-port-unreachable 
> 
>  
> 
> Chain OUTPUT (policy ACCEPT)
> 
> target     prot opt source               destination         
> 
>  
> 
> I don't know what wrong. Pls help!
> 
>  
> 
> Best regards,
> 
> Rui Mao
> 
>  
> 
> 

Re: Cannot add host in Cloudstack 4.7

Posted by Erik Weber <te...@gmail.com>.
On Thu, Jan 21, 2016 at 11:39 AM, Rui Mao <ma...@163.com> wrote:

> I'm new to CloudStack, and just installed Cloudstack 4.7.0 in two
> computers.
>
>
>
> I got a problem when I tried to add a host.
>
>
>
> The management node is 10.4.0.11, and the other compute node is 10.4.0.12.
>
>
>
> In the mgmt. log, I saw successful messages.
>
>
>
> 2016-01-21 17:02:57,417 DEBUG [c.c.u.s.SSHCmdHelper]
> (catalina-exec-1:ctx-5c87e5f4 ctx-1d155b58) (logid:ecbd70ac)
> cloudstack-setup-agent  -m 10.4.0.11 -z 1 -p 1 -c 1 -g
> 3aeb10a1-12ee-392d-ab8a-db571c529e1f -a --pubNic=cloudbr0 --prvNic=cloudbr0
> --guestNic=cloudbr0 --hypervisor=kvm output:Starting to configure your
> system:
>
> Configure Cgroup ...          [OK]
>
> Configure SElinux ...         [OK]
>
> Configure Network ...         [OK]
>
> Configure Libvirt ...         [OK]
>
> Configure Firewall ...        [OK]
>
> Configure Nfs ...             [OK]
>
> Configure cloudAgent ...      [OK]
>
> CloudStack Agent setup is done!
>
>
>
> But in the agent.log, a connection error happened!
>
>
>
> 2016-01-21 17:02:58,042 INFO  [cloud.agent.AgentShell] (main:null) (logid:)
> Agent started
>
> 2016-01-21 17:02:58,046 INFO  [cloud.agent.AgentShell] (main:null) (logid:)
> Implementation Version is 4.7.0
>
> 2016-01-21 17:02:58,047 INFO  [cloud.agent.AgentShell] (main:null) (logid:)
> agent.properties found at /etc/cloudstack/agent/agent.properties
>
> 2016-01-21 17:02:58,054 INFO  [cloud.agent.AgentShell] (main:null) (logid:)
> Defaulting to using properties file for storage
>
> 2016-01-21 17:02:58,056 INFO  [cloud.agent.AgentShell] (main:null) (logid:)
> Defaulting to the constant time backoff algorithm
>
> 2016-01-21 17:02:58,077 INFO  [cloud.utils.LogUtils] (main:null) (logid:)
> log4j configuration found at /etc/cloudstack/agent/log4j-cloud.xml
>
> 2016-01-21 17:02:58,097 INFO  [cloud.agent.AgentShell] (main:null) (logid:)
> Preferring IPv4 address family for agent connection
>
> 2016-01-21 17:02:58,183 INFO  [cloud.agent.Agent] (main:null) (logid:) id
> is
>
>
> 2016-01-21 17:02:58,235 INFO  [kvm.resource.LibvirtConnection] (main:null)
> (logid:) No existing libvirtd connection found. Opening a new one
>
> 2016-01-21 17:02:58,725 INFO  [org.reflections.Reflections] (main:null)
> (logid:) Reflections took 113 ms to scan 1 urls, producing 7 keys and 10
> values
>
> 2016-01-21 17:02:58,901 INFO  [kvm.resource.LibvirtComputingResource]
> (main:null) (logid:) No libvirt.vif.driver specified. Defaults to
> BridgeVifDriver.
>
> 2016-01-21 17:02:58,941 INFO  [cloud.agent.Agent] (main:null) (logid:)
> Agent
> [id = new : type = LibvirtComputingResource : zone = 1 : pod = 1 : workers
> =
> 5 : host = 10.4.0.11 : port = 8250
>
> 2016-01-21 17:02:58,946 INFO  [utils.nio.NioClient] (main:null) (logid:)
> Connecting to 10.4.0.11:8250
>
> 2016-01-21 17:03:59,131 ERROR [utils.nio.NioConnection] (main:null)
> (logid:)
> Unable to initialize the threads.
>
> java.io.IOException: Connection closed with -1 on reading size.
>


Could be SSL/TLS issue, ensure that packages are updated on your management
server, in particular anything related to nss.

-- 
Erik