zoukankan      html  css  js  c++  java
  • Kafka Linux 安装

       

       

       

       

       

       

    要先设置host, etc/hosts,添加

       

    127.0.0.1 机器名

       

       

    创建目录

       

       

       

    修改日志保存位置

       

       

       

       

       

       

       

    启动kafka

       

       

       

    启动脚本 内容 启动脚本后面加&后台运行,如果不加centos 6.5一直显示启动,不能进入到窗口页面

    #!/bin/bash

    #chkconfig:2345 99 90

    #description:kafka

    #processname:kafka

    kafka="/usr/soft/kafka_2.11-0.9.0.1/bin/kafka-server-start.sh"

    config="/usr/soft/kafka_2.11-0.9.0.1/config/server.properties"

    kafkastop="/usr/soft/kafka_2.11-0.9.0.1/bin/kafka-server-stop.sh"

    case $1 in

    start) $kafka $config;;

    stop) $kafkastop;;

    *) echo "require start|stop" ;;

    esac

       

       

    保存文件名为kafka

       

       

       

       

    创建主题

       

    生产者

       

       

       

    打开配置文件 

    [root@localhost ~]# vi /etc/sysconfig/iptables

    正确的配置文件 

    # Firewall configuration written by system-config-firewall
    # Manual customization of this file is not recommended.
    *filter
    :INPUT ACCEPT [
    0:0]
    :FORWARD ACCEPT [
    0:0]
    :OUTPUT ACCEPT [
    0:0]
    -A INPUT -m statestate ESTABLISHED,RELATED -j ACCEPT
    -A INPUT -p icmp -j ACCEPT
    -A INPUT -i lo -j ACCEPT
    -A INPUT -m statestate NEW -m tcp -p tcp –dport
    22 -j ACCEPT
    -A INPUT -m statestate NEW -m tcp -p tcp –dport
    80 -j ACCEPT
    -A INPUT -j REJECT –reject-with icmp-host-prohibited
    -A FORWARD -j REJECT –reject-with icmp-host-prohibited
    COMMIT

    -A INPUT -m statestate NEW -m tcp -p tcp –dport * -j ACCEPT

    注意点:新开放的端口一定要在端口22后面 

    重启防火墙使配置生效 

    [root@localhost ~]# /etc/init.d/iptables restart

    其它 

    查看开放端口 

    [root@localhost ~]# /etc/init.d/iptables status

       

       

       

       

       

       

  • 相关阅读:
    Golang mysql数据库
    C++ list结构体变量排序
    VS2013 ERROR MSB8020
    error C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation
    error C2664: “FILE *fopen(const char *,const char *)”: 无法将参数 1 从“LPCTSTR”转换为“const char *”
    error C4430: missing type specifier
    虚拟地址转物理地址
    vs2013 x64 编译汇编代码
    fs寄存器相关,PEB,TEB
    boost 1.57 vs2013 编译
  • 原文地址:https://www.cnblogs.com/liuyuhua/p/5945474.html
Copyright © 2011-2022 走看看