These are chat archives for arnaud-lb/php-rdkafka

18th
Nov 2016
Paul Dragoonis
@dragoonis
Nov 18 2016 12:56
Hello everyone! :D
Hey @edenhill great to see you here :)
Paul Dragoonis
@dragoonis
Nov 18 2016 13:01
For the life of me I can't get the broker address to change from 127.0.0.1 :(
    private function initialize(array $brokers)
    {
        $conf = new ConsumerConf();
        $conf->set('metadata.broker.list', implode(',', $brokers));
        $consumer = new Consumer($conf);

        $consumer->addBrokers(implode(',', $brokers));
        $this->setConsumer($consumer);
    }
didn't work with just ->addBrokers(), tried the metadata.broker.list too, still tries to go to 127.0.0.1 :( :(
Paul Dragoonis
@dragoonis
Nov 18 2016 13:11
Nobody seems to be around - I've raised this bug - arnaud-lb/php-rdkafka#92
Magnus Edenhill
@edenhill
Nov 18 2016 13:19
You shouldn't use addBrokers, config is enough
Paul Dragoonis
@dragoonis
Nov 18 2016 13:19
let me remove addBrokers()
Magnus Edenhill
@edenhill
Nov 18 2016 13:19
Can you print the string you set?
Paul Dragoonis
@dragoonis
Nov 18 2016 13:20
No change - yes here's the string.
        $conf = new ConsumerConf();
        $conf->set('metadata.broker.list', 'xx.xx.xx.xx:9092');
        $consumer = new Consumer($conf);
%3|1479475193.723|ERROR|rdkafka#consumer-1| 127.0.0.1:9092/1001: Connect to ipv4#127.0.0.1:9092 failed: Connection refused
Magnus Edenhill
@edenhill
Nov 18 2016 13:21
Ah, 127.0.0.1 is coming from the broker. Check its advertised.listener config
Paul Dragoonis
@dragoonis
Nov 18 2016 13:21
interesting, do you think ti's talking to remote broker
but broker isn't listening on external IP ?
suggestion on how I can run sniffer on remote server, on specific port ? to check incoming traffic
I'm running kafka using this docker IMG - https://hub.docker.com/r/wurstmeister/kafka/
aha
docker-compose.yml was set to this .. tweaking
      KAFKA_ADVERTISED_HOST_NAME: 127.0.0.1
Paul Dragoonis
@dragoonis
Nov 18 2016 13:30
I'm able to connect to the broker now, that ENV var becomes advertised.host.name
still some issues, but this is good progress - thanks @edenhill
Magnus Edenhill
@edenhill
Nov 18 2016 13:31
👍
Paul Dragoonis
@dragoonis
Nov 18 2016 13:32
I'm replacing another tech stack with a kafka solution, I need to learn kafka FAST! what's your suggestions on best places to learn from ?
Paul Dragoonis
@dragoonis
Nov 18 2016 13:45
@edenhill this is what's being set in server.properties
#advertised.listeners=PLAINTEXT://your.host.name:9092
it's commented out ..
but these are at the end of the file
port=9092
create.topics=users:1:1
advertised.host.name=xx.xx.xx.xx
advertised.port=9092
Magnus Edenhill
@edenhill
Nov 18 2016 14:07
Make sure that host and port is reachable from the client
And I believe.. Host.name was replaced by advertised.listeners
Paul Dragoonis
@dragoonis
Nov 18 2016 14:07
indeed, i am on kafka 0.10
so i removed advertised.host/port, advertised.listeners=PLAINTEXT://<my ip>:9092
however when kafka boots, it doesn't fully finish booting, just hangs there (after making the topic)
Magnus Edenhill
@edenhill
Nov 18 2016 14:14
Maybe it fails to reach other brokers, or zk
Paul Dragoonis
@dragoonis
Nov 18 2016 14:14
Only have 1 broker, this one
it can access ZK
Paul Dragoonis
@dragoonis
Nov 18 2016 14:21
@edenhill which versions of kafka does php-rdkafka support? README says
PHP-rdkafka is a thin librdkafka binding providing a working PHP 5 / PHP 7 Kafka 0.8 / 0.9 client.
does this mean 0.10 is not supported ?
Magnus Edenhill
@edenhill
Nov 18 2016 14:41
It supports all >=0.8 versions
Paul Dragoonis
@dragoonis
Nov 18 2016 14:47
That's good to hear
Paul Dragoonis
@dragoonis
Nov 18 2016 15:51
@edenhill can you help me find out what version of the kafka protocol my PHP ext is using?
also does the Producer class require access to remote zookeeper?
$rk = new RdKafka\Producer($conf);