CentOS7系统管理与运维实战
下载地址 https://pan.baidu.com/s/1KFHVI-XjGaLMrh39WuhyCw
扫码下面二维码关注公众号回复100007 获取分享码
本书目录结构如下:
第 1章开启 Linux系统管理与运维的大门.....................................1
1.1 你必须知道的 Linux版本问题...............................................1
1.1.1 Linux的内核版本.............................................................1
1.1.2 Linux的发行版本.............................................................2
1.2 CentOS之于Linux............................................................2
1.2.1 CentOS简介 ..................................................................2
1.2.2 CentOS 7的最新改进.......................................................3
1.3 Linux运维工程师的技能 ........................................................3
1.3.1 系统和系统服务................................................................4
1.3.2 网络知识.........................................................................4
1.4 小结..................................................................................5
第 2章跟我学 CentOS的安装......................................................6
2.1 安装 CentOS必须知道的基础知识...........................................6
2.1.1 磁盘分区.........................................................................6
2.1.2 静态分区的缺点及逻辑卷管理简介 ........................................7
2.1.3 虚拟化和 VMwareWorkstation简介...................................8
2.1.4 下载最新的 CentOS安装版本............................................. 9
2.2 安装 CentOS.....................................................................10
2.2.1 创建虚拟机......................................................................10
2.2.2 光盘安装 CentOS 7..........................................................12
2.2.3 U盘安装 CentOS 7...........................................................20
2.2.4 Windows 7 CentOS 7双系统安装 .....................................21
2.2.5 网络安装.........................................................................24
2.3 Linux的登录........................................................................24
2.3.1 首次配置与本地登录...........................................................25
2.3.2 远程登录..........................................................................27
2.4 从 CentOS 6.5升级到 CentOS7...........................................28
2.4.1 升级风险...........................................................................29
2.4.2 使用升级工具....................................................................29
2.5 小白安装过程中的问题 ............................................................31
2.5.1 Linux分区会覆盖原有Windows系统吗.............................. 31
2.5.2 如何安装多个 Linux发行版................................................ 32
2.5.3 如何删除双系统中的Linux................................................32
2.5.4 主机连不上虚拟机安装的Linux系统.................................... 33
2.6 Linux的目录结构.................................................................35
2.7 小结..................................................................................36
第 3章运维必备的网络管理技能.....................................................37
3.1 网络管理协议介绍.................................................................37
3.1.1 TCP/IP概述......................................................................38
3.1.2 UDP与 ICMP协议简介........................................................40
3.2 网络管理命令.........................................................................40
3.2.1 检查网络是否通畅或网络连接速度 ping................................. 40
3.2.2 配置网络或显示当前网络接口状态 ifconfig .......................... 42
3.2.3 显示添加或修改路由表route............................................. 44
3.2.4 复制文件至其他系统 scp...................................................45
3.2.5 复制文件至其他系统rsync...................................................46
3.2.6 显示网络连接、路由表或接口状态 netstat........................... 48
3.2.7 探测至目的地址的路由信息traceroute ............................... 49
3.2.8 测试、登录或控制远程主机telnet ..................................... 51
3.2.9 下载网络文件 wget.........................................................52
3.3 Linux网络配置.................................................................53
3.3.1 Linux网络相关配置文件...................................................53
3.3.2 配置 Linux系统的 IP地址..................................................54
3.3.3 设置主机名......................................................................55
3.3.4 设置默认网关...............................................................55
3.3.5 设置 DNS服务器..........................................................56
3.4 Linux 防火墙iptables......................................................56
3.4.1 Linux内核防火墙的工作原理..............................................56
3.4.2 Linux软件防火墙 iptables..............................................59
3.4.3 iptables配置实例...........................................................62
3.5 Linux高级网络配置工具......................................................65
3.5.1 高级网络管理工具iproute2.............................................65
3.5.2 网络数据采集与分析工具tcpdump .................................. 67
3.6 动态主机配置协议(DHCP)...............................................70
3.6.1 DHCP的工作原理.........................................................70
3.6.2 配置 DHCP服务器......................................................71
3.6.3 配置 DHCP客户端...................................................73
3.7 Linux域名服务DNS......................................................73
3.7.1 DNS简介..................................................................74
3.7.2 DNS服务器配置.........................................................74
3.7.3 DNS服务测试........................................................78
3.8 小结...........................................................................79
第 4章路由管理..............................................................80
4.1 认识路由..................................................................80
4.1.1 路由的基本概念.....................................................80
4.1.2 路由的原理............................................................82
4.1.3 Linux系统中的路由表...............................................82
4.1.4 静态路由和动态路由................................................83
4.2 配置 Linux静态路由....................................................84
4.2.1 配置网络接口地址.....................................................84
4.2.2 接口 IP地址与直联路由..............................................87
4.2.3 route命令.............................................................88
4.2.4 Linux路由器配置实例.................................................90
4.3 Linux的策略路由..........................................................91
4.3.1 策略路由的概念.........................................................91
4.3.2 路由表管理 ...............................................................92
4.3.3 规则与路由管理.........................................................94
4.3.4 策略路由应用实例........................................................95
4.4 小结..............................................................................97
第 5章文件共享服务...............................................................98
5.1 网络文件系统(NFS).....................................................98
5.1.1 NFS 简介 ...................................................................98
5.1.2 配置 NFS 服务器...........................................................99
5.1.3 配置 NFS客户端 ...........................................................103
5.2 文件服务器 Samba..........................................................103
5.2.1 Samba 服务简介.........................................................103
5.2.2 Samba服务安装配置...................................................104
5.3 FTP服务器.....................................................................107
5.3.1 FTP 服务概述..............................................................107
5.3.2 vsftp的安装与配置......................................................108
5.3.3 proftpd的安装与配置....................................................114
5.4 小结...............................................................................117
第 6章搭建 LAMP服务...........................................................118
6.1 Apache HTTP服务安装与配置...........................................118
6.1.1 HTTP协议简介.............................................................118
6.1.2 Apache服务的安装、配置与启动....................................120
6.1.3 Apache基于 IP的虚拟主机配置.....................................131
6.1.4 Apache基于端口的虚拟主机配置...................................134
6.1.5 Apache基于域名的虚拟主机配置...................................136
6.1.6 Apache安全控制与认证..............................................138
6.2 MySQL服务的安装与配置...............................................143
6.2.1 MySQL的版本选择...................................................144
6.2.2 MySQL的版本命名机制...........................................144
6.2.3 MySQL rpm包安装................................................144
6.2.4 MySQL源码安装.....................................................146
6.2.5 MySQL程序介绍.....................................................149
6.2.6 MySQL配置文件介绍.................................................150
6.2.7 MySQL启动与停止...................................................152
6.3 PHP安装与配置............................................................158
6.4 LAMP集成安装、配置与测试实战 ...................................158
6.5 MySQL日常维护..........................................................163
6.5.1 MySQL权限管理......................................................163
6.5.2 MySQL日志管理.....................................................167
6.5.3 MySQL备份与恢复................................................172
6.5.4 MySQL复制.........................................................179
6.5.5 MySQL复制搭建过程.............................................181
6.6 小结......................................................................185
第 7章搭建 LNMP服务..................................................186
7.1 LNMP服务安装与管理...........................................186
7.1.1 Nginx的安装与管理.............................................186
7.1.2 PHP安装..............................................................189
7.2 Nginx负载均衡与反向代理.........................................190
7.2.1 Nginx负载均衡设置................................................190
7.2.2 Nginx反向代理配置................................................191
7.3 集成 Nginx与 PHP..................................................193
7.3.1 spawn-fcgi集成方式.............................................193
7.3.2 php-fpm集成方式................................................196
7.4 LNMP实战............................................................198
7.4.1 第 1个 PHP程序................................................198
7.4.2 数据库连接.......................................................198
7.4.3 记录查询...........................................................199
7.4.4 增加分页..........................................................202
7.4.5 添加记录...........................................................206
7.4.6 修改记录............................................................208
7.4.7 删除记录...........................................................212
7.5 小结...................................................................217
第 8章集群................................................................218
8.1 集群技术简介......................................................218
8.2 LVS 集群介绍.....................................................219
8.2.1 3种负载均衡技术...............................................219
8.2.2 负载均衡调度算法...............................................222
8.3 LVS 集群的体系结构 .............................................223
8.4 LVS负载均衡配置实例............................................224
8.4.1 基于 NAT模式的 LVS的安装与配置 ........................224
8.4.2 基于 DR模式的 LVS的安装与配置.......................... 228
8.4.3 基于 IP隧道模式的 LVS的安装与配置.....................231
8.5 利用集群搭建高可用 MySQL平台 ..........................233
8.5.1 高可用 MySQL平台的功能................................233
8.5.2 可选方案对比...................................................234
8.5.3 高可用 MySQL平台实现方案.............................. 235
8.5.4 搭建 MySQL集群............................................235
8.5.5 搭建负载均衡 LVS..........................................244
8.5.6 搭建双机热备HA..............................................249
8.5.7 项目测试......................................................252
8.6 小结................................................................254
第 9章双机热备.......................................................256
9.1 高可用性集群技术..............................................256
9.1.1 可用性和集群..................................................256
9.1.2 集群的分类......................................................257
9.2 双机热备开源软件 Pacemaker .............................257
9.2.1 Pacemaker概述.............................................258
9.2.2 Pacemaker安装与配置.............................258
9.2.3 Pacemaker资源配置..................................262
9.2.4 Pacemaker测试...........................................266
9.3 双机热备软件keepalived................................268
9.3.1 keepalived概述.........................................268
9.3.2 keepalived安装与配置..................................268
9.3.3 keepalived启动与测试..................................270
9.4 小结 .............................................................272
第 10章 KVM虚拟化和 oVirt虚拟化管理平台.............273
10.1 KVM虚拟化................................................273
10.1.1 安装 KVM虚拟化........................................273
10.1.2 KVM虚拟机的管理方法..................................276
10.1.3 使用图形工具创建虚拟机.................................277
10.1.4 使用virt-install创建虚拟机............................. 281
10.2 oVirt虚拟化管理平台....................................288
10.2.1 oVirt-engine虚拟化管理平台概述................. 288
10.2.2 oVirt管理平台的安装...................................288
10.2.3 oVirt Node安装........................................294
10.2.4 oVirt Node设置......................................298
10.2.5 oVirt虚拟化管理平台设置...........................299
10.2.6 配置资源..................................................302
10.2.7 建立虚拟机..............................................305
10.3 小结..........................................................307
第 11章 GlusterFS存储.......................................308
11.1 GlusterFS概述.........................................308
11.1.1 分布式文件系统.......................................308
11.1.2 GlusterFS概述......................................311
11.1.3 GlusterFS集群的模式............................313
11.2 GlusterFS部署和应用 ................................315
11.2.1 GlusterFS安装......................................315
11.2.2 配置服务和集群.......................................318
11.2.3 添加磁盘到集群......................................319
11.2.4 添加不同模式的GlusterFS磁盘............. 322
11.2.5 在 Linux中使用 GlusterFS存储............. 323
11.3 小结 .....................................................324
第 12章配置 OpenStack私有云............................325
12.1 OpenStack概况.....................................325
12.2 OpenStack系统架构.................................326
12.2.1 OpenStack体系架构 ................................326
12.2.2 OpenStack部署方式............................327
12.2.3 计算模块Nova.........................................329
12.2.4 分布式对象存储模块Swift....................... 329
12.2.5 虚拟机镜像管理模块Glance....................330
12.2.6 身份认证模块Keystone.........................330
12.2.7 控制台 Horizon..............................................331
12.3 Openstack主要部署工具..............................332
12.3.1 Fuel.........................................332
12.3.2 TripleO..............................................332
12.3.3 RDO..........................................333
12.3.4 DevStack...................................333
12.4 通过 RDO部署 OpenStack...........................333
12.4.1 部署前的准备...............................333
12.4.2 配置安装源...............................333
12.4.3 安装Packstack............................334
12.4.4 安装 OpenStack.......................334
12.5 管理 OpenStack.........................338
12.5.1 登录控制台.............................338
12.5.2 用户设置...................................340
12.5.3 管理用户..............................................341
12.5.4 管理镜像.................................342
12.5.5 管理云主机类型............................345
12.5.6 管理网络.................................347
12.5.7 管理实例........................................354
12.6 小结 ..............................................360
第 13章配置 OpenNebula云平台....................361
13.1 OpenNebula概述..................................361
13.1.1 云计算概述........................................... 361
13.1.2 OpenNebula概述 ................................ 362
13.2 OpenNebula安装....................................363
13.2.1 控制端环境配置....................................363
13.2.2 控制端安装...........................................365
13.2.3 客户端安装..........................................367
13.2.4 配置控制端和客户端.............................368
13.3 OpenNebula配置与应用.........................373
13.3.1 配置 VDC和集群...................................373
13.3.2 添加 KVM主机.....................................375
13.3.3 建立映像............................................377
13.3.4 添加虚拟网络和模板............................382
13.3.5 创建并访问虚拟机.................................383
13.4 小结..............................................384
附录 A Linux常用命令示例..............................385
A.1 文件管理.............................................385
A.1.1 复制文件cp........................................385
A.1.2 移动文件mv....................................387
A.1.3 创建文件或修改文件时间touch............. 388
A.1.4 删除文件 rm...............................389
A.1.5 查看文件.....................................391
A.1.6 查看文件或目录 find.......................394
A.1.7 过滤文本 grep............................395
A.1.8 比较文件差异diff.............................399
A.1.9 在文件或目录之间创建链接ln ............... 400
A.1.10 显示文件类型file................................401
A.1.11 分割文件 split............................402
A.1.12 合并文件 join..............................404
A.1.13 文件权限umask.............................405
A.1.14 文本操作 awk和 sed......................406
A.2 目录管理..........................................407
A.2.1 显示当前工作目录pwd.........................407
A.2.2 建立目录mkdir...................................408
A.2.3 删除目录 rmdir.............................409
A.2.4 改变工作目录cd.........................410
A.2.5 查看工作目录文件ls........................411
A.2.6 查看目录树tree............................413
A.2.7 打包或解包文件tar........................414
A.2.8 压缩或解压缩文件和目录zip/unzip ...................... 415
A.2.9 压缩或解压缩文件和目录gzip/gunzip ............... 416
A.2.10 压缩或解压缩文件和目录bzip2/bunzip2 ............. 417
A.3 系统管理..................................................418
A.3.1 查看命令帮助 man.....................................418
A.3.2 导出环境变量 export.............................419
A.3.3 查看历史记录history....................................420
A.3.4 显示或修改系统时间与日期date..................... 421
A.3.5 清除屏幕clear...........................................422
A.3.6 查看系统负载uptime..............................422
A.3.7 显示系统内存状态 free...........................422
A.3.8 转换或拷贝文件dd..................................423
A.4 任务管理 ................................................424
A.4.1 单次任务at........................................424
A.4.2 周期任务cron..................................425