YMatrix
Quick Start
Simulate Time Series Scenarios
Standard Cluster Deployment
Data Modeling
Connecting to The database
Data Writing
Data Migration
Data Query
Scene Application Examples
Federal Query
Maintenance and Monitoring
Global Maintenance
Partition Maintenance
Backup and Restore
Cluster Expansion
Enable Mirroring
Resource Management
Security
Monitoring
Performance Tuning
Troubleshooting
Reference Guide
Tool Guide
Data Type
Storage Engine
Execution Engine
Stream Processing
DR (Disaster Recovery)
Configuration Parameters
Index
Extension
SQL Reference
FAQ
GSSAPI encrypted connections can encrypt all data in network transmission, including query statements and returned results (passwords are not transmitted over the network), which ensures the integrity and confidence of the data during transmission.
In YMatrix, GSSAPI encryption is implemented through Kerberos. The role of Kerberos is to provide a secure authentication mechanism that supports configuration in the pg_hba.conf
file. Allow clients to authenticate through Kerberos tickets By collaborating with the Kerberos Key Distribution Center (KDC), ensuring that only authorized users can access the database.
pg_hba.conf
is as follows:hostgssenc all mxadmin 10.51.0.40/32 gss
Notes!
Make sure the YMatrix server is installed and running. If it has not been installed, please refer to [Quick Installation] (https://ymatrix.cn/doc/6.2/get-started) for pre-installation.
sudo yum install krb5-workstation
On the Kerberos management server, create a service principal for the YMatrix service. Typically, the name of the service principal is in the format of servicename/hostname@realm
, e.g.
postgres/[email protected]
.
kadmin
addprinc -randkey postgres/[email protected]
Export the service principal's key to a keytab file (keytab file). Run the following command:
Note!
/path/to/postgresql.keytab
needs to be replaced with the storage path of the keytab file.ktadd -k /path/to/postgresql.keytab postgres/[email protected]
- Distribute keytab files
Copy the generated keytab file to the host running the YMatrix server and make sure the YMatrix server has access to the file. For example:
scp /path/to/postgresql.keytab
[email protected]:/etc/postgresql.keytab
pg_hba.conf
fileIn the pg_hba.conf
file, add or modify the authentication method to gss.
host all all 10.51.0.40/32 gss
This means that clients from the 10.51.0.40/32
segment are allowed to access all databases using Kerberos authentication.
postgresql.conf
fileOpen the main configuration file of YMatrix postgresql.conf
, set the krb_server_keyfile
parameter, and specify the path to the keytab file.
krb_server_keyfile = '/etc/postgresql.keytab'
After saving the configuration file changes, restart the YMatrix server for the configuration to take effect.
mxstop -u
CREATE USER "username@REALM";
On the client system, use the kinit
command to get the Kerberos ticket:
kinit username@REALM
Replace
username
with the user's Kerberos username andREALM
with the Kerberos domain name.
Connect to the database using the YMatrix client tool that supports Kerberos authentication. If the client tool supports automatic acquisition of Kerberos tickets, there is no need to manually specify a username and password.
psql -h server.example.com -U username dbname
- 登录成功提示
GSSAPI-encrypted connection
Check the log file of the YMatrix server to confirm whether the Kerberos authentication is successful.