Giter Site home page Giter Site logo

Comments (9)

GregHanson avatar GregHanson commented on September 22, 2024

@infinitydon Can you try explicitly setting the resolution type to DNS in your Service Entries?

cat <<EOF | istioctl create -f -
apiVersion: networking.istio.io/v1alpha3
kind: ServiceEntry
metadata:
  name: httpbin-ext
spec:
  hosts:
  - httpbin.org
  ports:
  - number: 80
    name: http
    protocol: HTTP
  resolution: DNS
EOF

cat <<EOF | istioctl create -f -
apiVersion: networking.istio.io/v1alpha3
kind: ServiceEntry
metadata:
  name: google-ext
spec:
  hosts:
  - www.google.com
  ports:
  - number: 443
    name: https
    protocol: HTTPS
  resolution: DNS
EOF

from old_issues_repo.

infinitydon avatar infinitydon commented on September 22, 2024

@GregHanson -- Thanks, it works now..

How do I know when to use the resolution:DNS ?

Because I followed the example exactly in the docs

from old_issues_repo.

vadimeisenbergibm avatar vadimeisenbergibm commented on September 22, 2024

It works for me without resoulution: DNS, with istio-demo.yaml. Strange.

from old_issues_repo.

GregHanson avatar GregHanson commented on September 22, 2024

It's possible that there is a bug in the default resolution type NONE or how we are generating the envoy config in this case. In this case resolution type DNS just tells envoy to direct traffic to the host in hosts

from old_issues_repo.

infinitydon avatar infinitydon commented on September 22, 2024

Cool.. the other thing that comes to my mind is that am running this on AWS and I really doubt if this should affect the deployment..
Thanks for the effort!.. Will go ahead and close this.

from old_issues_repo.

roopagowda avatar roopagowda commented on September 22, 2024

Hi,

I am trying to connect to AWS RDS from istio environment.
Our application is JAVA Application.

My mysql ServiceEntry file is as follows:


apiVersion: networking.istio.io/v1alpha3
kind: ServiceEntry
metadata:
  name: mysql-external
spec:
  hosts:
  - xxxxxxxxxxxxxxxxxxx.rds.amazonaws.com
  addresses:
  - XX.XX.XX.XX/32
  ports:
  - name: jdbc
    number: 3306
    protocol: tcp
  location: MESH_EXTERNAL

We are using the config file in application as follows:


...
....

sql_db_conn_url : "jdbc:mysql://rds_endpoint/inventory_management?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC&failOverReadOnly=false&maxReconnects=10&rewriteBatchedStatements=true"
-- | --
sql_db_user :  "username"
sql_db_passwd : "password"
...
.....

I have created a service using a Service file as below:


apiVersion: v1
kind: Service
metadata:
  name: abc
  labels:
    app: abc
spec:
  ports:
  - port: 8080
    name: http
  selector:
    app: abc
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: abc
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: abc
        version: v1
    spec:
      containers:
      - name: abc
        image: 5550XXXXXXXXXXXXXXXXXXXXXXXXxx/test:mysql
        imagePullPolicy: IfNotPresent
        env:
          - name: DB_TYPE
            value: "mysql"
          - name: MYSQL_DB_HOST
            value: xxxxxxxxxxxxxxxxxxx.rds.amazonaws.com
          - name: MYSQL_DB_PORT
            value: 3306
          - name: MYSQL_DB_USER
            value: user
          - name: MYSQL_DB_PASSWORD
            value: password
        ports:
        - containerPort: 8080

When I try to connect to database getting the below error:

{"@timestamp":"2018-10-15T11:04:25.381+0000","@message":"com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@3f24bdc4 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception: ","@source":"com.mchange.v2.resourcepool.BasicResourcePool","@source_host":"pqinventory-v1-795965f574-h9lnc","@fields":{"timestamp":1539601465381,"level":"WARNING","line_number":315,"class":"com.mchange.v2.resourcepool.BasicResourcePool","method":"","exception_class":"java.sql.SQLException","exception_message":"No suitable driver","stacktrace":"java.sql.SQLException: No suitable driver\n\tat java.sql.DriverManager.getDriver(DriverManager.java:315)\n\tat com.mchange.v2.c3p0.DriverManagerDataSource.driver(DriverManagerDataSource.java:285)\n\tat com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:175)\n\tat com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:220)\n\tat com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:206)\n\tat com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:203)\n\tat com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1138)\n\tat com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1125)\n\tat com.mchange.v2.resourcepool.BasicResourcePool.access$700(BasicResourcePool.java:44)\n\tat com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:1870)\n\tat com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:696)\n"}

Please let me know how to resolve the RDS and how to connect to RDS

from old_issues_repo.

vadimeisenbergibm avatar vadimeisenbergibm commented on September 22, 2024

Can you try to call the port something like tcp-jdbc?

from old_issues_repo.

roopagowda avatar roopagowda commented on September 22, 2024

Thanks for the quick response Sir.

I have changed like this:


ports:
  - name: tcp-jdbc
    number: 3306
    protocol: tcp

even then I am ending up with the error. Sir.

from old_issues_repo.

vadimeisenbergibm avatar vadimeisenbergibm commented on September 22, 2024

@roopagowda

Here is an example of connecting to external MySQL instance https://preliminary.istio.io/blog/2018/egress-tcp/ .

Can you try to connect by using mysql command line or telnet?

from old_issues_repo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.