文章目录
接上篇我们,我们安装了单机版的kafka,现在我们根据单机版的kafka来搭建kafka配置。是为了可以把一些配置分发到其他机子上,提高效率
安装步骤
1.前置步骤
分别在另外两台机子安装jdk,及解压zk和kafka
删除三台机子的ssh认证,以便文件分发
rm -rf .ssh
2.修改host配置
在101机子上修改host配置
vi /etc/hosts
#配置如下
172.16.2.130 CentOS101
172.16.2.131 CentOS102
172.16.2.132 CentOS103
ping centos102
ping centos103
#测试发现能ping通,说明配置没问题
#将CentOS101本机下的etc/hosts文件下的hosts文件拷贝到CentOS102 和CentOS103下
scp /etc/hosts CentOS102:/etc/
scp /etc/hosts CentOS103:/etc/
3.配置环境变量
#将101机子环境变量信息拷贝到102 103机子上
scp .bashrc CentOS102:~/
scp .bashrc CentOS103:~/
4.关闭102 103机子防火墙
service iptables stop
chkconfig iptables off
chkconfig --list | grep iptables
5.配置时钟服务器
yum install ntp -y
#发现报错如下:
#YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
#Eg. Invalid release/repo/arch combination/
#不要慌,这是因为默认下载的centos镜像来源是国外的,网不通我们换成清华大学开源的镜像站里的即可
#https://mirrors.tuna.tsinghua.edu.cn/centos-vault/6.10/os/x86_64/
#配置镜像如下:
vi /etc/yum.repos.d