DataCenter 1.0.0.1

dotnet add package DataCenter --version 1.0.0.1
NuGet\Install-Package DataCenter -Version 1.0.0.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DataCenter" Version="1.0.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DataCenter --version 1.0.0.1
#r "nuget: DataCenter, 1.0.0.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install DataCenter as a Cake Addin
#addin nuget:?package=DataCenter&version=1.0.0.1

// Install DataCenter as a Cake Tool
#tool nuget:?package=DataCenter&version=1.0.0.1

DataCenter

1. 使用前提

1.1 Mysql 下载安装

1.2 启用Mysql binlog - 便于使用canal监听

1、查看binlog是否启用,在mysql中执行 show variables like '%log_bin%'; 2、电脑,右键管理,打开服务(或win+R 输入services.msc),找到mysql的my.ini配置文件位置(右键mysql服务-->属性--->可执行文件路径 中 鼠标光标键入然后往右拉即能看到),在[mysqld]节下添加以下内容:(注意 server-id=1 这一行可能已经存在文件中 搜索找到删除)

#设置唯一id
server-id=1
#开启bin-log,产生的bin-log文件名即为bin-log.*
log-bin=mysql-bin
#指定bin-log为row类别,其他两种是statement、mixed
binlog_format=mixed
#对指定的数据库开启bin-log,这里是对wh数据库开启bin-log服务
# binlog-do-db=bjintranat
#7天删除
expire-logs-days=7

3、重启mysql服务就可以启用binlog。开启MIXED模式才可看见执行的语句

------三种模式详细解释: 互联网公司使用MySQL的功能较少(不用存储过程、触发器、函数),选择默认的Statement level

用到MySQL的特殊功能(存储过程、触发器、函数)则选择Mixed模式

用到MySQL的特殊功能(存储过程、触发器、函数),又希望数据最大化一直则选择Row模式

完成对mysql的配置,可以在mysql的安装目录下的data文件夹中看到000001文件,就是binlog日志文件。如:

img

### 1.3 canal安装与配置

1、电脑中首先需要下载安装canal,可以去阿里的github上面下载(更多版本选择),也可以从下面的地址进行提取

链接:https://pan.baidu.com/s/1oysSnGP-e_Zw6eEk9NT8rg 提取码:j33k

canal支持多种语言使用。

img

2、下载完成,将它解压,如:

img

3、 修改D:\Tools\alibaba\canal\conf\example下的 instance.properties(刚解压出的example文件夹中,可以将除了instance.properties文件以外的文件全部删除)

img

修改instance.properties文件的相关mysql数据库配置

img

4、完成配置以后,进入bin文件夹,windows双击startup.bat文件(注意,canal需要java运行环境,如果电脑没有java环境的,可以只配置一个jre)

img

img

如上图显示,canal就正常运行了。接下来就只需要开启mysql的binlog日志,在自己的程序中使用canal即可

2. 类及使用说明

Product Compatible and additional computed target framework versions.
.NET Framework net is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0.1 418 5/20/2022
1.0.0 380 5/19/2022

发布1.0.0.1
1. 解决了无数据库/表时的服务启动奔溃问题
2. 添加数据库/表检查创建的功能,在服务创建时自动检查创建
3. 优化服务创建处理,阻止服务异常/创建失败时客户端的接入