How to Set Environment Variables for TiDB CDC on Linux

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: linux上 TiDB cdc 如何设置环境变量

| username: TiDBer_8xv3YpMO

To recognize the company’s server, you need to set the environment variables for ticdc. Where and how should these be set?

| username: ealam_小羽 | Original post link

I don’t quite understand what server-side recognition means. Normally, TiCDC requires a PD node to start, which means it is added to the TiDB cluster. If other TiCDC machines have the corresponding data source permissions, it should work.

The configuration in the picture seems different from the official one. The official version does not support Mongo; it seems like you compiled a TiCDC that supports Mongo yourself? Could you describe the specific issue more clearly?

If you use TiCDC according to the official guide, after creating the CDC cluster, you configure a synchronization task (Changefeed) to write to the downstream.

Official example:

| username: TiDBer_8xv3YpMO | Original post link

If we don’t consider the configuration for now, I want to write a main method in Java to call TiCDC’s RPC. Is it feasible, and are there any interfaces available?

| username: ealam_小羽 | Original post link

Take a look at this to see if it meets your requirements. My understanding is that you just want to call the API to check if the synchronization task is running normally.

| username: TiDBer_8xv3YpMO | Original post link

My company’s server needs to establish an RPC channel with TiCDC. I need to test whether the RPC on the TiCDC side is functioning properly.

| username: TiDBer_8xv3YpMO | Original post link

What is this situation? My ticdc here shows that it is normal.

| username: ealam_小羽 | Original post link

What version of TiCDC are you using? OpenAPI was only introduced in version 5.2. However, this OpenAPI essentially has the same functionality as the cdc cli tool. In my understanding, this feature is generally not needed during development unless you are building a platform to manage TiCDC synchronization tasks via a web interface. Otherwise, synchronization tasks are usually created by operations, and developers only need to focus on using the synchronized data. Perhaps you could consider upgrading your version (or if you are already working with the source code, look at the code for versions above 5.2 to support the OpenAPI functionality)? However, keep in mind that TiCDC and TiDB versions need to be consistent; otherwise, you might encounter issues.

| username: TiDBer_8xv3YpMO | Original post link

I want to test whether ticdc’s RPC is available because my company’s project needs to establish an RPC channel with ticdc.

| username: ealam_小羽 | Original post link

Take a look at the previous post?

| username: TiDBer_8xv3YpMO | Original post link

Our company has made modifications to TiCDC in version 5.0, so we cannot easily switch versions.

| username: ealam_小羽 | Original post link

Then take a look at this. I haven’t really looked at the source code, but I feel it should be simpler than supporting Mongo because essentially it’s just like creating an interface to call the internal API.

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.