Authored by FengRuwei

Merge branch 'master' of http://git.yoho.cn/ops/monitor-service

package com.monitor.influxdb.mapper;
import com.monitor.influxdb.model.ZookeeperInfo;
/**
* Created by yoho on 2016/6/21.
*/
public interface IZookeeperMapper {
public void insert(String influxDBName,ZookeeperInfo zkInfo);
}
... ...
package com.monitor.influxdb.mapper.impl;
import com.monitor.influxdb.InluxDBSingle;
import com.monitor.influxdb.mapper.IZookeeperMapper;
import com.monitor.influxdb.model.ZookeeperInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* Created by yoho on 2016/6/21.
*/
@Component
public class ZookeeperMapper implements IZookeeperMapper{
@Autowired
private InluxDBSingle inluxDBSingle;
@Override
public void insert(String influxDBName, ZookeeperInfo zkInfo) {
}
}
... ...
package com.monitor.influxdb.model;
import lombok.Data;
/**
* Created by yoho on 2016/6/21.
*/
@Data
public class ZookeeperInfo {
private int id;
private String hostIp;
private int isLive;
}
... ...
... ... @@ -12,5 +12,12 @@
<artifactId>monitor-service-middleware</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>monitor-service</groupId>
<artifactId>monitor-service-common</artifactId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
... ...
package com.monitor.middleware.zookeeper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
/**
* Created by yoho on 2016/6/21.
*/
@Component
public class ZookeeperMonitorTask {
Logger log = LoggerFactory.getLogger(ZookeeperMonitorTask.class);
@Scheduled(fixedRate=10000)
public void run() {
log.info("task start...");
System.out.println("************************************************************");
log.info("task end...");
}
}
... ...
... ... @@ -20,8 +20,11 @@
<context:component-scan base-package="com.monitor" />
<!-- 打开aop 注解 -->
<aop:aspectj-autoproxy proxy-target-class="true"/>
<!-- 支持异步方法执行 -->
<task:annotation-driven />
<!-- Enables the Spring Task @Scheduled programming model -->
<task:executor id="executor" pool-size="50"/>
<task:scheduler id="scheduler" pool-size="50"/>
<task:annotation-driven executor="executor" scheduler="scheduler"/>
<mvc:annotation-driven>
<mvc:message-converters>
... ...
#---------jdbc config----------
local.jdbc.url=jdbc:mysql://172.16.6.234:3306/yh_ops?characterEncoding=utf-8&autoReconnect=true&zeroDateTimeBehavior=convertToNull
local.jdbc.url=jdbc:mysql://localhost:3306/ops?characterEncoding=utf-8&autoReconnect=true&zeroDateTimeBehavior=convertToNull
local.jdbc.user=root
local.jdbc.password=123456
local.jdbc.password=root
#---------jdbc config----------
\ No newline at end of file
... ...