Error in Connecting AWS RDS using API proxies

Not applicable

Hi Team,

From Apigee we are trying to connect AWS RDS using node js proxy,

It throws error getting connection from read pool "EINVAL" when we are trying to connect

As suggest my community for "EINVAL Error" - I've modified nodejs.properties for routers and rebooted the services, but still, we are getting an error.

When I telnet from MP and routes nodes response success. please find the output below:

[root@node2 ~]# /opt/apigee/apigee-service/bin/apigee-all status

+ apigee-service apigee-cassandra status

apigee-service: apigee-cassandra: OK

+ apigee-service apigee-telegraf status

apigee-service: apigee-telegraf: OK

+ apigee-service apigee-zookeeper status

apigee-service: apigee-zookeeper: OK

+ apigee-service edge-message-processor status

apigee-service: edge-message-processor: OK

+ apigee-service edge-router status

apigee-service: edge-router: OK

[root@node2 ~]# telnet nn1.cugzjv6dxswg.ap-south-1.rds.amazonaws.com 3306

Trying 10.3.4.153...

Connected to nn1.exchange.cugzjv6dxswg.ap-south-1.rds.amazonaws.com.

Escape character is '^]'.

N

5.6.27-log1B;?l!^6?3;m7i+:~0qkFmysql_native_passwordConnection closed by foreign host.

[root@node2 ~]# telnet nn1.cugzjv6dxswg.ap-south-1.rds.amazonaws.com 3306

Trying 10.3.4.153...

Connected to nn1.cugzjv6dxswg.ap-south-1.rds.amazonaws.com.

Escape character is '^]'.

Node2:

[root@node3 ~]# /opt/apigee/apigee-service/bin/apigee-all status

+ apigee-service apigee-cassandra status

apigee-service: apigee-cassandra: OK

+ apigee-service apigee-telegraf status

apigee-service: apigee-telegraf: OK

+ apigee-service apigee-zookeeper status

apigee-service: apigee-zookeeper: OK

+ apigee-service edge-message-processor status

apigee-service: edge-message-processor: OK

+ apigee-service edge-router status

apigee-service: edge-router: OK

[root@node3 ~]# telnet nn1.cugzjv6dxswg.ap-south-1.rds.amazonaws.com 3306

Trying 10.3.4.153...

Connected to nn1.cugzjv6dxswg.ap-south-1.rds.amazonaws.com.

Escape character is '^]'.

Is there any alternatives ways to check the connection from MP, to connect rds MYSQL using Apigee Edge platform??

Many Thanks,

Madhu

0 2 512
2 REPLIES 2

what is in your message-processor.properties file in /opt/apigee/customer/application on your MP's ?

Not applicable

Hi @Madhu , you can try leveraging MySql Node.js NPM Module. What you'll essentially need is to deploy an API Proxy leveraging Express with an endpoint that has something like the code below:

var mysql = require('mysql');
var connection = mysql.createConnection({
  host: 'localhost',
  user: 'me',
  password: 'secret',
  database: 'my_db'
});

var express = require('express');
var app = express();

app.get('/', function (req, res) {
  connection.connect();


  connection.query('SELECT 1 + 1 AS solution', function (error, results, fields) {
    if (error) throw error;
    console.log('The solution is: ', results[0].solution);
    res.send(results[0].solution);
  });


  connection.end();
});


var server = app.listen(3000, function () {
  var host = server.address().address;
  var port = server.address().port;
  console.log('Example app listening at http://%s:%s', host, port);
});

Let me know if it works!