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

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

  • 相关阅读:
    Apache POI使用详解
    util.Date与sql.Date转换
    【转】javascript中not defined、undefined、null以及NaN的区别
    SELECT INTO 和 INSERT INTO SELECT 两种表复制语句
    DC维护工具Repadmin
    Outlook 配置exchange 缓慢,无法通过
    Windows 服务器站点设置
    Exchange 挂载点权限问题
    Windwos 查看WWN Number
    Exchange 2016 多站点创建oab shadow 副本
  • 原文地址:https://www.cnblogs.com/cloud-yongqing/p/14842140.html
Copyright © 2011-2022 走看看