pgandhap edited a comment on issue #13021:
URL: https://github.com/apache/pulsar/issues/13021#issuecomment-988688837


   @tuteng  Getting error related to postgresql . But postgresql is running in 
local with port 5432 . 
    
   root@9f2800695c6b:/pulsar# bin/pulsar-admin sinks localrun --archive 
./connectors/pulsar-io-jdbc-postgres-2.8.1.nar --tenant public --namespace 
default --inputs my-topic --name jdbc-postgres-sink --sink-config-file 
./connectors/pulsar-postgres-jdbc-sink.yaml --parallelism 1
   WARNING: An illegal reflective access operation has occurred
   WARNING: Illegal reflective access by io.netty.util.internal.ReflectionUtil 
(file:/pulsar/lib/io.netty-netty-common-4.1.66.Final.jar) to constructor 
java.nio.DirectByteBuffer(long,int)
   namespace: "default"
   name: "jdbc-postgres-sink"
   className: "org.apache.pulsar.functions.api.utils.IdentityFunction"
   autoAck: true
   parallelism: 1
   source {
     typeClassName: "org.apache.pulsar.client.api.schema.GenericRecord"
     inputSpecs {
       key: "my-topic"
       value {
       }
     }
     cleanupSubscription: true
   }
   sink {
     className: "org.apache.pulsar.io.jdbc.PostgresJdbcAutoSchemaSink"
     configs: 
"{\"userName\":\"postgres\",\"password\":\"password\",\"jdbcUrl\":\"jdbc:postgresql://localhost:5432/pulsar_postgres_jdbc_sink\",\"tableName\":\"pulsar_postgres_jdbc_sink\"}"
     typeClassName: "org.apache.pulsar.client.api.schema.GenericRecord"
   }
   resources {
     cpu: 1.0
     ram: 1073741824
     disk: 10737418240
   }
   componentType: SINK
   , maxBufferedTuples=1024, functionAuthenticationSpec=null, port=0, 
clusterName=local, maxPendingAsyncRequests=1000, 
exposePulsarAdminClientEnabled=false, metricsPort=0)
   10:11:38.524 [main] INFO  org.apache.pulsar.functions.LocalRunner - 
RuntimeSpawner quit because of
   org.postgresql.util.PSQLException: Connection to localhost:5432 refused. 
Check that the hostname and port are correct and that the postmaster is 
accepting TCP/IP connections.
           at 
org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:285)
 ~[?:?]
           at 
org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49) 
~[?:?]
           at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:211) 
~[?:?]
           at org.postgresql.Driver.makeConnection(Driver.java:459) ~[?:?]
           at org.postgresql.Driver.connect(Driver.java:261) ~[?:?]
           at java.sql.DriverManager.getConnection(DriverManager.java:677) 
~[java.sql:?]
           at java.sql.DriverManager.getConnection(DriverManager.java:189) 
~[java.sql:?]
           at 
org.apache.pulsar.io.jdbc.JdbcAbstractSink.open(JdbcAbstractSink.java:93) ~[?:?]
           at 
org.apache.pulsar.functions.instance.JavaInstanceRunnable.setupOutput(JavaInstanceRunnable.java:812)
 ~[org.apache.pulsar-pulsar-functions-instance-2.8.1.jar:2.8.1]
           at 
org.apache.pulsar.functions.instance.JavaInstanceRunnable.setup(JavaInstanceRunnable.java:217)
 ~[org.apache.pulsar-pulsar-functions-instance-2.8.1.jar:2.8.1]
           at 
org.apache.pulsar.functions.instance.JavaInstanceRunnable.run(JavaInstanceRunnable.java:243)
 ~[org.apache.pulsar-pulsar-functions-instance-2.8.1.jar:2.8.1]
           at java.lang.Thread.run(Thread.java:829) ~[?:?]
   Caused by: java.net.ConnectException: Connection refused (Connection refused)
           at java.net.PlainSocketImpl.socketConnect(Native Method) ~[?:?]
           at 
java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:399) 
~[?:?]
           at 
java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:242)
 ~[?:?]
           at 
java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:224) 
~[?:?]
           at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[?:?]
           at java.net.Socket.connect(Socket.java:609) ~[?:?]
           at org.postgresql.core.PGStream.<init>(PGStream.java:81) ~[?:?]
           at 
org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:93)
 ~[?:?]
           at 
org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:197)
 ~[?:?]
           ... 11 more
   10:12:08.076 [function-timer-thread-13-1] ERROR 
org.apache.pulsar.functions.runtime.RuntimeSpawner - 
public/default/jdbc-postgres-sink-org.postgresql.util.PSQLException: Connection 
to localhost:5432 refused. Check that the hostname and port are correct and 
that the postmaster is accepting TCP/IP connections. Function Container is dead 
with exception.. restarting
   10:12:08.077 [function-timer-thread-13-1] INFO  
org.apache.pulsar.functions.runtime.thread.ThreadRuntime - Unloading JAR files 
for function InstanceConfig(instanceId=0, 
functionId=fc7c41eb-766e-43bd-bc0e-067a798ac807, 
functionVersion=c45b0d8f-41a0-4e65-9d08-55cbd39ae09b, functionDetails=tenant: 
"public"
   
   
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to