![]() |
VOOZH | about |
Elasticsearch is a popular distributed full-text search engine. By centrally storing data, you can perform ultra-fast searches, fine-tuning relevance, and powerful analytics with ease. Elasticsearch has a pipeline tool for loading data called "Logstash". You can use CData JDBC Drivers to easily import data from any data source into Elasticsearch for search and analysis.
This article explains how to use the CData JDBC Driver for AlloyDB to load data from AlloyDB into Elasticsearch via Logstash.
Now, let's create a configuration file for Logstash to transfer AlloyDB data to Elasticsearch.
The following connection properties are usually required in order to connect to AlloyDB.
You can also optionally set the following:
Standard authentication (using the user/password combination supplied earlier) is the default form of authentication.
No further action is required to leverage Standard Authentication to connect.
There are additional methods of authentication available which must be enabled in the pg_hba.conf file on the AlloyDB server.
Find instructions about authentication setup on the AlloyDB Server here.
This authentication method must be enabled by setting the auth-method in the pg_hba.conf file to md5.
This authentication method must be enabled by setting the auth-method in the pg_hba.conf file to scram-sha-256.
The authentication with Kerberos is initiated by AlloyDB Server when the ∏ is trying to connect to it. You should set up Kerberos on the AlloyDB Server to activate this authentication method. Once you have Kerberos authentication set up on the AlloyDB Server, see the Kerberos section of the help documentation for details on how to authenticate with Kerberos.
Now let's run Logstash using the created "logstash.conf" file.
logstash-7.8.0\bin\logstash -f logstash.conf
A log indicating success will appear. This means the AlloyDB data has been loaded into Elasticsearch.
For example, let's view the data transferred to Elasticsearch in Kibana.
GET alloydb_table/_search
{
"query": {
"match_all": {}
}
}
👁 Querying the AlloyDB data loaded into ElasticsearchWe have confirmed that the data is stored in Elasticsearch.
👁 Confirming the AlloyDB data loaded into ElasticsearchBy using the CData JDBC Driver for AlloyDB with Logstash, it functions as a AlloyDB connector, making it easy to load data into Elasticsearch. Please try the 30-day free trial.
Download a free trial of the AlloyDB Driver to get started:
Download NowLearn more:
👁 AlloyDB IconRapidly create and deploy powerful Java applications that integrate with AlloyDB.