配置 java 环境
yum list java*
yum -y install java-1.8.0-openjdk
java -version
下载 kafaka
wget http://archive.apache.org/dist/kafka/1.0.0/kafka_2.11-1.0.0.tgz
tar -xzf kafka_2.11-1.0.0.tgz
cd kafka_2.11-1.0.0
安装 librdkafka
默认会安装在/usr/local/目录下的lib和include/librdkafka目录中
git clone https://github.com/edenhill/librdkafka.git
cd librdkafka/
./configure
make
sudo make install
安装 php 扩展
git clone https://github.com/arnaud-lb/php-rdkafka.git
cd php-rdkafka
phpize
./configure --with-php-config=/www/server/php/56/bin/php-config (确认 php-config 文件路径)
make
make test (按提示取消禁用函数)
make install
修改php.ini
增加 extension=rdkafka.so
启动 zookeeper 服务
bin/zookeeper-server-start.sh [-daemon] config/zookeeper.properties
启动 kafka 服务
bin/kafka-server-start.sh [-daemon] config/server.properties