unable to make connection between MSSQL and python image using Docker compose - docker-compose

I am using Docker compose to build images of python and MSSQL and making connection between DB and python app and added DB container as a server in python.connection file but getting errors like
pyodbc.OperationalError: ('08001', '[08001] [FreeTDS][SQL Server]Unable to connect to data source (0) (SQLDriverConnect)')
Adaptive Server is unavailable or does not exist
'DRIVER={FreeTDS};''SERVER=MSSQL_DB;''PORT=1433;' 'DATABASE=MYDATABASE;''TDS_Version=7.4', autocommit=True) my_python_app | pyodbc.OperationalError: ('08001', '[08001] [FreeTDS][SQL Server]Unable to connect to data source (0) (SQLDriverConnect)')

Related

Hyperledger iroha - schema error while connecting to postgres database

I am trying to deploy Hyperledger Iroha on MacOS (BigSUr) locally, and while running the following command
./build/bin/irohad --config example/config.postgres.sample --genesis_block example/genesis.block --keypair_name example/node0
I get the error
Storage initialization failed: Cannot execute query. Fatal error. ERROR: relation "schema_version" does not exist LINE 1: ... test, iroha_major, iroha_minor, iroha_patch from schema_ver... ^ while executing "select 1 test, iroha_major, iroha_minor, iroha_patch from schema_version;".
I have installed Postgresql DB locally and created the iroha_data database.
Is there a schema that i must load additionally or does it get auto created ?
I was able to overcome this issue by adding -drop_state while starting iroha daemon.

IBM DB2 SQL Connection Errors

I can connect to IBM DB2 inside the IBM Cloud Pak for Data, but when I try to run the exact same %sql connection it errors out. What am I missing?
'''%sql ibm_db_sa://un:pw#host:port/db?security=SSL'''
(ibm_db_dbi.Error) ibm_db_dbi::Error: [IBM][CLI Driver] SQL5005C The operation failed because the database manager failed to access either the database manager configuration file or the database configuration file.\r SQLCODE=-5005
(Background on this error at: http://sqlalche.me/e/dbapi)
Connection info needed in SQLAlchemy format, example:
postgresql://username:password#hostname/dbname
or an existing connection: dict_keys([])
IBM DB2 SQL
Try loading the package ibm_db

Connection error for cassandra and influxdb when using docker-compose

I am using docker-compose for influxdb and Cassandra for my application but when I am trying to run application locally on my mac system I am getting below error - I am new for both so not sure where to make the changes for IPs for both docker images.
for Cassandra -
Connection error: ('Unable to connect to any servers', {'127.0.0.1': error(111, "Tried connecting to [('127.0.0.1', 9042)]. Last error: Connection refused"), '::1': error(99, "Tried connecting to [('::1', 9042, 0, 0)]. Last error: Cannot assign requested address")})
For Influxdb - when trying to create a user programmatically
curl: (6) Could not resolve host: influxdb

Goldengate 19 Postgres to AWS

Ok, so I have one I can't crack. I am testing on-prem GG to AWS. I have it set up in a hub config on-prem. I have my Postgres DB on AWS set with rds.force_ssl=1. I have copied down the certificate bundles from AWS.
I basically followed these steps from Oracle.
GG documentation
And AWS steps here.
AWS PostGres SSL Steps
My ODBCINI has as follows:
sbpgdb=PostgreSQL on sbpgdb [ODBC]
IANAAppCodePage=4
InstallDir=/u01/app/oracle/product/ggpgsdb
[sbpgdb]Driver=/u01/app/oracle/product/ggpgsdb/lib/GGpsql25.so
Description=DataDirect 7.1 PostgreSQL Wire Protocol
BatchMechanism=2
Database=bob_test
HostName=my_rds_instance.us-east-1.rds.amazonaws.com
PortNumber=5432
TransactionErrorBehavior=2
EncryptionMethod=1
ValidateServerCertificate=1
TrustStore=/home/oracle/certs/us-east-1-bundle.pem
My replicat is this.
REPLICAT intrepg
ASSUMETARGETDEFS
HANDLECOLLISIONS
SETENV (NLSLANG=AL32UTF8)
SETENV (NLS_LANG="AMERICAN_AMERICA.AL32UTF8")
SETENV ( PGCLIENTENCODING = "UTF8" )
SETENV (ODBCINI="/u01/app/oracle/product/ggpgsdb/odbc.ini" )
targetdb sbpgdb, USERIDALIAS pg_postgresdb
discardfile ./dirrpt/bob.dsc, APPEND, megabytes 20
reportcount every 60 seconds, rate
map mypdb.bob.*, target bob_test.*;
I can run this command and it connects to the DB.
dblogin sourcedb sbpgdb useridalias pg_postgresdb
but if I start my replicat I get this and it abends after a few seconds.
2021-06-23T09:46:53.835-0500 ERROR OGG-00551 Oracle GoldenGate Delivery for PostgreSQL, intrepg.prm: Database operation failed: Couldn't connect to sbpgdb. ODBC error: SQLSTATE 08001 native database error 7570. [Oracle][ODBC PostgreSQL Wire Protocol driver]SSL Handshake Failure reason [EOF observed which violates protocol].
Now I can disable the whole SSL thing and it connects and the replicat starts right up. What have I done wrong?

IllegalStateException: Can not connect to database. Please check connectivity and settings

CentOS 7
Docker 20.10.5
In my machine run PostgreSQL 9.5 and success open my db:
localhost:5432/sonar
And success open DB by PGAdmin
Nice.
Now in Docker I installed SonarQube 4.5. And want to connect to my db.
I try this:
sudo docker run -e SONARQUBE_JDBC_USERNAME=sonar -e SONARQUBE_JDBC_PASSWORD=sonar -e SONARQUBE_JDBC_URL=jdbc:postgresql://localhost:5432/sonar sonarqube:4.5.7
But I get error:
2021.04.20 11:47:55 INFO web[o.s.s.p.ServerImpl] SonarQube Server / 4.5.7 / e2afb0bff1b8be759789d2c1bc9348de6f519f83
2021.04.20 11:47:55 INFO web[o.s.c.p.Database] Create JDBC datasource for jdbc:postgresql://localhost:5432/sonar
2021.04.20 11:47:55 ERROR web[o.a.c.c.C.[.[.[/]] Exception sending context initialized event to listener instance of class org.sonar.server.platform.PlatformServletContextListener
java.lang.IllegalStateException: Can not connect to database. Please check connectivity and settings (see the properties prefixed by 'sonar.jdbc.').
at org.sonar.core.persistence.DefaultDatabase.checkConnection(DefaultDatabase.java:115) ~[sonar-core-4.5.7.jar:na]
at org.sonar.core.persistence.DefaultDatabase.start(DefaultDatabase.java:73) ~[sonar-core-4.5.7.jar:na]