Typical Application Scenarios and Configurations
Log Diagnosis
ODBC logs are classified into unixODBC driver manager logs and psqlODBC driver logs. The former is used to trace whether the application API is successfully executed, and the latter is used to locate problems based on DFX logs generated during underlying implementation.
1 2 3 4 5 6 7 |
[ODBC] Trace=Yes TraceFile=/path/to/odbctrace.log [GaussMPP] Driver64=/usr/local/lib/psqlodbcw.so setup=/usr/local/lib/psqlodbcw.so |
[gaussdb] Driver=GaussMPP Servername=10.10.0.13 # Database server IP address ... Debug=1 # Enable the debug log function of the driver.

The unixODBC logs are generated in the path configured by TraceFile. The psqlODBC generates the mylog_xxx.log file in the /tmp/ directory.
Load Balancing
- Load balancing is to randomly distribute concurrent connections to all CNs to prevent a single CN from being overloaded and improve performance.
- Set AutoBalance to 1 to enable load balancing.
- Set RefreshCNListTime to 5 as required. The default refresh interval is 10s.
- Set Priority to 1 as required. In this case, concurrent connections are preferentially sent to the CNs configured in the configuration file. If all the configured CNs are unavailable, the connections are distributed to the remaining CNs.
Example:
Six CNs, namely, CN1, CN2, CN3, CN4, CN5, and CN6, are configured in the cluster, and four CNs, namely, CN1, CN2, CN3, and CN4, are configured in the configuration file.
Example content of the odbc.ini file:
[gaussdb] Driver=GaussMPP Servername=10.145.130.26,10.145.130.27,10.145.130.28,10.145.130.29 # IP address of the database server. Database=postgres # Database name. Username=omm # Database username. Password= # Database user password. Port=8000 # Database listening port. Sslmode=allow AutoBalance=1 RefreshCNListTime=3 Priority=1
If the configuration file and cluster environment are the same as those in the example, concurrent connections are randomly and evenly distributed to CN1, CN2, CN3, and CN4. When CN1, CN2, CN3, and CN4 are all unavailable, concurrent connections are randomly and evenly sent to CN5 and CN6. If any CN among CN1, CN2, CN3, and CN4 becomes available, the connections are not sent to CN5 and CN6 but to the available CN.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot