• CentOS6.4安装Zookeeper-3.4.12图解教程


    注:图片如果损坏,点击文章链接:https://www.toutiao.com/i6595380916590215683/

    安装工具

    VMware_workstation_full_12.5.2

    CentOS6-Base-163

    CentOS-6.4-x86_64-bin-DVD1.iso

    VM运行配置

    双击运行VM

    CentOS6.4安装Zookeeper-3.4.12

     

    运行界面

    CentOS6.4安装Zookeeper-3.4.12

     

    点击下一步

    CentOS6.4安装Zookeeper-3.4.12

     

    如图操作,选择“稍后安装操作系统”,点击下一步

    CentOS6.4安装Zookeeper-3.4.12

     

    如图操作,选择Linux、CentOS64

    CentOS6.4安装Zookeeper-3.4.12

     

    如图操作,设置“虚拟机名称”、“位置”,建议不要用中文名称,安装路径不要有中文、不要安装在C盘系统盘。

    CentOS6.4安装Zookeeper-3.4.12

     

    设置磁盘容量,磁盘容量先按照给定参数设置,具体大小可以大一点。

    CentOS6.4安装Zookeeper-3.4.12

     

    如图操作点击完成

    CentOS6.4安装Zookeeper-3.4.12

     

    虚拟机界面

    CentOS6.4安装Zookeeper-3.4.12

     

    VM设置虚拟机参数

    点击“编辑虚拟机设置”

    CentOS6.4安装Zookeeper-3.4.12

     

    进入“虚拟机设置”对话框

    CentOS6.4安装Zookeeper-3.4.12

     

    设置内存为2G

    CentOS6.4安装Zookeeper-3.4.12

     

    选择处理器设置

    CentOS6.4安装Zookeeper-3.4.12

     

    选择CentOS镜像文件

    CentOS6.4安装Zookeeper-3.4.12

     

    点击确定

    CentOS6.4安装Zookeeper-3.4.12

     

    进入虚拟机界面,开启虚拟机

    CentOS6.4安装Zookeeper-3.4.12

     

    进入进程

    CentOS6.4安装Zookeeper-3.4.12

     

    进入下一步

    CentOS6.4安装Zookeeper-3.4.12

     

    选择语言,点击下一步

    CentOS6.4安装Zookeeper-3.4.12

     

    一直下一步

    CentOS6.4安装Zookeeper-3.4.12

     

    CentOS6.4安装Zookeeper-3.4.12

     

    CentOS6.4安装Zookeeper-3.4.12

     

    CentOS6.4安装Zookeeper-3.4.12

     

    CentOS6.4安装Zookeeper-3.4.12

     

    CentOS6.4安装Zookeeper-3.4.12

     

    CentOS6.4安装Zookeeper-3.4.12

     

    CentOS6.4安装Zookeeper-3.4.12

     

    重启系统

    CentOS6.4安装Zookeeper-3.4.12

     

    进入系统

    CentOS6.4安装Zookeeper-3.4.12

     

    为了方便我们后面的操作我们需要做一些配置

    首先我们设置网络,选择编辑

    CentOS6.4安装Zookeeper-3.4.12

     

    更改权限

    CentOS6.4安装Zookeeper-3.4.12

     

    CentOS6.4安装Zookeeper-3.4.12

     

    点完确定后,然后再进去查看下网关

    CentOS6.4安装Zookeeper-3.4.12

     

    点击“DHCP设置”进入修改IP地址包含100的地址。

    CentOS6.4安装Zookeeper-3.4.12

     

    点取消,记住这个网关

    使用root和密码登录到系统中,

    我先换下主机名:需要修改两处:一处是/etc/sysconfig/network,另一处是/etc/hosts,只修改任一处会导致系统启动异常。首先切换到root用户,将名字改为wangstorm1

    1. vi /etc/sysconfig/networkHOSTNAME=localhost.localdomain #修改localhost.localdomain为wangstrom1
    2. vi /etc/hosts127.0.0.1 localhost.localdomain #修改localhost.localdomain为wangstrom1
    3. reboot
    CentOS6.4安装Zookeeper-3.4.12

     

    设置网卡

    CentOS6.4安装Zookeeper-3.4.12

     

    CentOS6.4安装Zookeeper-3.4.12

     

    修改参数

    CentOS6.4安装Zookeeper-3.4.12

     

    重启网络

    CentOS6.4安装Zookeeper-3.4.12

     

    CentOS6.4安装Zookeeper-3.4.12

     

    现在我们用远程工具登录一下

    CentOS6.4安装Zookeeper-3.4.12

     

    新建一个Session

    CentOS6.4安装Zookeeper-3.4.12

     

    CentOS6.4安装Zookeeper-3.4.12

     

    CentOS6.4安装Zookeeper-3.4.12

     

    连接上了,接下来我们CRT就可以了,不需要再用VM了,VM操作不是太方便

    CentOS6.4安装Zookeeper-3.4.12

     

    我们设置下YUM源,先点击这个按钮

    CentOS6.4安装Zookeeper-3.4.12

     

    找这个文件,把文件拖拽到右面

    CentOS6.4安装Zookeeper-3.4.12

     

    我们查看文件已经进来了

    CentOS6.4安装Zookeeper-3.4.12

     

    我们备份原来的文件

    CentOS6.4安装Zookeeper-3.4.12

     

    清除原来的yum

    CentOS6.4安装Zookeeper-3.4.12

     

    更新yum库

    CentOS6.4安装Zookeeper-3.4.12

     

    我们安装VIM测试一下

    CentOS6.4安装Zookeeper-3.4.12

     

    关闭selinux

    CentOS6.4安装Zookeeper-3.4.12

     

    CentOS6.4安装Zookeeper-3.4.12

     

    CentOS6.4安装Zookeeper-3.4.12

     

    停止防火墙功能

    CentOS6.4安装Zookeeper-3.4.12

     

    安装Java,将Java安装包上传到Linux中

    CentOS6.4安装Zookeeper-3.4.12

     

    解压缩jdk

    CentOS6.4安装Zookeeper-3.4.12

     

    查看文件

    CentOS6.4安装Zookeeper-3.4.12

     

    修改/etc/profile文件,配置java环境

    CentOS6.4安装Zookeeper-3.4.12

     

    配置内容

    CentOS6.4安装Zookeeper-3.4.12

     

    配置语句生效

    CentOS6.4安装Zookeeper-3.4.12

     

    查看是否成功

    CentOS6.4安装Zookeeper-3.4.12

     

    克隆一台虚拟机storm2

    将storm1关机,然后开始克隆

    CentOS6.4安装Zookeeper-3.4.12

     

    CentOS6.4安装Zookeeper-3.4.12

     

    CentOS6.4安装Zookeeper-3.4.12

     

    CentOS6.4安装Zookeeper-3.4.12

     

    CentOS6.4安装Zookeeper-3.4.12

     

    CentOS6.4安装Zookeeper-3.4.12

     

    CentOS6.4安装Zookeeper-3.4.12

     

    复制过后的虚拟机不能直接使用,需要进行如下操作

    CentOS6.4安装Zookeeper-3.4.12

     

    CentOS6.4安装Zookeeper-3.4.12

     

    CentOS6.4安装Zookeeper-3.4.12

     

    将新生成的MAC更改,然后更改IP

    CentOS6.4安装Zookeeper-3.4.12

     

    如果出现这个问题,不出现可以忽略

    CentOS6.4安装Zookeeper-3.4.12

     

    错误原因:

    克隆的Linux系统在新的机器上运行,新服务器网卡物理地址已经改变。而/etc/udev/rules.d/70-persistent-net.rules这个文件确定了网卡和MAC地址的信息之间的绑定,克隆后的网卡的MAC已经发生了变化,所以导致系统认为网络设备不存在,网络不能正常启动。另外一个就是/etc/sysconfig/network-scripts/ifcfg-eth0里面MAC地址也是以前的旧信息。

    关于/etc/udev/rules.d/70-persistent-net.rules这个文件,系统在启动时会自动监测变化,然后由/lib/udev/write_net_rules写入到/etc/udev/rules.d/70-persistent-net.rules中一个新的配置节,网卡的的序号依次递增(如原来为eth0,则修改第一后生成一个eth1,再次修改后生成一个eth2...),且其ATTR{address}的值为当前网卡对应的mac地址。

    解决方法:

    1:编辑/etc/sysconfig/network-scripts/ifcfg-eth0配置文件,将ifcfg-eth0的配置文件里里面以前的关于MAC地址这一行删除掉或修改。另外克隆的服务器的IP设置的是静态IP,要么修改为一个其它的IP地址或设置为动态IP,重启网卡服务

    2:找到/etc/udev/rules.d/70-persistent-net.rules 删除后重启机器,系统会自动生成一个70-persistent-net.rules文件。

    因为这个文件绑定了网卡和MAC地址,换了网卡以后MAC地址变了,所以不能正常启动,也可以直接编辑这个配置文件把里面的网卡和MAC地址修改成对应的,不过这样多麻烦,直接删除重启,它会自动生成个一个新的文件。

    CentOS6.4安装Zookeeper-3.4.12

     

    重启

    CentOS6.4安装Zookeeper-3.4.12

     

    查询IP

    CentOS6.4安装Zookeeper-3.4.12

     

    然后我们用CRT连接一下

    CentOS6.4安装Zookeeper-3.4.12

     

    修改一下主机名

    CentOS6.4安装Zookeeper-3.4.12

     

    我们看两台机器是否相通,先安装SSH

    CentOS6.4安装Zookeeper-3.4.12

     

    CentOS6.4安装Zookeeper-3.4.12

     

    登录一下

    CentOS6.4安装Zookeeper-3.4.12

     

    安装rzsz

    CentOS6.4安装Zookeeper-3.4.12

     

    上传zookeeper安装包

    CentOS6.4安装Zookeeper-3.4.12

     

    解压压缩包

    CentOS6.4安装Zookeeper-3.4.12

     

    CentOS6.4安装Zookeeper-3.4.12

     

    在根目录下创建一个data目录

    CentOS6.4安装Zookeeper-3.4.12

     

    进入到配置目录

    CentOS6.4安装Zookeeper-3.4.12

     

    修改配置文件,我们先修改下名称,然后开始编辑

    CentOS6.4安装Zookeeper-3.4.12

     

    查看我们刚新建的data的目录路径

    CentOS6.4安装Zookeeper-3.4.12

     

    将路径记录到配置文件中

    CentOS6.4安装Zookeeper-3.4.12

     

    我们进入到data目录

    CentOS6.4安装Zookeeper-3.4.12

     

    新建myid

    CentOS6.4安装Zookeeper-3.4.12

     

    CentOS6.4安装Zookeeper-3.4.12

     

    CentOS6.4安装Zookeeper-3.4.12

     

    CentOS6.4安装Zookeeper-3.4.12

     

    然后我们拷贝zookeeper到另外一台机器

    进入zookeeper目录

    CentOS6.4安装Zookeeper-3.4.12

     

    配置域名wangstorm1和wangstorm2后,拷贝文件

    CentOS6.4安装Zookeeper-3.4.12

     

    如果出现这个问题

    CentOS6.4安装Zookeeper-3.4.12

     

    执行(两台机器都要执行)

    CentOS6.4安装Zookeeper-3.4.12

     

    已经拷贝进来了

    CentOS6.4安装Zookeeper-3.4.12

     

    将wangstorm2中的myid改为2

    CentOS6.4安装Zookeeper-3.4.12

     

    CentOS6.4安装Zookeeper-3.4.12

     

    然后我们进入到bin下面启动命令 两台机器同时启动

    CentOS6.4安装Zookeeper-3.4.12

     

    查看状态

    CentOS6.4安装Zookeeper-3.4.12

     

    CentOS6.4安装Zookeeper-3.4.12

  • 相关阅读:
    项目准备和启动——项目投标
    项目准备和启动——项目可行性分析
    项目准备和启动——项目建议书
    软件项目管理
    项目管理知识体系
    项目的生命周期
    项目管理基本方法
    什么是项目管理?
    Python基础学习——第一弹
    redis
  • 原文地址:https://www.cnblogs.com/bqwzy/p/9559723.html
Copyright © 2020-2023  润新知