RedHat-linux7-虚拟化+集群安装精简手册
Linux虚拟机7.0安装

虚拟机及Linux系统安装指南编制:信盈达研发部深圳信盈达电子有限公司118.1准备安装所需要的软件:安装软件说明:1.1VMware-workstation-full-7.0:虚拟机安装软件包rhel-server-5.3-i386-dvd.iso:映像文件安装码.txt。
VMware-workstation-full-7.0:虚拟机安装软件包中有以下文件:1.21)VM7汉化包完美版;2)New.keygen.exe:破解;3)VMware-workstation-full-7.0虚拟机安装软件。
2.安装虚拟机过程:进入2.1安装虚拟机:点击:VMware-workstation-full-7.0即可弹出如下图1.3所示界面。
点击Next深圳信盈达电子有限公司118.深圳信盈达电子有限公司118.图1-4界面选择Custom 安装后点击next-弹出如图1.5所示界面,点击change 选择安装路径,点击next-进入面--点击next 进入图1-7界面--点击continue 即可进行虚拟机的安装。
注意:integrated virtual debuggers不能选,因为该选项是一些调试工具,为收费的。
图1-5界面深圳信盈达电子有限公司118.图1-6界面图1-7界面图1-8界面图1-9界面图1-10界面虚拟机安装完成后弹出如图1-8界面,点击New.keygen.exe:破解即可弹出如图1-9界面,将序列号图1-8中,点击ENTER后即可完成安装。
安装完成弹出如图1-10界面点击Restart Now重启电脑。
注意:如果计算机不是首次安装虚拟机,那么1-8,1-9界面不会出现,直接从1-7界面跳到1-10汉化包完美版:2.2安装VM7将以上两个文件复制到你安装VMware-workstation-full-7.0安装文件夹中,覆盖原文件夹中的这两个再将这个文件发送快捷方式到桌面。
3--安装虚拟机系统环境3.1打开虚拟机,弹出图1-11界面,选中同意,后点击确定弹出如图1-12所示界面,点击不去即可进入所示。
RedHat7 zookeeper集群(含observer配置)安装

一、服务器版本查看cat /etc/redhat-release二、新建目录:mkdir -p /softwares三、解压下载3.4.9版本,解压到/softwares目录cd /softwarestar zxvf zookeeper-3.4.9.tar.gz四、配置将conf目录下的zoo_sample.cfg改为zoo.cfgcd /softwares/zookeeper-3.4.9/confmv zoo_sample.cfg zoo.cfgmkdir -p /softwares/zookeeper-3.4.9/data查看配置cd /softwares/zookeeper-3.4.9/conf【yum install vim】vim zoo.cfg注意其中tickTime=2000dataDir=/softwares/zookeeper-3.4.9/dataclientPort=2181五、启动单机测试cd /softwares/zookeeper-3.4.9/bin(没有的话使用chmod u+x *.sh使以sh为扩展名的脚本都有运行权限) ./zkServer.sh start./zkServer.sh status使用命令./zkCli.sh -server 127.0.0.1:2181连接到zookeeper服务。
六、配置主机名和ip的映射vim /etc/hosts其中编辑增加如下内容192.168.18.202 logsrv01192.168.18.203 logsrv02192.168.18.208 logsrv03192.168.18.201 obsrv01七、配置Zookeeper的配置文件cd /softwares/zookeeper-3.4.9/bin./zkServer.sh stopcd /softwares/zookeeper-3.4.9/confvim zoo.cfg在clientPort=2181下增加如下内容server.1=logsrv01:2887:3887server.2=logsrv02:2888:3888server.3=logsrv03:2889:3889server.4=obsrv01:2886:3886:observerps: server.A=B:C:D:其中A 是一个数字,表示这个是第几号服务器;B 是这个服务器的ip 地址;C 表示的是这个服务器与集群中的Leader 服务器交换信息的端口;D 表示的是万一集群中的Leader 服务器挂了,需要一个端口来重新进行选举,选出一个新的Leader,而这个端口就是用来执行选举时服务器相互通信的端口。
RedHat LINUX安装全步骤(附图)

LINUX软件安装步骤1.在Vmware 中创建一个Linux 的虚拟机版本是Red Hat Linux ,其中硬盘最少要有2GB 的空间(建议分4GB 其他硬盘,网卡的配置和Windows 虚拟机一样即可)。
2.把Vmware 的光驱制定到对应的镜像文件上,我们这里是linux iso 文件中的第一张盘。
3.启动虚拟机,由光盘进入。
在这个界面中输入linux text 后回车才能进入文本安装界面。
4.提示检测介质。
因为我们使用的是镜像文件,所以可以直接单击Skip 如果使用的是光盘最好还是检测一下比较好。
(在LINUX 文本模式中基本都是使用键盘进行操作,鼠标也支持但是不像在Windos 中那样好用。
用户可以通过Tab键和方向键来切换选项,空格和回车来确定)如果上面选择的是Skip就会直接跳到第8步。
5.开始检测。
如果是使用的光盘CD 需要先插入CD 后在Test 因为我们使用的是镜像文件所以就可以直接Test6.检测完毕。
选择OK7.提示是否检测其他的盘。
如果你为了保险起见可以继续检测,但是时间可能会长一些。
8.选择语言安装过程,在这里选择英语。
(如果选择的不是英语的话,在以后的一些提示显示中会出现乱码看不懂)9.选择键盘类型,在这里选择us 即可。
10.选择鼠标类型,在Linux 这类操作系统中,经常用到三键鼠标,因此,除了选择鼠标类型外,一般还选中下面的“Emulate 3 Buttons?”,这样同时点击鼠标左右键,代表点击中键。
11.选择安装类型。
在这里我们选择第4个Custom(定制)。
12.准备分区。
在这里选择Autopartition 。
13.这里会让用户选择如何处理硬盘上的原始分区。
因为我们是新建的所以选那个都无所谓,但是如果在已经安装好Windows 的系统上进行安装,一般选择第三项。
意思就是使用硬盘当中没有使用的空间来创建相应的分区。
在下面会让用户选择。
要安装到那个硬盘中,在这里只有一个硬盘sda ,所以直接选择即可。
redhat7安装图文教程

13.点击 LICENSE INFORMATION 14.接受协议
15.设置 Kdump 16.进入登录界面 17.登录成功
1.从光盘启动,选择“install Red Hat Enterprise Linux 7.0" 2.选择用那种语言进行安装
3.选择”DATE&支持 6.选择中文支持
7.对软件包进行选择 8.选择要安装的软件包
9.选择自动分区 10.选择开始安装
11.设置 root 用户密码 12.安装完成
Linux系统介绍磁盘分区安装rhel7

Linux系统介绍磁盘分区安装rhel71 案例1:装机预备技能1.1 问题本例要求安装⼀台可⽤的KVM服务器:1. RHEL与CentOS系统有什么关联?2. RHEL7的根分区默认采⽤什么⽂件系统?1.2 步骤实现此案例需要按照如下步骤进⾏。
步骤⼀:RHEL系统与CentOS系统的渊源RHEL是红帽公司提供的商业版Linux系统,若要获取DVD镜像、安全更新等技术服务⽀持,⼀般需要付费订阅;不过构成RHEL系统的各种软件包都是基于GPL开源协议免费发布的。
CentOS是⼀个社区性质的Linux系统,相当于RHEL的⼀个克隆版本,它采⽤了构成RHEL系统的各种软件包重新组装、开发⽽成,并且在此过程中做了⼀些优化、必要的Bug修复;CentOS系统的版本会稍晚于同版本的RHEL系统发布,其构成、管理⽅式与同版本的RHEL系统⼏乎⼀模⼀样,⽽且能够找到⼤量开放的软件源,因此受到很多企业的欢迎。
⽬前,CentOS已经被Red Hat公司所收购,仍然可⾃由使⽤。
步骤⼆:RHEL7的根分区默认采⽤什么⽂件系统?在RHEL7系统中,默认采⽤XFS⽂件系统类型;在RHEL6系统中,默认采⽤EXT4⽂件系统类型。
2 案例2:安装⼀台RHEL7虚拟机2.1 问题基于KVM虚拟机环境新安装⼀各RHEL7操作系统,主要完成以下事项:1. 新建⼀台虚拟机,硬盘300GB,内存2GB2. 为此虚拟机安装RHEL7操作系统,采取⾃动分区⽅案3. 软件包定制(根据课上要求选取)2.2 ⽅案在虚拟机环境练习装机过程——通过菜单组“应⽤程序”-->“系统⼯具”-->“虚拟系统管理器”,打开KVM虚拟化的图形管理程序(如图-1所⽰),添加⼀台虚拟机,将RHEL7系统的ISO镜像⽂件作为此虚拟机的安装光盘。
图-12.3 步骤实现此案例需要按照如下步骤进⾏。
步骤⼀:新建⼀台RHEL7虚拟机1)启动“新建虚拟机”向导程序单击虚拟系统管理器左上⽅的“新建”按钮,即可打开“新建虚拟机”向导窗⼝;为新建虚拟机指定名称,安装⽅式选择从本地ISO镜像安装(如图-2所⽰),单击“前进“。
Red Hat Enterprise Linux 7.X LE ALT 安装指南说明书

Installing Red Hat Enterprise Linux on IBM Power System IC922 (9183-22X) servers with virtual mediaQuick Start Guide for installing Linux® on IBM® Power® System IC922 (9183-22X) server.Version 1.0.0This guide helps you install Red Hat Enterprise Linux on IBM Power System IC922 (9183-22X) server.Note:© Copyright IBM Corp. 2020. US Government Users Restricted Rights - Use, duplication or disclosurerestricted by GSA ADP Schedule Contract with IBM Corp.IBM, the IBM logo, and ® are trademarks or registered trademarks of International BusinessMachines Corp., registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on the web at"Copyright and trademark information" (/legal/copytrade.shtml).About this taskOverviewUse this information to install Red Hat® Enterprise Linux 7.X LE ALT on a non-virtualized or bare metal IBM Power System IC922 (9183-22X) server.To install Red Hat Enterprise Linux on IBM Power System IC922 (9183-22X) servers by using virtualmedia, use a PC and access the BMC web page by using a browser. You can connect your PC to theOpenBMC port of the server over a configured network so that the service processor can read the .iso file from the PC during the installation of the operating system.For a list of supported distributions, see Supported Linux distributions for POWER8® and POWER9™ Linux on Power systems.Procedurepleting the prerequisites and booting your firmwareBefore you power on the system, ensure that you have the following items:•Ethernet cable.•USB Keyboard.–Power cords and outlet for your system.•SSH client.•PC or Notebook with Linux installed on it.•Notes:–You do not need an ssh client and a PC with Linux installed on it, if you are using a VGA screen andkeyboard.–You do not need a USB keyboard if you are using a serial connection.Complete these steps:•Download the ISO image of Red Hat Enterprise Linux 7.X LE ALT from the https:///products/red-hat-enterprise-linux/#addl-arch website to your computer that you use to access theOpenBMC by using a web browser. Take the link for Downloads for Red Hat Enterprise Linux forPower, little endian. Log into your Red Hat account (if you have not already done so). Select RedHat Enterprise Linux for Power 9 from the Product Variant list. Look for the Red Hat EnterpriseLinux for Power 9 (v. 7.x for ppc64le) ISO file. The downloaded ISO file will include rhel-alt......isorather than rhel....iso in the path name.•If your system belongs in a rack, install your system into that rack. For instructions, see IBM Power Systems information at https:///support/knowledgecenter/POWER9/p9hdx/POWER9welcome.htm.•Make one of the following connections:–Connect an Ethernet cable to the dedicated BMC Ethernet port that is located close to the USB 3.0 port and it is labeled M. Connect the other end to your PC or Notebook which you use to configure the IP address.–You can also connect to the serial port of the server by using a serial connection.•Attach the USB to serial (RS232) adapter cable to the IPMI serial 9-pin D-shell connector on the Power system.•Attach USB connection to USB port on either PC or Notebook.•Open a terminal emulator program such as PuTTY or minicom.•Set the communications to use the following options:–115200 baud rate–Data bits of 8–Parity of None–Stop bits of 1•Connect the power cords to the system and plug them into the outlets.At this point, your firmware is booting. Wait for the green LED on the power button to start flashing, indicating that it is ready to use. If your system does not have a green LED indicator light, then wait 1 -2 minutes.2.Configuring the IP addressNote: You can use either a serial connection or a keyboard and monitor to connect to the BMC. After the IP details are configured, you can use SSH connection. For more information, see Managing BMC-based systems.To set up or enable your network connection to the BMC firmware, use the Petitboot bootloader interface. Follow these steps:a.Your system will power on to the Petitboot bootloader menu. This process usually takes about 1 - 2minutes to complete, but might take 5 - 10 minutes on the first boot or after a firmware update. Do not walk away from your system! When Petitboot loads, your monitor becomes active and you will need to push any key to interrupt the boot process.b.At the Petitboot bootloader main menu, select Exit to Shell.c.Program your BMC IP address by running the following commands:Note: The shared BMC port is located near to the USB 3.0 port and it is labeled 1 and the dedicated BMC port is located next to the shared BMC port and it is labeled M.1)Set the mode to static by running this command: ipmitool lan set 2 ipsrc static2)Set your IP address by running this command: ipmitool lan set 2 ipaddr ip_addresswhere ip_address is the static IP address that you are assigning to this system.3)Set your netmask by running this command: ipmitool lan set 2 netmasknetmask_address where netmask_address is the netmask for the system.4)Set your gateway server by running this command: ipmitool lan set 2 defgw ipaddrgateway_server where gateway_server is the gateway for this system.5)For the shared BMC port run the following command: Run ipmitool lan print 16)For the dedicated BMC port run the following command: Run ipmitool lan print 2d.To reset your firmware, run the following command: ipmitool mc reset cold.e.You should be able to ping the BMC now. If your ping does not return successfully within areasonable amount of time (2 - 3 minutes), try these additional steps:1)Power your system off with this command from the petitboot shell: poweroff2)Unplug the power cords from the back of the system. Wait 30 seconds and then apply power toboot BMC.3.Creating a bootable virtual mediaa.Open a supported web browser. In the address bar, enter the IP address of the BMC that you wantto connect to. For example, you can use the format https://<BMC IP> in the address bar of the web browser.b.From the OpenBMC logon window, enter the Host address of the BMC and the username andpassword that is assigned to you.c.Then select Server control → Virtual Media to network-attach the ISO image to the IBM PowerSystem IC922 (9183-22X) server. After clicking Start, the ISO is available to the server to start the operating system installation process.4.Powering on your server by using a PC or NotebookNote: After your system powers on, the Petitboot interface loads. If you do not interrupt the boot process by pressing any key within 10 seconds, Petitboot automatically boots the first option.To power on your server from a PC or Notebook that is running Linux, follow these steps:a.Connect an Ethernet cable from the BMC port to a PC or Notebook. Or you can also make sure yourPC or Notebook is on the same network as the BMC firmware.b.Open a terminal program on your PC or Notebook.c.Log in to the BMC by running the following commands.ssh root@<BMC server_ip_address>root@<BMC server password>where BMC server_ip_address is the IP address of the BMC and BMC server password is thepassword to authenticate.Note: The default username is root and the default password is 0penBmc (where, 0penBmc is using a zero and not a capital O).d.To power on your server, run the following command:$ root@<BMC server_ip_address>:~# obmcutil powerone.Connect to OS console and use the default password 0penBmc.ssh -p 2200 root@<BMC server_ip_address>root@where BMC server_ip_address is the IP address of the BMC and BMC server password is thepassword to authenticate.5.Configuring PetitbootAfter the system powers on, the Petitboot bootloader scans local boot devices and network interfaces to find boot options that are available to the system.a.After you start the system, Petitboot displays the virtual media boot device, and you can select theboot entry, but do not start the installation. If you start the installation, you might not be able to finish the installation and the system might show errors similar to the following string:dracut-initqueue[3537]: Warning: dracut-initqueue timeout - starting timeoutscriptsNote: Select Rescan devices if the virtual media boot device does not appear.b.Record the UUID of the virtual media boot device. The UUID of the virtual media boot device in thefollowing example is 2018-10-10-22-13-55-00.Petitboot (v1.11) 9183-22X 78002BA____________________________________________________________________________________[USB: sdc / 2018-10-10-22-13-55-00]Rescue Red Hat Enterprise Linux Alternate Architectures system (64 bit keTest this media & Install Red Hat Enterprise Linux Alternate Architectures* Install Red Hat Enterprise Linux Alternate Architectures 7.6 (64 bit kernelSystem informationSystem configurationSystem status logLanguageRescan devicesRetrieve config from URLPluginsExit to shell___________________________________________________________________________________Enter = accept, e=edit, n=new, x=exit, l=language, g=log, h=helpc.Select Install Red Hat Enterprise Linux Alternate Architectures 7.6 (64 bit kernel) and press e(Edit) to open the Petitboot Option Editor window.d.Move the cursor to the Boot arguments section and add the following information: inst.textinst.stage2=hd:UUID=your_UUID where your_UUID is the UUID that you recorded.Petitboot Option Editor_______________________________________________________________________Device: ( ) sda2 [3cb1868c-7fd4-466a-a7b0-70942ca452cd](*) sdb1 [2018-10-10-22-13-55-00]( ) Specify paths/URLs manuallyKernel: /ppc/ppc64/vmlinuzInitrd: /ppc/ppc64/initrd.imgDevice tree:Boot arguments: ro inst.text inst.stage2=hd:UUID=2018-10-10-22-13-55-00[ OK ] [ Help ] [ Cancel ]________________________________________________________________________tab=next, shift+tab=previous, x=exit, h=helpe.Select OK to save your options and return to the Main menu.f.Verify that Install Red Hat Enterprise Linux Alternate Architectures 7.6 (64 bit kernel) isselected and then press Enter to begin your installation.pleting your installationAfter you select to boot the Red Hat Enterprise Linux 7.X LE ALT installer, the installer wizard walks you through the steps.a.Follow the installation wizard for Red Hat Enterprise Linux to set up disk options, your usernameand password, time zones, and so on. The last step is to restart your system.b.After the system restarts, Petitboot displays the option to boot the Red Hat Enterprise Linux releasenumber. Select this option and press Enter.Note: Be sure to check for firmware updates. See https:///support/knowledgecenter/ POWER9/p9ei8/p9ei8_fixes_kickoff.htmWhat to do nextMore informationFor more information, see the following resources:•IBM Knowledge Center at https:///support/knowledgecenter/.•IBM Power System IC922 (9183-22X) server Redbook at /redpapers/ pdfs/redp5584.pdf.•The Linux on Power developer portal at Linux on Power developer portal.。
Red Hat Enterprise Linux OpenStack Platform 7 网络指南

Red Hat Enterprise Linux OpenStack Platform 7网络指南OpenStack Networking 高级指南OpenStack TeamRed Hat Enterprise Linux OpenStack Platform 7 网络指南OpenStack Networking 高级指南OpenStack Team********************法律通告Copyright © 2017 Red Hat, Inc.The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at/licenses/by-sa/3.0/. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version.Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.Red Hat, Red Hat Enterprise Linux, the Shadowman logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.Linux ® is the registered trademark of Linus Torvalds in the United States and other countries. Java ® is a registered trademark of Oracle and/or its affiliates.XFS ® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.MySQL ® is a registered trademark of MySQL AB in the United States, the European Union and other countries.Node.js ® is an official trademark of Joyent. Red Hat Software Collections is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.The OpenStack ® Word Mark and OpenStack logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation's permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.All other trademarks are the property of their respective owners.摘要执行常见 OpenStack Networking 任务的实用手册。
Redhat7系统安装教程

Redhat7系统安装教程系统的安装部署过程第⼀个历程:进⼊系统引导界⾯进⾏配置引导项说明:1. 安装centos7系统(*)2. 测试光盘镜像并安装系统3. 排错模式(修复系统重置系统密码)===============================================补充:centos7系统⽹卡名称centos6默认系统的⽹卡名称为 eth0 eth1centos7默认系统的⽹卡名称为 ens33 ens34如何调整⽹卡名称:选择安装Install CenOS7--tab键 -- net.ifnames=0 biosdevname=0===============================================从虚拟主机返回到windows系统⽅法:ctrl+alt第⼆个历程:对安装系统语⾔进⾏设置第三个历程:对系统安装过程进⾏配置1. 系统⽹络的配置2. 系统分区的配置Linux系统磁盘分区知识简介:在分区之前,需要先简单介绍⼀下磁盘分区相关知识,便于⼤家更好地理解学习。
1)磁盘在使⽤前⼀般要先分区(相当于买房要有⼏居⼀样)。
2)磁盘分区有主分区、扩展分区和逻辑分区之分。
⼀块磁盘最多可以有4个主分区,其中⼀个主分区的位置可以⽤⼀个扩展分区替换,在这个扩展分区内可以划分多个逻辑分区。
3)如果规划的分区数量超过4个,则分区组合为3primary+1extend或2p+1e或1p+1e。
4)⼀块磁盘最多只能有⼀个扩展分区,扩展分区不能直接使⽤,必须在扩展分区上划分逻辑分区,然后格式化(创建⽂件系统),之后才能存取数据或装系统。
磁盘分区命名及编号⽅式(1)以设备名命名在Linux系统中,磁盘设备对应于系统中的特殊⽂件,这些特殊的⽂件存放在“/dev”⽬录中,不同的设备对应的设备名称如下:❑系统的第⼀块有IDE接⼝的硬盘称为/dev/hda。
❑系统的第⼆块有IDE接⼝的硬盘称为/dev/hdb。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
RedHat linux 7虚拟化环境集群安装精简手册1、前期准备挂载磁盘/* 通过制作iso,方便后续安装动作,在知识库中应形成iso镜像体系*/dd if=/dev/sr0 of=/app/rh71.isomount -o loop /app/rh71.iso /mnt挂载制作的isomount -loop /dev/sr0 /mnt查看少什么包/* 如果想要是用vgscan指令,系统至少需要安装lvm2包,这个从安装好的系统上查*/ [root@jttldb1 host5]# rpm -qf /sbin/vgscanlvm2-2.02.83-3.el6.x86_64常用包安装net-tools (ifconfig等用)yum -y install nautilus-open-terminal(右键添加terminal)配置yum/* 根据具体挂载的路径和版本调整*/建立文件/etc/yum.repos.d/mycdrom.repo[Base]name=RHELbaseurl=enabled=1gpgcheck=0[Cluster]name=RHELbaseurl=addons/HighAvailabilityenabled=1gpgcheck=0配置ipIPADDR=10.88.89.100GATEWAY=10.88.89.1NETMASK=255.255.255.0ONBOOT=yes单网卡配置多ipifconfig team0:0 10.88.89.101 netmask 255.255.255.0 (临时添加一个ip,重启后消失,如果想永久拥有,需要配置ifcfg-ens32:0 文件)临时文件取消:ifconfig ens32:0 down网卡绑定1)创建组接口(会生产一个ifcfg-team0)nmcli con add type team con-name team0 ifname team0 config '{"runner":{"name":"activebackup"}}'nmcli con del team0 (删除绑定team)2)查看组接口配置nmcli con show3)给组接口添加设备nmcli con add type team-slave con-name team0-port1 ifname enp11s0f0 master team0nmcli con add type team-slave con-name team0-port2 ifname enp16s0f0 master team0nmcli con mod type team-slave con-name team0-port2 ifname enp16s0f0 master team04)配置ip[root@jttldb2 network-scripts]# more ifcfg-team0DEVICE=team0DEVICETYPE=TeamTEAM_CONFIG="{\"runner\":{\"name\":\"activebackup\"}}"BOOTPROTO=noneIPADDR=10.88.89.100PREFIX=25GATEWAY=10.88.89.1DEFROUTE=yesIPV4_FAILURE_FATAL=yesIPV6INIT=yesIPV6_AUTOCONF=yesIPV6_DEFROUTE=yesIPV6_PEERDNS=yesIPV6_PEERROUTES=yesIPV6_FAILURE_FATAL=noNAME=team0UUID=afa9d1a3-05d8-4cad-af44-fd187c5be16f ONBOOT=yes查看网卡状态teamdctl team0 state验证nmcli dev dis eno 断开nmcli dev con eno 连接OS版本查询lsb_release -a需要安装包(yum install redhat-lsb)起停服务systemctl stop firewalldsystemctl start firewalldsystemctl status firewalldsystemctl|grep是否开机启动systemctl enable XXX 开机启动systemctl disable xxx 开机不启动systemctl status XXX 查看状态关闭防火墙[root@localhost ~]# systemctl stop firewalld [root@localhost ~]# systemctl disable firewalld关闭selinux[root@localhost ~]# vi /etc/sysconfig/selinux把SELINUX=enforcing改为SELINUX=disabled[root@localhost ~]# reboot查看#getenforce临时关闭# setenforce 0LVM配置虚机上共享磁盘配置要求磁盘置备:厚置备置零磁盘模式:独立持久在ha1上,创建pv、vg、lv挂载文件系统,在ha2上重启系统即可识别vg信息修改主机名称:linu7通过hostname临时修改主机名,加hostnamectl static修改静态主机名的方式实现永久生效主机名(修改主机名后注意修改hosts)hostnamehostnamectl --static set-hostname linux7-ha2而在linux7之前是没有hostnamectl命令的,永久修改主机名的方式是通过hostname加修改/etc/sysconfig/network文件的方式配置vnc连接rehhat71)安装包yum install tigervnc-server创建一个登录密码:#vncserver2)配置vnccp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:1.service替换文件#Type=forking改成Type=simple3)重启systemdsystemctl daemon-reload4)启动vcnsystemctl start vncserver@:1.servicesystemctl status vncserver@:1.service永久启动systemctl enable vncserver@:1.service5)关闭vncsystemctl stop vncserver@:1.service开机不启动systemctl disable vncserver@:1.service客户端服务器段需要关闭防火墙,或修改过滤2、oracle静默安装安装必要的包yum -y install binutils compat-db compat-gcc-34 compat-gcc-34-c++ compat-libstdc++-33 elfutils-libelf-devel gcc gcc-c++ glibc-* libXp.so.6 libXt.so.6 libXtst.so.6 libgcc* ksh libXp libaio-devel numactl numactl-devel sysstat unixODBC unixODBC-devel pdkshyum install静默安装oracle修改./database/response/db_install.rspdb_install.rsp如下内容oracle.install.option=INSTALL_DB_SWONLYUNIX_GROUP_NAME=oinstallINVENTORY_LOCATION=/u01/app/oraInventoryORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1ORACLE_BASE=/u01/app/oracleoracle.install.db.InstallEdition=EEoracle.install.db.EEOptionsSelection=trueoracle.install.db.optionalComponents=oracle.rdbms.partitioning:11.2.0.3.0,oracle.oraolap:11.2.0.3.0,oracle.rdbms.dm:11.2.0.3.0,oracle.rdbms.lbac:11.2.0.3.0,oracle.rdbms.rat:11.2.0.3.0 oracle.install.db.DBA_GROUP=dbaoracle.install.db.OPER_GROUP=operoracle.install.db.isRACOneInstall=falseDECLINE_SECURITY_UPDATES=true执行静默安装软件./runInstaller -silent -ignoreSysPrereqs -ignorePrereq -showProgress -responseFile /oracle/database/response/db_install.rsp执行静默安装数据库(在dbca.rsp中添加实例名称)dbca -silent -responseFile /oracle/database/response/dbca.rsp对数据库做必要的调整3、linux7 vmware下ha安装调试----pacemaker取代rgmanager ssh 双机信任配置1)在两个节点上生产证书# ssh-keygen -t rsa注意:在程序提示输入passphrase时直接输入回车,表示无证书密码。
上述命令将生成私钥证书id_rsa和公钥证书id_rsa.pub,存放在用户家目录的.ssh 子目录中。
2)查看~/.ssh生成密钥的文件# cd ~/.ssh3)建立两个节点的信任关系(两个节点互相传一下证书文件,并改名称)# scp -r id_rsa.pub 主机1:/root/.ssh/authorized_keys#scp -r id_rsa.pub 主机2:/root/.ssh/authorized_keys安装HA必要安装包yum install pacemaker*yum install pcs*corosync*/* 系统常用的一些编译环境等包,系统安装时可能都已经安装了*/ yum -y install gcc gcc-c++ libstdc++-devel flex kernel-devel启动PCSD服务systemctl start pcsd.servicesystemctl status pcsd.servicesystemctl enable pcsd.service设置集群认证用户haclusterfor i in 1 2; do ssh ha$i 'echo admin | passwd --stdin hacluster'; done或在两个节点运行:passwd haclusteradmin添加授权#pcs cluster auth ha1 ha2 (在一个节点上执行就可以了)创建集群#pcs cluster setup --name lion ha1 ha2开启集群并随机启动[root@linux7-ha1 /]# pcs cluster start --all[root@linux7-ha1 /]# pcs cluster enable --all查看集群状态[root@linux7-ha1 /]# pcs status仲裁设置linux7模式下,双节点仲裁自动添加,不需要设置,需要改默认配置[root@ha1 ~]# pcs property set no-quorum-policy=ignore (说明)fence设置/* 不设置fence设备可以完成集群的配置,但是会导致异常场景下双节点同时使用资源,对于如数据库资源来说,会造成数据库损坏,无法打开*/模式一:不使用fence[root@ha1 ~]# pcs property set stonith-enabled=false模式二:使用fencepcs property set stonith-enabled=true /* 开启stonith */pcs stonith list /* 查看系统支持的fence类型*/1)对于虚拟机fence(使用fence_vmware_soap 类型)检测fence设备状态/* 10.88.88.88是esxi1 10.88.88.89是exsi2主机用户名和密码也是esxi主机的 status 改成reboot 测试是否重启 */fence_vmware_soap -a esxi1 -z -n ha1 -o status --ssl-insecure -l root -p 1234qwerasdfence_vmware_soap -a esxi2 -z -n ha2 -o status --ssl-insecure -l root -p 1234qwerasd添加fence资源pcs stonith create fence_vmware_ha1 fence_vmware_soap \ipaddr=10.88.88.88 ssl_insecure=1 inet4_only=1 \login="root" passwd="1qaz2wsx" action=reboot \pcmk_host_map="ha1:423cbe32-5e0d-fded-fde5-6c4d2cac47c2;ha2:423c98c4-23c5-dd46-67e2-9ce2f03c243f" \pcmk_host_list=ha1 pcmk_host_check=static-list power_wait=3 op monitorpcs stonith create fence_vmware_ha2 fence_vmware_soap \ipaddr=10.88.88.89 ssl_insecure=1 inet4_only=1 \login="root" passwd="1qaz2wsx" action=reboot \pcmk_host_map="ha1:423cbe32-5e0d-fded-fde5-6c4d2cac47c2;ha2:423c98c4-23c5-dd46-67e2-9ce2f03c243f" \pcmk_host_list=ha2 pcmk_host_check=static-list power_wait=3 op monitor interval=60s虚拟机ha1和ha2的uuid的查找方法:fence_vmware_soap -a 10.88.88.88 --ssl-insecure --action list -l root -p 1234qwerasd添加资源添加浮动ip,并加入资源组pcs resource create VIP ocf:heartbeat:IPaddr2 ip=10.88.89.100 cidr_netmask=24 op monitor interval=30s --group orasrv添加lvm信息并加入组:修改/etc/lvm/lvm.confuse_lvmetad = 0volume_list = [ "rhel" ] (把非集群的vg添加进去)#dracut -H -f /boot/initramfs-$(uname -r).img $(uname -r) (必须重启操作系统,使其生效)添加vg#pcs resource create my_lvm LVM volgrpname=datavg exclusive=true --group orasrv 添加文件系统:(排他锁模式)[root@z1 ~]# pcs resource create my_fs \device=/dev/datavg/datalv directory=/oracle \fstype=ext3 --group orasrvoracle添加下载脚本,并拷贝至路径/usr/lib/ocf/resource.d/heartbeat/添加实例pcs resource create oracledb ocf:heartbeat:oracle sid=lionhome=/oracle/oracle11g/product/11.2.0/db_1 clear_backupmode=1shutdown_method=immediate --group orasrv添加监听资源pcs resource create oralsn ocf:heartbeat:oralsnr sid=lionhome=/oracle/oracle11g/product/11.2.0/db_1 --group orasrv集群粘性/*防止节点恢复后自动回迁,经验证,如不设置,当主节点恢复后集群会自动回迁,资源粘性表示资源是否倾向于留在当前节点,如果为正整数,表示倾向,负数则会离开,-inf表示负无穷,inf表示正无穷。