34补3-3rhcs集群基础应用

author author     2022-08-08     504

关键词:

03rhcs集群基础应用


配置luci/ricci(图形界面,重点掌握)

配置环境

node1:192.168.1.151CentOS6.5

node2:192.168.1.152CentOS6.5

node3:192.168.1.153CentOS6.5

node3:192.168.1.154CentOS6.5

[[email protected] ~]# ansible ha -m shell -a ‘service NetworkManager stop‘

[[email protected] ~]# ansible ha -m shell -a ‘chkconfig NetworkManager off‘

[[email protected] ~]# ansible ha -m shell -a ‘yum -y install httpd‘


[[email protected] ~]# yum -y install ricci

[[email protected] ~]# service ricci start

[[email protected] ~]# netstat -tunlp

Active Internet connections (only servers)

Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name   

tcp        0      0 0.0.0.0:111                 0.0.0.0:*                   LISTEN      1181/rpcbind        

tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN      1485/sshd           

tcp        0      0 127.0.0.1:631               0.0.0.0:*                   LISTEN      1372/cupsd          

tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN      1561/master         

tcp        0      0 0.0.0.0:47549               0.0.0.0:*                   LISTEN      1310/rpc.statd      

tcp        0      0 :::111                      :::*                        LISTEN      1181/rpcbind        

tcp        0      0 :::22                       :::*                        LISTEN      1485/sshd           

tcp        0      0 ::1:631                     :::*                        LISTEN      1372/cupsd          

tcp        0      0 ::1:25                      :::*                        LISTEN      1561/master         

tcp        0      0 :::46746                    :::*                        LISTEN      1310/rpc.statd      

tcp        0      0 :::11111                    :::*                        LISTEN      28236/ricci         

udp        0      0 0.0.0.0:111                 0.0.0.0:*                               1181/rpcbind        

udp        0      0 0.0.0.0:631                 0.0.0.0:*                               1372/cupsd          

udp        0      0 0.0.0.0:638                 0.0.0.0:*                               1310/rpc.statd      

udp        0      0 0.0.0.0:56208               0.0.0.0:*                               1310/rpc.statd      

udp        0      0 0.0.0.0:932                 0.0.0.0:*                               1181/rpcbind        

udp        0      0 :::111                      :::*                                    1181/rpcbind        

udp        0      0 :::932                      :::*                                    1181/rpcbind        

udp        0      0 :::35625                    :::*                                    1310/rpc.statd      

[[email protected] ~]# yum -y install ricci && service ricci start

[[email protected] ~]# yum -y install ricci && service ricci start

[[email protected] ~]# ansible ha -m shell -a ‘echo ricci:mageedu | chpasswd‘

[[email protected] ~]# yum -y install luci

[[email protected] ~]# service luci start

Point your web browser to https://node4:8084 (or equivalent) to access luci

#可通过https://192.168.1.154:8084端口访问luci  


以下操作通过浏览器进行

1、登录luci

技术分享

2、创建集群

技术分享

技术分享

备注:node结点的密码为ricci的密码,此处为mageedu,而不是root用户的登录密码


3、创建Fence Devices

依次选择“tcluster”、“Fence Devices”“Add”

技术分享

在出现的对话框中选择合适的配置,本次实验不作配置


4、创建Failover Domains(故障转移域)

依次选择“tcluster”、“Failover Domains”、“Add

技术分享

技术分享

技术分享


5、配置Resources

1IP Address

技术分享

点击“Apply”


2)添加Script资源

技术分享

点击“Apply”

6、配置Service Groups

1)创建webservice group

技术分享

2)在webservice group中添加资源

添加之前定义的IP AddressScript资源

技术分享

技术分享

3)启动webservice组资源

技术分享

技术分享

发现服务正运行在node2结点


测试:

[[email protected] ~]# vim /var/www/html/index.html

<h1>node2</h1>

[[email protected] ~]# vim /var/www/html/index.html

<h1>node3</h1>

技术分享


测试1:转移运行结点至node3

技术分享

技术分享

技术分享


配置cman/rgmanager(命令行界面,了解)

[[email protected] ~]# ansible ha -m shell -a ‘service NetworkManager stop‘

[[email protected] ~]# ansible ha -m shell -a ‘chkconfig NetworkManager off‘

#程序安装

[[email protected] ~]# yum -y install cman rgmanager

[[email protected] ~]# yum -y install cman rgmanager

[[email protected] ~]# yum -y install cman rgmanager

#创建集群

[[email protected] ~]# ccs_tool create tcluster

[[email protected] ~]# cd /etc/cluster/

[[email protected] cluster]# ls

cluster.conf  cman-notify.d

[[email protected] cluster]# vim cluster.conf 

[[email protected] cluster]# ccs_tool addfence meatware fence-manual

[[email protected] cluster]# ccs_tool lsfence

Name             Agent

meatware         fence-manual

[[email protected] cluster]# ccs_tool addnode -n 1 -f meatware node1

[[email protected] cluster]# ccs_tool addnode -n 2 -f meatware node2 

[[email protected] cluster]# ccs_tool addnode -n 3 -f meatware node3 

[[email protected] cluster]# ccs_tool lsnode


Cluster name: tcluster, config_version: 5


Nodename                        Votes Nodeid Fencetype

node1                              1    1    meatware

node2                              1    2    meatware

node3                              1    3    meatware

[[email protected] ~]# ansible ha -m copy -a ‘src=/etc/cluster/cluster.conf dest=/etc/cluster/‘

#启动cman

[[email protected] cluster]# service cman start

[[email protected] ~]# service cman start

[[email protected] ~]# service cman start

[[email protected] cluster]# clustat

Cluster Status for tcluster @ Fri Oct 14 10:25:14 2016

Member Status: Quorate


Member Name                              ID   Status

------ ----                              ---- ------

node1                                        1 Online, Local

node2                                        2 Online

node3                                        3 Online


[[email protected] cluster]# service rgmanager start

[[email protected] ~]# service rgmanager start

[[email protected] ~]# service rgmanager start

[[email protected] cluster]# cman_tool status

Version: 6.2.0

Config Version: 5

Cluster Name: tcluster

Cluster Id: 10646

Cluster Member: Yes

Cluster Generation: 16

Membership state: Cluster-Member

Nodes: 3

Expected votes: 3

Total votes: 3

Node votes: 1

Quorum: 2  

Active subsystems: 8

Flags: 

Ports Bound: 0 177  

Node name: node3

Node ID: 3

Multicast addresses: 239.192.41.191 

Node addresses: 192.168.1.153 


[[email protected] cluster]# cman_tool nodes

Node  Sts   Inc   Joined               Name

  1   M      8   2016-10-14 10:23:55  node1

  2   M     12   2016-10-14 10:24:04  node2

  3   M     16   2016-10-14 10:24:09  node3

  

[[email protected] cluster]# cman_tool services

fence domain

member count  3

victim count  0

victim now    0

master nodeid 1

wait state    none

members       1 2 3 


dlm lockspaces

name          rgmanager

id            0x5231f3eb

flags         0x00000000 

change        member 3 joined 1 remove 0 failed 0 seq 3,3

members       1 2 3


[[email protected] cluster]# service ricci start

[[email protected] cluster]# service ricci start

[[email protected] cluster]# service ricci start

[[email protected] ~]# yum -y install luci

[[email protected] cluster]# yum groupinfo "High availability"

Group: High Availability

Description: Infrastructure for highly available services and/or shared storage.

Mandatory Packages:

  cman

Default Packages:

  ccs

  omping

  rgmanager

Optional Packages:

  cluster-cim

  cluster-glue-libs-devel

  cluster-snmp

  clusterlib-devel

  corosynclib-devel

  fence-virtd-checkpoint

  foghorn

  libesmtp-devel

  openaislib-devel

  pacemaker

  pacemaker-doc

  pacemaker-libs-devel

  pcs

  python-repoze-what-quickstart

  resource-agents

  sbd

  

[[email protected] ~]# service luci start


本文出自 “追梦” 博客,请务必保留此出处http://sihua.blog.51cto.com/377227/1861947

34补-2hacluster基础及heartbeat实现ha

HACluster基础及heartbeat实现HA配置环境node1:192.168.1.121 CentOS6.7node2:192.168.1.122 CentOS6.7node3:192.168.1.123 CentOS6.7vip192.168.1.80配置前准备  #cat/etc/hosts 127.0.0.1 localhostlocalhost.lo 查看详情

mongodb集群架构(代码片段)

一、MongoDB复制集特性复制集群的架构复制集群搭建复制集群的选举配置1.复制集群的架构2.复制集群搭建基础示例2.复制集群搭建基础示例主节点配置dbpath=/data/mongo/masterport=27017fork=truelogpath=master.logreplSet=MyCluster从... 查看详情

34补2hacluster与corosyncpacemakerdrbd

HACluster基础及heartbeat实现HA配置环境node1:192.168.1.121 CentOS6.7node2:192.168.1.122 CentOS6.7node3:192.168.1.123 CentOS6.7vip192.168.1.88配置前准备  #cat/etc/hosts 127.0.0.1 localhostlocalhost.lo 查看详情

34补3-4rhcs之gfs2和clvm

04 rhcs之gfs2和clvm使用共享存储创建高可用集群 [[email protected]~]#yum-yinstallscsi-target-utils [[email protected]~]#vim/etc/tgt/targets.conf  在末尾添加 <targetiqn.2015-01.com.magedu:node4.t1> b 查看详情

kubectl命令再也不用记了,自动补全提示真好(代码片段)

Kubectl命令概览Kubernetes提供的kubectl命令是与集群交互最直接的方式,v1.6版本的kubectl命令参考图如下:Kubectl的子命令主要分为8个类别:基础命令(初学者都会使用的)基础命令(中级)部署命令集群管理命令故障排查和调试命... 查看详情

hbase基础(特点架构应用场景集群搭建ha设计)这一篇就够了(代码片段)

Hbase基础(特点、架构、应用场景、集群搭建、HA设计)这一篇就够了1.Hbase特点2.HbaseVSRDBMS3.Hbase架构及版本选择4.Hbase应用场景5.Ntp(多个主机时间同步)6.Hadoop分布式集群搭建7.Zookeeper分布式集群搭建(数量奇... 查看详情

zookeeper集群搭建(使用docker-compose)及基础操作

...务、分布式同步、组服务等。使用docker-compose搭建Zookeeper集群作为初学者的话没有那么多虚拟机的话,可以使用docker来运行集群。编写docker-compose.ymlversion:'3.8'services:zk1:image:zookeeper:3.5.7restart:alwayscontainer_name:zk1hostname:zk1ne... 查看详情

使用solr完成自动补全(续)

说明–关于短语补全使用Solr完成自动补全主要介绍的是关键字补全。实际上将下面的设置,<fieldname="suggestion"type="text_spell"indexed="true"stored="true"multiValued="true"/>更改为如下࿰... 查看详情

使用solr完成自动补全(续)

说明–关于短语补全使用Solr完成自动补全主要介绍的是关键字补全。实际上将下面的设置,<fieldname="suggestion"type="text_spell"indexed="true"stored="true"multiValued="true"/>更改为如下࿰... 查看详情

补基础:自学:计算机科学导论第四章数据运算

4.1逻辑运算:指那些应用于模式中的一个二进制位,或在两个模式中相应的两个二进制位的相同基本运算。4.1.1位层次上的逻辑运算0代表逻辑假,1代表逻辑真。4种操作:非(NOT):只有一个输入如果输入是0,则输出为1。反之... 查看详情

kubectl命令再也不用记了,自动补全提示真好(代码片段)

Kubectl命令概览Kubernetes提供的kubectl命令是与集群交互最直接的方式,v1.6版本的kubectl命令参考图如下:Kubectl的子命令主要分为8个类别:基础命令(初学者都会使用的)基础命令(中级)部署命令集群管... 查看详情

视频播放小程序-小程序媒体api-基础入门(代码片段)

视频播放效果: 视频列表的切换方法视频自动播放方法视频随机颜色弹幕效果一。界面设计1.创建项目videoDemo将app.json文件内pages属性中的”pages/logs/logs“删除删除utils文件夹及其内容删除index.wxml和index.wxss中的全部代码删除i... 查看详情

elasticsearch-edgengram自动补全

现代搜索离不开自动补全功能。正是有了该功能,用户可以方便地找到那些不知如何拼写的条目。看如下索引配置:"settings":  "analysis":     "analyzer":       "standardWithEdgeNGram":         &#... 查看详情

select2智能补全模糊查询select2的下拉选择框使用(代码片段)

  我们在上篇文章中已经在SpringMVC基础框架的基础上应用了BootStrap的后台框架,在此基础上记录select2的使用。应用bootstrap模板 基础项目源码下载地址为:SpringMVC+Shiro+MongoDB+BootStrap基础框架  我们在基础项目中已经做... 查看详情

实战搜索引擎solr集群和应用

...olrBean第08讲solrj语法详解第09讲Solrj之Multicore查询第10讲Solr集群安装与配置(一)第11讲Solr集群安装与配置(二)第12讲SolrCl 查看详情

storm学习教程

...将学到如何创建一个Stormtopologies以及怎样把它部署到storm集群上。本教程中,Java将作为主要使用的语言,但在一小部分示例中将会使用Python来阐述storm处理多语言的能力。预备工作本教程使用的例子来自于 storm-starter 项... 查看详情

kubernetes——kubernetes基础+部署kubernetes集群(代码片段)

Kubernetes基础+部署Kubernetes集群Kubernetes介绍1.1应用部署方式演变1.2Kubernetes简介1.3Kubernetes组件1.4Kubernetes概念集群环境搭建2.1环境规划2.1.1集群类型2.1.2安装方式2.1.3主机规划2.2环境初始化2.2.1安装Docker2.2.2安装kubernetes组件2.2.3准备... 查看详情

cmdb在基础服务体系中的核心位置

...控系统我们需要以上的对应关系,监控到每个应用、每个集群以及每台机器上的关键信息。2、发布系统我们需要将每个应用对应的代码进行编译打包,然后发布到对应集群的主机上,也需要这个对应关系,这一点我在后面的持... 查看详情