quartz系列(三)terracotta2.3.5详细安装教程

【概述】
官方网站
http://terracotta.org/
http://www.quartz-scheduler.org/documentation/quartz-2.1.x/configuration/ConfigTerracottaJobStore

下载
http://terracotta.org/downloads/open-source/catalog
点击左边的opensource /download

与maven集成
http://terracotta.org/documentation/more/apache-maven
http://repo.terracotta.org/maven2/

【在java客户端使用quartz集群时】
问题一
Caused by: java.lang.NoClassDefFoundError: org/terracotta/express/ClientFactory
把common目录下的terracotta-toolkit-1.0-runtime-1.0.0.jar文件拷贝到classpath就可以了。

问题二
terracotta客户端与com.googlecode.jmockit的JAR包不能一起使用,否则报错

【安装】
1)切记使用JDK1.6,使用1.7会报错
2)解压缩以后,根据习惯,创见子目录
    run 存放起停shell脚本
    etc 存放配置文件tc-config.xml

【terracotta集群配置】tc-config.xml
<?xml version="1.0" encoding="UTF-8"?>
<!-- All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved. -->
<tc:tc-config xsi:schemaLocation="http://www.terracotta.org/schema/terracotta-5.xsd" xmlns:tc="http://www.terracotta.org/config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <servers>
<!-- Sts where the Terracotta server can be found. Replace the value of host with the server's IP address. -->
<!-- %(user.home) -->
        <server host="10.27.80.235" name="server1">
            <data>/home/pai/data/terracotta/server-data</data>
            <logs>/home/pai/data/terracotta/server-logs</logs>
            <statistics>/home/pai/data/terracotta/server-statistics</statistics>
<!-- persist data -->
            <dso>
                <persistence>
                     <mode>permanent-store</mode>
                </persistence>
            </dso>
        </server>
        <server host="10.27.80.227" name="server2">
            <data>/home/pai/data/terracotta/server-data</data>
            <logs>/home/pai/data/terracotta/server-logs</logs>
            <statistics>/home/pai/data/terracotta/server-statistics</statistics>
            <dso>
                <persistence>
                     <mode>permanent-store</mode>
                </persistence>
            </dso>
        </server>
<!-- If using a standby Terracotta server, also referred to as an ACTIVE-PASSIVE configuration, add the second server here. -->
<!-- If using more than one server, add an <ha> section. -->
        <ha>
            <mode>networked-active-passive</mode>
            <networked-active-passive>
                <election-time>5</election-time>
            </networked-active-passive>
        </ha>
    </servers>
<!-- Sets where the generated client logs are saved on clients. -->
    <clients>
        <logs>/home/pai/data/terracotta/client-logs</logs>
    </clients>
</tc:tc-config>


【服务器启动】
谁先启动,谁就是主
主服务器
sh start-tc-server.sh -f /application/search/terracotta-3.7.5/tc-config.xml -n server1 &
备服务器
sh start-tc-server.sh -f /application/search/terracotta-3.7.5/tc-config.xml -n server2 &

【客户端监控】
跟服务器的包是一样的包,在windows下
启动的是dev-console.bat

【参考】
http://baike.baidu.com/view/4595391.htm
http://lihongchao87.iteye.com/blog/1727802
http://yale.iteye.com/blog/1560539
原理分析
http://yale.iteye.com/blog/1541612
quartz访问terracotta集群
http://blog.csdn.net/privatemiao/article/details/6558794

配置说明
http://1730634.blog.51cto.com/blog/1720634/1007496



作者简介
昵称:澳洲鸟
姓名:朴海林
QQ:85977328
MSN:[email protected]

转载请注明出处

你可能感兴趣的:(terracotta)