Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ tmp/*
.idea
*.iml
checkmate-dist
/target/
/logs/
29 changes: 19 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
# checkmate-java
checkmate-java
==========

CheckMate is a cluster monitoring system.
# 프로젝트 설명

currently there is a nodejs version of checkmate which monitors impala cluster.
due to many problems it's facing, the author decided to move to java.
- QueryCache를 한 눈에 모니터링할 수 있는 데시보드

first supported system is QueryCache( https://github.com/izlley/querycache )
impala will be moved to this project soon.
# 빌드 방법

the author is planning to support more hadoop based sql engines.
```bash
$ ./mkdist.sh
$ ls checkmate-dist.tgz
```

features planned:
1. graphic chart showing various usage metrics
2. authentication

# 설치 방법

```
$ upload checkmate-dist.tgz to hdfs@DICc-m002:/app/home/hdfs/admin/deploy_new/dipkg/checkmate
$ ./deploy_checkmate.sh server
```

# 위키 링크
* [CheckMate](http://wiki.skplanet.com/display/DIT/CheckMate)
37 changes: 37 additions & 0 deletions bin/start-checkmate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/bash

bin=`dirname "$0"`
bin=`cd "${bin}/.."; pwd`

export CM_HOME="${bin}"

CM_LOG_DIR=${CM_HOME}/logs
CM_CONF_DIR=${CM_HOME}/conf
CM_PID_DIR=${CM_HOME}/pid

if [ ! -d ${CM_LOG_DIR} ]; then
mkdir ${CM_LOG_DIR}
if [ "$?" != "0" ]; then
echo "ERROR mkdir ${CM_LOG_DIR}"
exit 1
fi
fi
if [ ! -d ${CM_PID_DIR} ]; then
mkdir ${CM_PID_DIR}
if [ "$?" != "0" ]; then
echo "ERROR mkdir ${CM_PID_DIR}"
exit 1
fi
fi
START_TIME=`date "+%Y%m%d_%H%M%S"`

CLASSPATH=${CM_CONF_DIR}:${CM_HOME}/lib/*:${CLASSPATH}

if [ "${JVM_ARGS}" == "" ]; then
JVM_ARGS="-enableassertions -enablesystemassertions -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSParallelRemarkEnabled -XX:CMSInitiatingOccupancyFraction=70 -XX:+UseCMSInitiatingOccupancyOnly -Xms256m -Xmx512m"
fi
JVM_ARGS="${JVM_ARGS} -DCM_HOME=${CM_HOME}"
DEBUG_ARGS="-XX:+PrintGCDetails -XX:+PrintGCTimeStamps -verbose:gc -Xloggc:${CM_LOG_DIR}/checkmate_${START_TIME}.gc"

nohup java $JVM_ARGS -cp "$CLASSPATH" com.skplanet.checkmate.CheckMateServer "$@" > ${CM_LOG_DIR}/checkmate_${START_TIME}.out 2>&1 &
echo $! > ${CM_PID_DIR}/checkmate.pid
15 changes: 15 additions & 0 deletions bin/stop-checkmate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

bin=`dirname "$0"`
bin=`cd "${bin}/.."; pwd`

export CM_HOME="${bin}"

CM_PID_DIR=${CM_HOME}/pid

if [ -f ${CM_PID_DIR}/checkmate.pid ]; then
pid=`cat ${CM_PID_DIR}/checkmate.pid`
echo "kill -9 ${pid}"
kill -9 "${pid}"
rm ${CM_PID_DIR}/checkmate.pid
fi
2 changes: 2 additions & 0 deletions conf/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/checkmate.ini
/querycache.ini
10 changes: 9 additions & 1 deletion conf/checkmate.ini.sample
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
WebServicePort = 60080
[global]
WebPort = 8082
UseWebSocket = false

[email]
SmtpServer =
SmtpFrom = CheckMate<noreply@checkmate.com>
SmtpPort =
MailRecipients =
34 changes: 3 additions & 31 deletions conf/log4j.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
checkmate.root.logger=INFO,DRFA,RFA,console
checkmate.root.logger=INFO,DRFA,console
checkmate.log.dir=${CM_HOME}/logs
checkmate.log.file=checkmate.log
checkmate.warn.log.file=warn.checkmate.log
Expand All @@ -15,38 +15,10 @@ log4j.appender.DRFA=org.apache.log4j.DailyRollingFileAppender
log4j.appender.DRFA.File=${checkmate.log.dir}/${checkmate.log.file}
log4j.appender.DRFA.DatePattern=.yyyy-MM-dd
log4j.appender.DRFA.layout=org.apache.log4j.PatternLayout
log4j.appender.DRFA.layout.ConversionPattern=%d{ISO8601} %p %c: %m%n

# WARN
log4j.appender.RFA=org.apache.log4j.DailyRollingFileAppender
log4j.appender.RFA.File=${checkmate.log.dir}/${checkmate.warn.log.file}
log4j.appender.RFA.DatePattern=.yyyy-MM-dd
log4j.appender.RFA.layout=org.apache.log4j.PatternLayout
log4j.appender.RFA.layout.ConversionPattern=%d{ISO8601} %p %c: %m%n
log4j.appender.RFA.Threshold=WARN
log4j.appender.DRFA.layout.ConversionPattern=%d{ISO8601} %-5p %c{2}(%L): %m%n

# Console
log4j.appender.console=org.apache.log4j.ConsoleAppender
log4j.appender.console.target=System.err
log4j.appender.console.layout=org.apache.log4j.PatternLayout
log4j.appender.console.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{2}: %m%n

# querycache log
checkmate.querycache.log.file=querycache.log
log4j.logger.querycache=DEBUG,DRFAquerycache
log4j.appender.DRFAquerycache=org.apache.log4j.DailyRollingFileAppender
log4j.appender.DRFAquerycache.File=${checkmate.log.dir}/${checkmate.querycache.log.file}
log4j.appender.DRFAquerycache.DatePattern=.yyyy-MM-dd
log4j.appender.DRFAquerycache.layout=org.apache.log4j.PatternLayout
log4j.appender.DRFAquerycache.layout.ConversionPattern=%d{ISO8601} %p %c: %m%n


# querycache log
checkmate.api.log.file=api.log
log4j.logger.api=DEBUG,DRFAapi
log4j.appender.DRFAapi=org.apache.log4j.DailyRollingFileAppender
log4j.appender.DRFAapi.File=${checkmate.log.dir}/${checkmate.api.log.file}
log4j.appender.DRFAapi.DatePattern=.yyyy-MM-dd
log4j.appender.DRFAapi.layout=org.apache.log4j.PatternLayout
log4j.appender.DRFAapi.layout.ConversionPattern=%d{ISO8601} %p %c: %m%n

log4j.appender.console.layout.ConversionPattern=%d{ISO8601} %-5p %c{2}(%L): %m%n
4 changes: 4 additions & 0 deletions conf/querycache.ini.sample
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
[global]
PartialUpdateInterval = 3000
FullUpdateInterval = 10000
UpdateFailSleepTime = 300000;
Clusters = "myCluster"

[myCluster]
WebPort = 8080
Servers = localhost
MaxCompleteQueries = 100
UseWebSocket = false
81 changes: 11 additions & 70 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,46 +16,13 @@

<build>
<plugins>
<!--<plugin>-->
<!--<artifactId>maven-assembly-plugin</artifactId>-->
<!--<configuration>-->
<!--<archive>-->
<!--<manifest>-->
<!--<mainClass>com.skplanet.querycache.server.QueryCacheServer</mainClass>-->
<!--</manifest>-->
<!--</archive>-->
<!--<descriptorRefs>-->
<!--<descriptorRef>jar-with-dependencies</descriptorRef>-->
<!--</descriptorRefs>-->
<!--</configuration>-->
<!--<executions>-->
<!--<execution>-->
<!--<id>make-assembly</id>-->
<!--<phase>package</phase>-->
<!--<goals>-->
<!--<goal>assembly</goal>-->
<!--</goals>-->
<!--</execution>-->
<!--</executions>-->
<!--</plugin>-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2</version>
<configuration>
<executable>java</executable>
<arguments>
<!--<argument>-cp</argument>-->
<!--<classpath />-->
<argument>-cp</argument>
<argument>${basedir}/conf:${basedir}/lib/*</argument>
<argument>-DCM_HOME=${basedir}</argument>
Expand All @@ -65,28 +32,12 @@
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>1.1.1</version>
<executions>
<execution>
<id>enforce-java</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireMavenVersion>
<version>[3.0.0,)</version>
</requireMavenVersion>
<requireJavaVersion>
<version>[1.7,)</version>
<message>[ERROR] OLD JDK [${java.version}] in use.
Jetty ${jettyVersion} requires JDK 1.7 or newer</message>
</requireJavaVersion>
</rules>
</configuration>
</execution>
</executions>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
Expand Down Expand Up @@ -168,21 +119,6 @@
<artifactId>javax.mail</artifactId>
<version>1.5.4</version>
</dependency>
<!--<dependency>-->
<!--<groupId>org.apache.hadoop</groupId>-->
<!--<artifactId>hadoop-common</artifactId>-->
<!--<version>2.6.0-cdh5.4.2</version>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.apache.hadoop</groupId>-->
<!--<artifactId>hadoop-mapreduce-client-common</artifactId>-->
<!--<version>2.6.0-cdh5.4.2</version>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.apache.hadoop</groupId>-->
<!--<artifactId>hadoop-mapreduce-client-core</artifactId>-->
<!--<version>2.6.0-cdh5.4.2</version>-->
<!--</dependency>-->
<dependency>
<groupId>io.dropwizard.metrics</groupId>
<artifactId>metrics-core</artifactId>
Expand All @@ -193,5 +129,10 @@
<artifactId>metrics-servlets</artifactId>
<version>${metrics.version}</version>
</dependency>
<dependency>
<groupId>com.skplanet.querycache</groupId>
<artifactId>querycache-server</artifactId>
<version>0.26.15-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
17 changes: 13 additions & 4 deletions src/main/java/com/beans/ClustersBean.java
Original file line number Diff line number Diff line change
@@ -1,21 +1,30 @@
package com.beans;

import com.skplanet.checkmate.querycache.QCClusterManager;

import java.util.ArrayList;
import java.util.Collection;

import com.skplanet.checkmate.CheckMateServer;
import com.skplanet.checkmate.querycache.QCClusterOptions;

/**
* Created by nazgul33 on 15. 2. 6.
*/
public class ClustersBean implements java.io.Serializable {
Collection<String> qcClusters = new ArrayList<>();


private static final long serialVersionUID = 2387849279567737354L;

private Collection<String> qcClusters = new ArrayList<>();

public ClustersBean() {
qcClusters.addAll( QCClusterManager.getInstance().getClusterList() );
qcClusters.addAll( CheckMateServer.getClusterManager().getClusterNameList() );
}

public Collection<String> getQcClusters() {
return qcClusters;
}

public QCClusterOptions getQcOption(String name) {
return CheckMateServer.getClusterManager().getCluster(name).getOptions();
}
}
Loading