You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/08/29 14:53:34 UTC

[GitHub] [pulsar] chlyzzo opened a new issue #11832: 在机器a上安装pulsar的standalone版本,在机器b上使用代码读写topic;通过proxy配置怎么生效,报错Connection reset by peer

chlyzzo opened a new issue #11832:
URL: https://github.com/apache/pulsar/issues/11832


   在机器a上搭建了pulsar的standalone版本(通过apache-pulsar-2.8.0-bin.tar.gz解压),然后执行./bin/pulsar-daemon start standalone;
   接着,在conf/proxy.conf中修改如下参数:
   brokerServiceURL=pulsar://dev.bcc-bdbl-1:6670
   brokerServiceURLTLS=pulsar+ssl://dev.bcc-bdbl-1:6671
   brokerWebServiceURL=http://dev.bcc-bdbl-1:8090
   brokerWebServiceURLTLS=https://dev.bcc-bdbl-1:8453
   bindAddress=dev.bcc-bdbl-1
   advertisedAddress=dev.bcc-bdbl-1
   servicePort=6670
   servicePortTls=6671
   webServicePort=8090
   ------
   然后,启动,./bin/pulsar proxy
   无异常;
   
   最后,在机器b中通过代码方式produce消息:
   
   def main(args: Array[String]): Unit = {
   
       val sparkSession = SparkSession.builder().appName("test-pulsar").master("local[2]").getOrCreate()
   
       // val startingOffsets = topicOffsets(Map("persistent://public/default/my-topic" -> MessageId.fromByteArray(Array(8,33,16,8))))
   
       import sparkSession.implicits._
   
       val user1 = new Users("chly", 3258)
       val user2 = new Users("zzo", 138)
       val user3 = new Users("docker", 458)
       val user4 = new Users("pulsar", 8)
   
       val writeDf = sparkSession.createDataset(Array(user1.toString().getBytes,
           user2.toString().getBytes,user3.toString().getBytes,user4.toString().getBytes,
         ))
   
       val ds = writeDf
          .write
          .format("pulsar")
          .option("service.url", "pulsar://dev.bcc-bdbl-1:6670")
          .option("admin.url", "http://dev.bcc-bdbl-1:8090")
          .option("topic", "topic-bytes-string")
          .save()
   
       sparkSession.stop()
       
     }
   
   ---------
   结果报错:
   	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
   	at java.lang.Thread.run(Thread.java:748)
   Caused by: org.apache.pulsar.client.admin.PulsarAdminException: org.apache.pulsar.shade.javax.ws.rs.ProcessingException: Connection reset by peer
   	at org.apache.pulsar.client.admin.internal.BaseResource.getApiException(BaseResource.java:228)
   	at org.apache.pulsar.client.admin.internal.SchemasImpl.getSchemaInfo(SchemasImpl.java:61)
   	at org.apache.spark.sql.pulsar.SchemaUtils$.uploadPulsarSchema(SchemaUtils.scala:82)
   	... 20 more
   Caused by: org.apache.pulsar.shade.javax.ws.rs.ProcessingException: Connection reset by peer
   	at org.apache.pulsar.client.admin.internal.http.AsyncHttpConnector.apply(AsyncHttpConnector.java:133)
   	at org.apache.pulsar.shade.org.glassfish.jersey.client.ClientRuntime.invoke(ClientRuntime.java:278)
   	at org.apache.pulsar.shade.org.glassfish.jersey.client.JerseyInvocation.lambda$invoke$1(JerseyInvocation.java:767)
   	at org.apache.pulsar.shade.org.glassfish.jersey.internal.Errors.process(Errors.java:316)
   	at org.apache.pulsar.shade.org.glassfish.jersey.internal.Errors.process(Errors.java:298)
   
   ------
   请教下该怎么设置才能在机器b上访问到机器a的pulsar。


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] liangyuanpeng commented on issue #11832: 在机器a上安装pulsar的standalone版本,在机器b上使用代码读写topic;通过proxy配置怎么生效,报错Connection reset by peer

Posted by GitBox <gi...@apache.org>.
liangyuanpeng commented on issue #11832:
URL: https://github.com/apache/pulsar/issues/11832#issuecomment-907808001


   
   Do you mean you use send message to pulsar broker by proxy and it's not work? 
   
   Does work if you just use pulsar broker?


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] Anonymitaet commented on issue #11832: 在机器a上安装pulsar的standalone版本,在机器b上使用代码读写topic;通过proxy配置怎么生效,报错Connection reset by peer

Posted by GitBox <gi...@apache.org>.
Anonymitaet commented on issue #11832:
URL: https://github.com/apache/pulsar/issues/11832#issuecomment-907933283


   Hi @chlyzzo thanks for your issue. 
   
   1. Please use English to communicate so that most of us can understand your problem and give suggestions.
   
   2. If you ensure your problem is caused by doc missing / inaccurate rather than other factors, you can label an issue with `doc-required`. Otherwise, please investigate your issue thoroughly first, thanks.


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] chlyzzo commented on issue #11832: 在机器a上安装pulsar的standalone版本,在机器b上使用代码读写topic;通过proxy配置怎么生效,报错Connection reset by peer

Posted by GitBox <gi...@apache.org>.
chlyzzo commented on issue #11832:
URL: https://github.com/apache/pulsar/issues/11832#issuecomment-907810615


   > Do you mean you send message to pulsar broker by proxy and it's not work?
   > 
   > Does work if you just use pulsar broker?
   
   ------
   first,i just want to send/get message from pulsar, which install machine a; use proxy, beacuse i find the document "https://pulsar.apache.org/docs/en/administration-proxy/", so i try,
   but do not work, on machine b, send message get "Connection reset by peer" error.
   
   


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] chlyzzo commented on issue #11832: on machine a which install pulsar standalone,then send message to machine's pulsar one topic on machine b,but get error Connection reset by peer

Posted by GitBox <gi...@apache.org>.
chlyzzo commented on issue #11832:
URL: https://github.com/apache/pulsar/issues/11832#issuecomment-910163588


   he port 8*** can be connect from other machine, it is my company rule. so change the port then it work


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] liangyuanpeng edited a comment on issue #11832: on machine a which install pulsar standalone,then send message to machine's pulsar one topic on machine b,but get error Connection reset by peer

Posted by GitBox <gi...@apache.org>.
liangyuanpeng edited a comment on issue #11832:
URL: https://github.com/apache/pulsar/issues/11832#issuecomment-907986533


   > send message get "Connection reset by peer" error.  
   
   @chlyzzo 
   I think this error have more message, you can check again.  
   
   I try to use proxy for pulsar standalone and it's working.  
   
   1. set advertisedAddress on standalone.conf
   2. `bin/pulsar standalone`   (machineA)
   3. set pulsar broker info for proxy.conf
   4. `bin/pulsar proxy`  (machineB)
   5. pulsar consumer subscribe topic from proxy
   6. pulsar producer send message to topic from proxy
   7. pulsar consumer received message
   
   > If you ensure your problem is caused by doc missing / inaccurate rather than other factors, you can label an issue with doc-required. Otherwise, please investigate your issue thoroughly first, thanks. 
   
   @Anonymitaet 
   
   
   I can confirm that the doc is fine.
   


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] chlyzzo closed issue #11832: on machine a which install pulsar standalone,then send message to machine's pulsar one topic on machine b,but get error Connection reset by peer

Posted by GitBox <gi...@apache.org>.
chlyzzo closed issue #11832:
URL: https://github.com/apache/pulsar/issues/11832


   


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] chlyzzo commented on issue #11832: on machine a which install pulsar standalone,then send message to machine's pulsar one topic on machine b,but get error Connection reset by peer

Posted by GitBox <gi...@apache.org>.
chlyzzo commented on issue #11832:
URL: https://github.com/apache/pulsar/issues/11832#issuecomment-910163254


   > > send message get "Connection reset by peer" error.
   > 
   > @chlyzzo
   > I think this error have more message, you can check it again.
   > 
   > I try to use proxy for pulsar standalone and it's working.
   > 
   > 1. set advertisedAddress on standalone.conf
   > 2. `bin/pulsar standalone`   (machineA)
   > 3. set pulsar broker info for proxy.conf
   > 4. `bin/pulsar proxy`  (machineB)
   > 5. pulsar consumer subscribe topic from proxy
   > 6. pulsar producer send message to topic from proxy
   > 7. pulsar consumer received message
   > 
   > > If you ensure your problem is caused by doc missing / inaccurate rather than other factors, you can label an issue with doc-required. Otherwise, please investigate your issue thoroughly first, thanks.
   > 
   > @Anonymitaet
   > 
   > I can confirm that the doc is fine.
   
   yes,i change port, then it can work.becase on machine a, the port 8*** can be connect from other machine, it is my company rule.


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] liangyuanpeng edited a comment on issue #11832: 在机器a上安装pulsar的standalone版本,在机器b上使用代码读写topic;通过proxy配置怎么生效,报错Connection reset by peer

Posted by GitBox <gi...@apache.org>.
liangyuanpeng edited a comment on issue #11832:
URL: https://github.com/apache/pulsar/issues/11832#issuecomment-907808001


   Do you mean you send message to pulsar broker by proxy and it's not work? 
   
   Does work if you just use pulsar broker?


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] liangyuanpeng commented on issue #11832: on machine a which install pulsar standalone,then send message to machine's pulsar one topic on machine b,but get error Connection reset by peer

Posted by GitBox <gi...@apache.org>.
liangyuanpeng commented on issue #11832:
URL: https://github.com/apache/pulsar/issues/11832#issuecomment-907986533


   > send message get "Connection reset by peer" error.  
   
   @chlyzzo 
   I think this error have more message, you can check again.  
   
   I try to use proxy for pulsar standalone and it's working.  
   
   1. set advertisedAddress on standalone.conf
   2. `bin/pulsar standalone`   (machineA)
   3. set pulsar broker info for proxy.conf
   4. `bin/pulsar proxy`  (machineB)
   5. pulsar consumer subscribe topic from proxy
   6. pulsar producer send message to topic from proxy
   7. pulsar consumer receive message
   
   > If you ensure your problem is caused by doc missing / inaccurate rather than other factors, you can label an issue with doc-required. Otherwise, please investigate your issue thoroughly first, thanks. 
   
   @Anonymitaet 
   
   
   I can confirm that the doc is fine.
   


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] liangyuanpeng edited a comment on issue #11832: on machine a which install pulsar standalone,then send message to machine's pulsar one topic on machine b,but get error Connection reset by peer

Posted by GitBox <gi...@apache.org>.
liangyuanpeng edited a comment on issue #11832:
URL: https://github.com/apache/pulsar/issues/11832#issuecomment-907986533


   > send message get "Connection reset by peer" error.  
   
   @chlyzzo 
   I think this error have more message, you can check it again.  
   
   I try to use proxy for pulsar standalone and it's working.  
   
   1. set advertisedAddress on standalone.conf
   2. `bin/pulsar standalone`   (machineA)
   3. set pulsar broker info for proxy.conf
   4. `bin/pulsar proxy`  (machineB)
   5. pulsar consumer subscribe topic from proxy
   6. pulsar producer send message to topic from proxy
   7. pulsar consumer received message
   
   > If you ensure your problem is caused by doc missing / inaccurate rather than other factors, you can label an issue with doc-required. Otherwise, please investigate your issue thoroughly first, thanks. 
   
   @Anonymitaet 
   
   
   I can confirm that the doc is fine.
   


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org