mirror of
https://github.com/alibaba/canal.git
synced 2026-11-04 00:30:15 +08:00
@@ -40,6 +40,22 @@ if [ -z "$JAVA" ]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
case "$#"
|
||||||
|
in
|
||||||
|
0 )
|
||||||
|
;;
|
||||||
|
2 )
|
||||||
|
if [ "$1" = "debug" ]; then
|
||||||
|
DEBUG_PORT=$2
|
||||||
|
DEBUG_SUSPEND="n"
|
||||||
|
JAVA_DEBUG_OPT="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=$DEBUG_PORT,server=y,suspend=$DEBUG_SUSPEND"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
* )
|
||||||
|
echo "THE PARAMETERS MUST BE TWO OR LESS.PLEASE CHECK AGAIN."
|
||||||
|
exit;;
|
||||||
|
esac
|
||||||
|
|
||||||
str=`file -L $JAVA | grep 64-bit`
|
str=`file -L $JAVA | grep 64-bit`
|
||||||
if [ -n "$str" ]; then
|
if [ -n "$str" ]; then
|
||||||
JAVA_OPTS="-server -Xms2048m -Xmx3072m -Xmn1024m -XX:SurvivorRatio=2 -XX:PermSize=96m -XX:MaxPermSize=256m -Xss256k -XX:-UseAdaptiveSizePolicy -XX:MaxTenuringThreshold=15 -XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:+UseCMSCompactAtFullCollection -XX:+UseFastAccessorMethods -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError"
|
JAVA_OPTS="-server -Xms2048m -Xmx3072m -Xmn1024m -XX:SurvivorRatio=2 -XX:PermSize=96m -XX:MaxPermSize=256m -Xss256k -XX:-UseAdaptiveSizePolicy -XX:MaxTenuringThreshold=15 -XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:+UseCMSCompactAtFullCollection -XX:+UseFastAccessorMethods -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError"
|
||||||
@@ -60,7 +76,7 @@ echo "cd to $bin_abs_path for workaround relative path"
|
|||||||
cd $bin_abs_path
|
cd $bin_abs_path
|
||||||
|
|
||||||
echo CLASSPATH :$CLASSPATH
|
echo CLASSPATH :$CLASSPATH
|
||||||
$JAVA $JAVA_OPTS $ADAPTER_OPTS -classpath .:$CLASSPATH com.alibaba.otter.canal.adapter.launcher.CanalAdapterApplication 1>>$base/logs/adapter.log 2>&1 &
|
$JAVA $JAVA_OPTS $JAVA_DEBUG_OPT $ADAPTER_OPTS -classpath .:$CLASSPATH com.alibaba.otter.canal.adapter.launcher.CanalAdapterApplication 1>>$base/logs/adapter.log 2>&1 &
|
||||||
echo $! > $base/bin/adapter.pid
|
echo $! > $base/bin/adapter.pid
|
||||||
|
|
||||||
echo "cd to $current_path for continue"
|
echo "cd to $current_path for continue"
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ spring:
|
|||||||
default-property-inclusion: non_null
|
default-property-inclusion: non_null
|
||||||
|
|
||||||
canal.conf:
|
canal.conf:
|
||||||
|
mode: tcp # kafka rocketMQ
|
||||||
canalServerHost: 127.0.0.1:11111
|
canalServerHost: 127.0.0.1:11111
|
||||||
# zookeeperHosts: slave1:2181
|
# zookeeperHosts: slave1:2181
|
||||||
# mqServers: 127.0.0.1:9092 #or rocketmq
|
# mqServers: 127.0.0.1:9092 #or rocketmq
|
||||||
@@ -17,7 +18,6 @@ canal.conf:
|
|||||||
timeout:
|
timeout:
|
||||||
accessKey:
|
accessKey:
|
||||||
secretKey:
|
secretKey:
|
||||||
mode: tcp # kafka rocketMQ
|
|
||||||
# srcDataSources:
|
# srcDataSources:
|
||||||
# defaultDS:
|
# defaultDS:
|
||||||
# url: jdbc:mysql://127.0.0.1:3306/mytest?useUnicode=true
|
# url: jdbc:mysql://127.0.0.1:3306/mytest?useUnicode=true
|
||||||
|
|||||||
@@ -49,6 +49,6 @@ canal.mq.topic=example
|
|||||||
#canal.mq.dynamicTopic=.*,mytest,mytest\\..*,mytest2.user
|
#canal.mq.dynamicTopic=.*,mytest,mytest\\..*,mytest2.user
|
||||||
canal.mq.partition=0
|
canal.mq.partition=0
|
||||||
# hash partition config
|
# hash partition config
|
||||||
#canal.mq.partitionsNum=3
|
#canal.mq.partitionsNum=4
|
||||||
#canal.mq.partitionHash=test.table:id^name,.*\\..*
|
#canal.mq.partitionHash=test.table:id^name,.*\\..*
|
||||||
#################################################
|
#################################################
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ public class CanalKafkaProducer implements CanalMQProducer {
|
|||||||
producerTmp.commitTransaction();
|
producerTmp.commitTransaction();
|
||||||
}
|
}
|
||||||
callback.commit();
|
callback.commit();
|
||||||
} catch (Exception e) {
|
} catch (Throwable e) {
|
||||||
logger.error(e.getMessage(), e);
|
logger.error(e.getMessage(), e);
|
||||||
if (kafkaProperties.getTransaction()) {
|
if (kafkaProperties.getTransaction()) {
|
||||||
producerTmp.abortTransaction();
|
producerTmp.abortTransaction();
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ public class CanalRocketMQProducer implements CanalMQProducer {
|
|||||||
send(destination, destination.getTopic(), data);
|
send(destination, destination.getTopic(), data);
|
||||||
}
|
}
|
||||||
callback.commit();
|
callback.commit();
|
||||||
} catch (Exception e) {
|
} catch (Throwable e) {
|
||||||
callback.rollback();
|
callback.rollback();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user