【新版迪士尼彩乐园+手机版】全套源码分享下载

新版迪士尼彩乐园+手机版】全套源码分享下载地址:http://wowotouba.com/thread-596-1-1.html

1、安装前期准备

①、准备两块独立磁盘
[root@node-001 ~]# fdisk -l | grep /dev/vdb
Disk /dev/vdb: 107.4 GB, 107374182400 bytes, 209715200 sectors

[root@node-002 ~]# fdisk -l | grep /dev/vdb
Disk /dev/vdb: 107.4 GB, 107374182400 bytes, 209715200 sectors

②、关闭防火墙和SELINUX
systemctl stop firewalld
setenforce 0

③、我们需要修改hosts文件保证hosts之间能够互相访问
[root@node-001 ~]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
10.17.2.140 sz-xh_42f-op-test-docker-001
10.17.2.47 sz-xh_42f-op-test-docker-002
10.17.2.45 node-001
10.17.2.13 node-002

[root@node-002 ~]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
10.17.2.140 sz-xh_42f-op-test-docker-001
10.17.2.47 sz-xh_42f-op-test-docker-002
10.17.2.45 node-001
10.17.2.13 node-002

④、在node-001修改ssh互信
[root@node-001 ~]# ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
17:12:68:f3:bb:96:47:eb:6b:45:12:21:16:57:92:1b root@node-001
The key's randomart image is:
+--[ RSA 2048]----+
| .=.++. |
| +. +E. |
| . o. .+ |
| ..o.. |
| S..o |
| ... . |
| + o |
| + + |
| . +o. |
+-----------------+
[root@node-001 ~]# ssh-copy-id node-002
The authenticity of host '[node-002]:65300 ([10.17.2.13]:65300)' can't be established.
ECDSA key fingerprint is 48:5e:de:e1:d7:b6:f5:55:54:7f:3c:2b:39:70:a8:74.
Are you sure you want to continue connecting (yes/no)? yes
/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
root@node-002's password:

Number of key(s) added: 1

Now try logging into the machine, with: "ssh 'node-002'"
and check to make sure that only the key(s) you wanted were added.

⑤、在node-001和node-002上设置时钟同步
[root@node-001 ~]# crontab -e
*/5 * * * * ntpdate cn.pool.ntp.org ###添加任务

[root@node-002 ~]# crontab -e
*/5 * * * * ntpdate cn.pool.ntp.org ###添加任务

扫描二维码关注公众号,回复: 1637997 查看本文章

在node-001和node-002上可以看到已经添加时间任务:

[root@node-001 ~]# crontab -l
*/5 * * * * ntpdate cn.pool.ntp.org
[root@node-002 ~]# crontab -l
*/5 * * * * ntpdate cn.pool.ntp.org


2、开始安装drbd包

在node-001和node-002操作
[root@node-001 ~]# yum install gcc gcc-c++ make glibc flex kernel kernel-devel kernel-headers -y
[root@node-001 ~]# rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
[root@node-001 ~]# rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
[root@node-001 ~]# yum install -y kmod-drbd84 drbd84-utils

[root@node-002 ~]# yum install gcc gcc-c++ make glibc flex kernel kernel-devel kernel-headers -y
[root@node-002 ~]# rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
[root@node-002 ~]# rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
[root@node-002 ~]# yum install -y kmod-drbd84 drbd84-utils
3、主配置文件

/etc/drbd.conf #主配置文件
/etc/drbd.d/global_common.conf #全局配置文件
/etc/drbd.conf说明
主配置文件中包含了全局配置文件及”drbd.d/”目录下以.res结尾的文件
# You can find an example in /usr/share/doc/drbd.../drbd.conf.example
include "drbd.d/global_common.conf";
include "drbd.d/*.res";
4、修改配置文件

[root@node-001 ~]# cat /etc/drbd.d/global_common.conf
# DRBD is the result of over a decade of development by LINBIT.
# In case you need professional services for DRBD or have
# feature requests visit http://www.linbit.com

global {
usage-count no; #是否参加DRBD使用统计,默认为yes。官方统计drbd的装机量,改为no

# Decide what kind of udev symlinks you want for "implicit" volumes
# (those without explicit volume <vnr> {} block, implied vnr=0):
# /dev/drbd/by-resource/<resource>/<vnr> (explicit volumes)
# /dev/drbd/by-resource/<resource> (default for implict)
udev-always-use-vnr; # treat implicit the same as explicit volumes

# minor-count dialog-refresh disable-ip-verification
# cmd-timeout-short 5; cmd-timeout-medium 121; cmd-timeout-long 600;
}

common {
protocol C; #使用DRBD的同步协议,添加这一行
handlers {
# These are EXAMPLE handlers only.
# They may have severe implications,
# like hard resetting the node under certain circumstances.
# Be careful when choosing your poison.

pri-on-incon-degr "/usr/lib/drbd/notify-pri-on-incon-degr.sh; /usr/lib/drbd/notify-emergency-reboot.sh; echo b > /proc/sysrq-trigger ; reboot -f";
pri-lost-after-sb "/usr/lib/drbd/notify-pri-lost-after-sb.sh; /usr/lib/drbd/notify-emergency-reboot.sh; echo b > /proc/sysrq-trigger ; reboot -f";
local-io-error "/usr/lib/drbd/notify-io-error.sh; /usr/lib/drbd/notify-emergency-shutdown.sh; echo o > /proc/sysrq-trigger ; halt -f";
# fence-peer "/usr/lib/drbd/crm-fence-peer.sh";
# split-brain "/usr/lib/drbd/notify-split-brain.sh root";
# out-of-sync "/usr/lib/drbd/notify-out-of-sync.sh root";
# before-resync-target "/usr/lib/drbd/snapshot-resync-target-lvm.sh -p 15 -- -c 16k";
# after-resync-target /usr/lib/drbd/unsnapshot-resync-target-lvm.sh;
# quorum-lost "/usr/lib/drbd/notify-quorum-lost.sh root";
}

startup {
# wfc-timeout degr-wfc-timeout outdated-wfc-timeout wait-after-sb
}

options {
# cpu-mask on-no-data-accessible

# RECOMMENDED for three or more storage nodes with DRBD 9:
# quorum majority;
# on-no-quorum suspend-io | io-error;
}

disk {
on-io-error detach; #配置I/O错误处理策略为分离
#size on-io-error fencing disk-barrier disk-flushes
# disk-drain md-flushes resync-rate resync-after al-extents
# c-plan-ahead c-delay-target c-fill-target c-max-rate
# c-min-rate disk-timeout
}

net {
# protocol timeout max-epoch-size max-buffers
# connect-int ping-int sndbuf-size rcvbuf-size ko-count
# allow-two-primaries cram-hmac-alg shared-secret after-sb-0pri
# after-sb-1pri after-sb-2pri always-asbp rr-conflict
# ping-timeout data-integrity-alg tcp-cork on-congestion
# congestion-fill congestion-extents csums-alg verify-alg
# use-rle
}
syncer {
rate 1024M; #设置主备节点同步时的网络速率
}
}

注释: on-io-error 策略可能为以下选项之一
detach 分离:这是默认和推荐的选项,如果在节点上发生底层的硬盘I/O错误,它会将设备运行在Diskless无盘模式下
pass_on:DRBD会将I/O错误报告到上层,在主节点上,它会将其报告给挂载的文件系统,但是在此节点上就往往忽略(因此此节点上没有可以报告的上层)
-local-in-error:调用本地磁盘I/O处理程序定义的命令;这需要有相应的local-io-error调用的资源处理程序处理错误的命令;这就给管理员有足够自由的权力命令命令或是脚本调用local-io-error处理I/O错误
定义一个资源。

猜你喜欢

转载自www.cnblogs.com/bky2171793408/p/9197282.html