mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Add more logs for MS cluster manager
This commit is contained in:
parent
63b81995f6
commit
388210c8f9
@ -542,7 +542,7 @@ public class ClusterManagerImpl extends ManagerBase implements ClusterManager, C
|
|||||||
s_logger.trace("Cluster manager heartbeat update, id:" + _mshostId);
|
s_logger.trace("Cluster manager heartbeat update, id:" + _mshostId);
|
||||||
}
|
}
|
||||||
|
|
||||||
_mshostDao.update(_mshostId, getCurrentRunId(), DateUtil.currentGMTTime());
|
_mshostDao.update(_mshostId, _runId, DateUtil.currentGMTTime());
|
||||||
profilerHeartbeatUpdate.stop();
|
profilerHeartbeatUpdate.stop();
|
||||||
|
|
||||||
profilerPeerScan.start();
|
profilerPeerScan.start();
|
||||||
@ -934,7 +934,7 @@ public class ClusterManagerImpl extends ManagerBase implements ClusterManager, C
|
|||||||
@DB
|
@DB
|
||||||
public boolean start() {
|
public boolean start() {
|
||||||
if (s_logger.isInfoEnabled()) {
|
if (s_logger.isInfoEnabled()) {
|
||||||
s_logger.info("Starting cluster manager, msid : " + _msId);
|
s_logger.info("Starting Cluster manager, msid : " + _msId);
|
||||||
}
|
}
|
||||||
|
|
||||||
ManagementServerHostVO mshost = Transaction.execute(new TransactionCallback<ManagementServerHostVO>() {
|
ManagementServerHostVO mshost = Transaction.execute(new TransactionCallback<ManagementServerHostVO>() {
|
||||||
@ -948,7 +948,7 @@ public class ClusterManagerImpl extends ManagerBase implements ClusterManager, C
|
|||||||
if (mshost == null) {
|
if (mshost == null) {
|
||||||
mshost = new ManagementServerHostVO();
|
mshost = new ManagementServerHostVO();
|
||||||
mshost.setMsid(_msId);
|
mshost.setMsid(_msId);
|
||||||
mshost.setRunid(getCurrentRunId());
|
mshost.setRunid(_runId);
|
||||||
mshost.setName(NetUtils.getHostName());
|
mshost.setName(NetUtils.getHostName());
|
||||||
mshost.setVersion(version);
|
mshost.setVersion(version);
|
||||||
mshost.setServiceIP(_clusterNodeIP);
|
mshost.setServiceIP(_clusterNodeIP);
|
||||||
@ -960,15 +960,14 @@ public class ClusterManagerImpl extends ManagerBase implements ClusterManager, C
|
|||||||
_mshostDao.persist(mshost);
|
_mshostDao.persist(mshost);
|
||||||
|
|
||||||
if (s_logger.isInfoEnabled()) {
|
if (s_logger.isInfoEnabled()) {
|
||||||
s_logger.info("New instance of management server msid " + _msId + " is being started");
|
s_logger.info("New instance of management server msid " + _msId + ", runId " + _runId + " is being started");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (s_logger.isInfoEnabled()) {
|
_mshostDao.update(mshost.getId(), _runId, NetUtils.getHostName(), version, _clusterNodeIP, _currentServiceAdapter.getServicePort(),
|
||||||
s_logger.info("Management server " + _msId + " is being started");
|
|
||||||
}
|
|
||||||
|
|
||||||
_mshostDao.update(mshost.getId(), getCurrentRunId(), NetUtils.getHostName(), version, _clusterNodeIP, _currentServiceAdapter.getServicePort(),
|
|
||||||
DateUtil.currentGMTTime());
|
DateUtil.currentGMTTime());
|
||||||
|
if (s_logger.isInfoEnabled()) {
|
||||||
|
s_logger.info("Management server " + _msId + ", runId " + _runId + " is being started");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return mshost;
|
return mshost;
|
||||||
@ -996,6 +995,10 @@ public class ClusterManagerImpl extends ManagerBase implements ClusterManager, C
|
|||||||
@Override
|
@Override
|
||||||
@DB
|
@DB
|
||||||
public boolean stop() {
|
public boolean stop() {
|
||||||
|
if (s_logger.isInfoEnabled()) {
|
||||||
|
s_logger.info("Stopping Cluster manager, msid : " + _msId);
|
||||||
|
}
|
||||||
|
|
||||||
if (_mshostId != null) {
|
if (_mshostId != null) {
|
||||||
ManagementServerHostVO mshost = _mshostDao.findByMsid(_msId);
|
ManagementServerHostVO mshost = _mshostDao.findByMsid(_msId);
|
||||||
mshost.setState(ManagementServerHost.State.Down);
|
mshost.setState(ManagementServerHost.State.Down);
|
||||||
|
|||||||
@ -142,7 +142,8 @@ public class ManagementServerHostDaoImpl extends GenericDaoBase<ManagementServer
|
|||||||
txn.commit();
|
txn.commit();
|
||||||
|
|
||||||
if (count < 1) {
|
if (count < 1) {
|
||||||
throw new CloudRuntimeException("Invalid cluster session detected", new ClusterInvalidSessionException("runid " + runid + " is no longer valid"));
|
s_logger.info("Invalid cluster session detected, runId " + runid + " is no longer valid");
|
||||||
|
throw new CloudRuntimeException("Invalid cluster session detected, runId " + runid + " is no longer valid", new ClusterInvalidSessionException("runId " + runid + " is no longer valid"));
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
s_logger.warn("Unexpected exception, ", e);
|
s_logger.warn("Unexpected exception, ", e);
|
||||||
@ -222,7 +223,8 @@ public class ManagementServerHostDaoImpl extends GenericDaoBase<ManagementServer
|
|||||||
int count = pstmt.executeUpdate();
|
int count = pstmt.executeUpdate();
|
||||||
|
|
||||||
if (count < 1) {
|
if (count < 1) {
|
||||||
throw new CloudRuntimeException("Invalid cluster session detected", new ClusterInvalidSessionException("runid " + runId + " is no longer valid"));
|
s_logger.info("Invalid cluster session detected, runId " + runId + " is no longer valid");
|
||||||
|
throw new CloudRuntimeException("Invalid cluster session detected, runId " + runId + " is no longer valid", new ClusterInvalidSessionException("runId " + runId + " is no longer valid"));
|
||||||
}
|
}
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
throw new CloudRuntimeException("DB exception on " + pstmt.toString(), e);
|
throw new CloudRuntimeException("DB exception on " + pstmt.toString(), e);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user