You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cloudstack.apache.org by Jerry Jiang <je...@sjcloud.cn> on 2013/07/26 09:58:31 UTC

答复: cloudstack-management service auto-start?

Setup a watchdog script to check the network status, trigger the start
management service when mysql comes back.

Jerry Jiang 

-----邮件原件-----
发件人: Indra Pramana [mailto:indra@sg.or.id] 
发送时间: 2013年7月26日 星期五 11:53
收件人: users@cloudstack.apache.org; aemneina@gmail.com
主题: Re: cloudstack-management service auto-start?

Hi Ahmad and all,

Good day to you, and thank you for your e-mail. Apologise for the delay in
my response.

This is the logs when I restarted the management server. It seems that the
management server was still not able to connect to the database server when
it tries to start the service. The MySQL database is hosted on a different
server.

Is there a way I can ask the init runlevel / upstart to try starting the
cloudstack-management service at a slightly later time, waiting for the
network connectivity to be restored?

Or do I need to create a cron job shell script which will check the status
of the service, and start it if it's down?

Any other users would like to share their experience on what is the best way
to do this?

===
2013-07-26 11:33:32,394 ERROR [db.Transaction.Transaction] (Timer-1:null)
Unexpected exception:
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException:*Could
not create connection to database server. Attempted reconnect 3 times.
Giving up.*
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
        at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAcces
sorImpl.java:57)
        at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstruc
torAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
        at com.mysql.jdbc.Util.getInstance(Util.java:386)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1014)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:988)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:974)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:919)
        at
com.mysql.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:2299)
        at
com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2220)
        at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:813)
        at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
        at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAcces
sorImpl.java:57)
        at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstruc
torAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
        at
com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:399)
        at
com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:334)
        at java.sql.DriverManager.getConnection(DriverManager.java:620)
        at java.sql.DriverManager.getConnection(DriverManager.java:200)
        at
org.apache.commons.dbcp.DriverManagerConnectionFactory.createConnection(Driv
erManagerConnectionFactory.java:75)
        at
org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnect
ionFactory.java:582)
        at
org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPoo
l.java:1188)
        at
org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.ja
va:106)
        at
com.cloud.utils.db.Transaction.getStandaloneConnectionWithException(Transact
ion.java:208)
        at
com.cloud.utils.db.Transaction.getStandaloneConnection(Transaction.java:217)
        at
com.cloud.utils.db.DbUtil.getConnectionForGlobalLocks(DbUtil.java:59)
        at com.cloud.utils.db.DbUtil.getGlobalLock(DbUtil.java:204)
        at com.cloud.utils.db.GlobalLock.lock(GlobalLock.java:154)
        at
com.cloud.upgrade.DatabaseIntegrityChecker.check(DatabaseIntegrityChecker.ja
va:232)
        at
com.cloud.utils.component.ComponentContext.initComponentsLifeCycle(Component
Context.java:90)
        at
com.cloud.servlet.CloudStartupServlet$1.run(CloudStartupServlet.java:50)
        at java.util.TimerThread.mainLoop(Timer.java:534)
        at java.util.TimerThread.run(Timer.java:484)
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:
Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The
driver has not received any packets from the server.
        ... 36 more
Caused by: java.net.NoRouteToHostException: No route to host
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at
java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:327)
        at
java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.ja
va:193)
        at
java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:180)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:384)
        ... 34 more
2013-07-26 11:33:32,396 ERROR [utils.db.DbUtil] (Timer-1:null) *Unable to
acquire DB connection for global lock system*
2013-07-26 11:33:32,397 ERROR [utils.component.ComponentContext]
(Timer-1:null) *System integrity check failed. Refuse to startup*
2013-07-26 11:33:33,406 INFO  [context.support.XmlWebApplicationContext]
(Thread-13:null) Closing Root WebApplicationContext: startup date [Fri Jul
26 11:32:59 SGT 2013]; root of context hierarchy ===

Looking forward to your reply, thank you.

Cheers.



On Fri, Jul 19, 2013 at 8:38 AM, Ahmad Emneina <ae...@gmail.com> wrote:

> can you post your management server logs, maybe there's a telling 
> error as to why it wont start. Is mysql starting on boot (assuming its 
> on the same box)?
>
>
> On Wed, Jul 17, 2013 at 8:01 PM, Indra Pramana <in...@sg.or.id> wrote:
>
> > Dean,
> >
> > Good day to you, and thank you for your e-mail.
> >
> > I tried your suggestion, but it didn't work.
> >
> > apt-get install chkconfig
> > chkconfig cloudstack-management on
> >
> > root@cs-mgmt-01:/home/indra# chkconfig | grep cloudstack-management
> > cloudstack-management        on
> >
> > Rebooted the management server.
> >
> > After reboot, the cloudstack-management service is still not started 
> > by default. I still need to start manually.
> >
> > ===
> > root@cs-mgmt-01:/home/indra# service cloudstack-management status
> >  * CloudStack-specific Tomcat servlet engine is not running.
> >
> > root@cs-mgmt-01:/home/indra# service cloudstack-management start
> >  * Starting CloudStack-specific Tomcat servlet engine 
> > cloudstack-management [ OK ]
> >
> > root@cs-mgmt-01:/home/indra# service cloudstack-management status
> >  * CloudStack-specific Tomcat servlet engine is running with pid 
> > 1751 ===
> >
> > Any other suggestions?
> >
> > Looking forward to your reply, thank you.
> >
> > Cheers.
> >
> >
> >
> > On Wed, Jul 17, 2013 at 9:56 PM, Dean Kamali <de...@gmail.com>
> > wrote:
> >
> > > Try and use chkconfig on Ubuntu
> > >
> > > apt-get install chkconfig
> > >
> > > chkconfig cloudstack-management on
> > >
> > > That should do it.
> > >
> > >
> > > On Wed, Jul 17, 2013 at 6:19 AM, Indra Pramana <in...@sg.or.id> wrote:
> > >
> > > > Dear all,
> > > >
> > > > I am running CloudStack 4.1.0 on a Ubuntu 12.04.2 server. May I 
> > > > know
> > how
> > > > can I make the cloudstack-management service to auto-start upon
> > > booting-up?
> > > > Tried to use this command:
> > > >
> > > > sudo update-rc.d cloudstack-management defaults
> > > >
> > > > but it doesn't work. Do I need to write the upstart config 
> > > > script
> > > manually
> > > > and add it into /etc/init and/or etc/default? Anyone has an 
> > > > existing upstart config script for cloudstack-management service 
> > > > which
> everyone
> > > can
> > > > use?
> > > >
> > > > Looking forward to your reply, thank you.
> > > >
> > > > Cheers.
> > > >
> > >
> >
>