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

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

  • 相关阅读:
    WP&Win10仿微信消息框代码分享
    Windows编程中回调函数的使用心得(MFC篇)
    进程间通信之WM_COPYDATA方式反思,回顾和总结
    华为的最新的两道算法设计题
    Python中3元运算符的实现
    Python Logging 模块研究
    LINUX下CPU Load Average的一点研究
    64位系统下,一个32位的程序究竟可以申请到多少内存,4GB还是更多?(一)
    Pyscripter 不能正确调用另一文件中模块的问题的解析(Internal Engine 和 Remote Engine)
    Django 最佳实践
  • 原文地址:https://www.cnblogs.com/cloud-yongqing/p/14842140.html
Copyright © 2011-2022 走看看