zoukankan      html  css  js  c++  java
  • 集群学习笔记1-创建一个简单的集群

    准备工作: 准备5台虚拟机  

    classroom   用来做yum源  NTP   

    nodea    172.24.1.6      172.24.16.6

    nodeb    172.24.1.7       172.24.16.7

    nodec    172.24.1.8        172.24.16.8

    storage   172.24.1.5        172.24.16.5

    安装好系统,配好yum源,NTP,写好hosts

     172.25.254.254 classroom

    172.25.254.250 provision.example.com
    172.25.0.10 nodea
    172.25.0.11 nodeb
    172.25.0.12 nodec
    192.168.0.10 nodea.private.example.com
    192.168.0.11 nodeb.private.example.com
    192.168.0.12 nodec.private.example.com

    开始搭建集群

    1. 在nodea nodeb nodec 执行以下命令:

    # yum list all

    # firewall-cmd --permanent --add-service=high-availability

    # firewall-cmd --reload
    # yum install -y pcs fence-agents-all.x86_64 fence-agents-rht.x86_64
    # systemctl start pcsd && systemctl enable pcsd

    以下命令在nodea nodeb nodec 任意一个节点执行即可:
    # id hacluster
    # echo flectrag |passwd --stdin hacluster
    # exit
    # pcs cluster auth nodea.private.example.com nodeb.private.example.com nodec.private.example.com
    # pcs cluster setup --name cluster0 nodea.private.example.com nodeb.private.example.com nodec.private.example.com
    # pcs cluster start --all
    #pcs cluster enable --all
    # pcs status

    若看到如下信息,则集群创建成功

    [root@nodeb ~]# pcs status
    Cluster name: cluster0
    WARNING: no stonith devices and stonith-enabled is not false
    Last updated: Wed Jun 2 17:16:42 2021
    Last change: Wed Jun 2 17:16:26 2021
    Stack: corosync
    Current DC: nodeb.private.example.com (2) - partition with quorum
    Version: 1.1.12-a14efad
    3 Nodes configured
    0 Resources configured


    Online: [ nodea.private.example.com nodeb.private.example.com nodec.private.example.com ]

    Full list of resources:


    PCSD Status:
    nodea.private.example.com: Online
    nodeb.private.example.com: Online
    nodec.private.example.com: Online

    Daemon Status:
    corosync: active/enabled
    pacemaker: active/enabled
    pcsd: active/enabled

    ========================================================================

  • 相关阅读:
    违反并发性: UpdateCommand 影响了预期1条记录中的0条——我的解决方案
    (转)使用DataGridView控件常见问题解答
    C#中如何去除数组中重复的项
    C#中如何去除HTML标记
    (转)中断基本概念
    JavaScript 操作 Cookie
    要有梦想创造卓越的职业生涯
    《暗时间》读书笔记与读后感
    前端攻略系列
    前端攻略系列(一) 前端各种优化(保证持续更新)
  • 原文地址:https://www.cnblogs.com/cloud-yongqing/p/14842140.html
Copyright © 2011-2022 走看看