01 2022 档案

摘要:🔗haproxy https实现 🔗总结tomcat的核心组件以及根目录结构 🔗tomcat实现多虚拟主机 🔗nginx实现后端tomcat的负载均衡调度 🔗简述memcached的工作原理 阅读全文
posted @ 2022-01-26 00:39 火火7412 阅读(44) 评论(0) 推荐(0)
摘要:安装软件包 [root@CentOS7 ~]#apt install tree 删除软件包 [root@CentOS7 ~]# apt remove tree 列出仓库软件包 [root@CentOS7 ~]# apt list 搜索软件包 [root@CentOS7 ~]# apt search 阅读全文
posted @ 2022-01-26 00:36 火火7412 阅读(47) 评论(0) 推荐(0)
摘要:#利用sed 取出ifconfig命令中本机的IPv4地址 [root@CentOS7 ~]#ifconfig |sed -nr '2s@inet +(.*) +n.*@\1@p' #删除/etc/fstab文件中所有以#开头,后面至少跟一个空白字符的行的行首的#和空白字符 [root@CentOS 阅读全文
posted @ 2022-01-26 00:35 火火7412 阅读(37) 评论(0) 推荐(0)
摘要:编译安装http2.4 ##1.安装相关依赖包 [root@centos7 ~]yum -y install gcc make 2.下载http2.4包,并解压 [root@centos7 ~]#tar xvf httpd-2.4.48.tar.gz 3.进入解压后的文件夹,运行configure文 阅读全文
posted @ 2022-01-26 00:32 火火7412 阅读(34) 评论(0) 推荐(0)
摘要:#一、本地源 tep1 添加光驱并挂载 [root@CentOS7 ~]#mkdir applocation/Centos7 -p [root@CentOS7 ~]#mount /dev/sr1 /applocation/Centos7 [root@CentOS7 ~]#lsblk NAME MAJ 阅读全文
posted @ 2022-01-26 00:29 火火7412 阅读(40) 评论(0) 推荐(0)
摘要:##一、目录结构说明 进入到tomcat的文件目录,可以看到以下目录结构 每一个目录都有各自的功能,如下所示: ##1.1 bin目录 1.2 conf目录 1.3 logs目录 #二、核心组件 tomcat核心组件有六个,分别是Server, Service,Engine,Connector,Ho 阅读全文
posted @ 2022-01-25 23:00 火火7412 阅读(277) 评论(0) 推荐(0)
摘要:🔗简述keepalived工作原理 🔗编译安装haproxy 🔗总结haproxy各调度算法的实现方式及其应用场景 🔗使用haproxy的ACL实现基于文件后缀名的动静分离 阅读全文
posted @ 2022-01-25 22:18 火火7412 阅读(24) 评论(0) 推荐(0)
摘要:#一、静态算法 ##1.1 static-rr 基于权重的轮询调度,不支持运行时利用socat进行权重的动态调整(只支持0和1,不支持其它值)及后端服务器慢启动,其后端主机数量没有限制,相当于LVS中的 wrr。 listen web_host bind 10.0.0.7:80 mode http 阅读全文
posted @ 2022-01-25 22:09 火火7412 阅读(139) 评论(0) 推荐(0)
摘要:#1.Keepalived 定义 Keepalived 是一个基于VRRP协议来实现的LVS服务高可用方案,可以利用其来避免单点故障。一个LVS服务会有2台服务器运行Keepalived,一台为主服务器(MASTER),一台为备份服务器(BACKUP),但是对外表现为一个虚拟IP,主服务器会发送特定 阅读全文
posted @ 2022-01-25 21:41 火火7412 阅读(1155) 评论(0) 推荐(0)
摘要:#一、编译安装nginx 请跳转查阅:编译安装nginx #二、tomcat的二进制安装 请跳转查阅:二进制安装tomcat #三、配置nginx代理 # cat /apps/nginx/conf/nginx.conf worker_processes 1; events { worker_conn 阅读全文
posted @ 2022-01-25 21:25 火火7412 阅读(62) 评论(0) 推荐(0)
摘要:#一、安装lua环境 ##1.1 安装依赖包 [root@centos7 ~]# yum install gcc readline-devel ##1.2 下线lua源码包并解压 [root@centos7 ~]#wget http://www.lua.org/ftp/lua-5.3.5.tar.g 阅读全文
posted @ 2022-01-25 18:23 火火7412 阅读(192) 评论(0) 推荐(0)
摘要:一、安装JDK 1.1 下载JDK 官网下载地址 1.2 安装JDK #cat install_jdk.sh #!/bin/bash DIR=`pwd` JDK_FILE="jdk-8u291-linux-x64.tar.gz" JDK_DIR="/usr/local" color () { RES 阅读全文
posted @ 2022-01-25 16:58 火火7412 阅读(75) 评论(0) 推荐(0)
摘要:#一、安装tomcat 请查看🔗:二进制安装tomat #二、配置虚拟主机 ##2.1 修改server.xml # vim /usr/local/tomcat/conf/server.xml ...省略 #在最下面添加以下内容 <Host name="www.a.com" appBase="/d 阅读全文
posted @ 2022-01-25 16:58 火火7412 阅读(61) 评论(0) 推荐(0)
摘要:#一、实验环境 #一、准备后端服务器 # yum -y install nginx # echo "10.0.0.7" > /usr/share/nginx/html/index.html #web1 # echo "10.0.0.17" > /usr/share/nginx/html/index. 阅读全文
posted @ 2022-01-24 22:29 火火7412 阅读(71) 评论(0) 推荐(0)
摘要:#一、环境准备 #二、实现proxy [root@localhost ~]# yum -y install haproxy #创建子配置 [root@localhost ~]# mkdir /etc/haproxy/conf.d #修改service文件 [root@localhost ~]# vi 阅读全文
posted @ 2022-01-24 22:29 火火7412 阅读(53) 评论(0) 推荐(0)
摘要:🔗nginx负载均衡中常见的算法及原理有哪些? 🔗用rewrite规则实现将所有到a域名的访问rewrite到b域名 🔗实现反向代理客户端IP透传 🔗利用LNMP实现wordpress站点搭建 阅读全文
posted @ 2022-01-16 21:21 火火7412 阅读(27) 评论(0) 推荐(0)
摘要:#一、nginx负载均衡常用算法 ##1.1 轮询 轮询,nginx默认方式。一次将请求分配给各个后台服务器。 upstream backserver { server 10.0.0.7; server 10.0.0.8; } 1.2 加权轮询 根据权重加权依次轮询,默认为1,实现类似于LVS中的W 阅读全文
posted @ 2022-01-16 21:20 火火7412 阅读(191) 评论(0) 推荐(0)
摘要:#一、部署MySQL ##1.1 二进制安装mysql5.6 # 准备用户,依赖包,二进制程序 [root@nginx ~]# yum install -y libaio perl-Data-Dumper autoconf [root@nginx ~]# groupadd -r mysql [roo 阅读全文
posted @ 2022-01-16 21:00 火火7412 阅读(161) 评论(0) 推荐(0)
摘要:默认情况下,使用反向代理时,后端服务器只能看到访问是从反向代理服务器的IP,无法真正识别到客户端IP。通过配置IP透传实现后端服务器识别到客户端真实IP。 一、Apache后端服务器部署 ##1.1 安装apaceh [root@web ~]# yum -y install httpd 1.2 修改 阅读全文
posted @ 2022-01-16 14:23 火火7412 阅读(404) 评论(0) 推荐(0)
摘要:1、临时重定向 1.1使用redirect实现临时重定向 # cat /apps/nginx/conf/nginx.conf ...省略... server { listen 80; server_name www.a.com; location / { root /data/nginx/html/ 阅读全文
posted @ 2022-01-13 20:42 火火7412 阅读(100) 评论(0) 推荐(0)
摘要:🔗对常用I/O模型进行比较说明 🔗nginx中的模块分类及常见核心模块有哪些 🔗描述nginx中worker_processes、worker_cpu_affinity、worker_rlimit_nofile、worker_connections配置项的含义 🔗编译安装nginx,实现多域 阅读全文
posted @ 2022-01-10 22:16 火火7412 阅读(32) 评论(0) 推荐(0)
摘要:worker_processes worker进程的数量,应小于等于cpu核心数,auto为当前主机cpu核心数 work_processes 4 worker_cpu_affinity 配置CPU亲和,将worker进程与通过cpumask与指定cpu绑定,减少切换造成的CPU时间损耗. work 阅读全文
posted @ 2022-01-10 22:15 火火7412 阅读(508) 评论(0) 推荐(0)
摘要:#1、模块分类 核心模块:是 Nginx 服务器正常运行必不可少的模块,提供错误日志记录 、配置文件解析 、事件驱动机制 、进程管理等核心功能 标准HTTP模块:提供 HTTP 协议解析相关的功能,比如: 端口配置 、 网页编码设置 、 HTTP响应头设置 等等 可选HTTP模块:主要用于扩展标准的 阅读全文
posted @ 2022-01-10 22:05 火火7412 阅读(405) 评论(0) 推荐(0)
摘要:#一、IO模型的四个特性 关注的是消息通信机制,即调用者在等待一件事情的处理结果时,被调用者是否提供完成状态的通知。 同步:synchronous,被调用者并不提供事件的处理结果相关的通知消息,需要调用者主动询问事情是否处理完成 异步:asynchronous,被调用者通过状态、通知或回调机制主动通 阅读全文
posted @ 2022-01-10 21:59 火火7412 阅读(130) 评论(0) 推荐(0)
摘要:一、编译安装nginx ##1.1 获取源码包 [root@cetnos7 ~]#wget -O /usr/local/src/nginx-1.18.0.tar.gz http://nginx.org/download/nginx-1.18.0.tar.gz [root@cetnos7 ~]#cd 阅读全文
posted @ 2022-01-10 20:51 火火7412 阅读(87) 评论(1) 推荐(0)
摘要:🔗实现基于MYSQL验证的vsftpd虚拟用户访问 🔗配置samba共享,实现/www目录共享 🔗使用rsync+inotify实现/www目录实时同步 🔗LVS调度算法总结 🔗LVS的跨网络DR实现 阅读全文
posted @ 2022-01-03 15:58 火火7412 阅读(20) 评论(0) 推荐(0)
摘要:LVS 调试算法分为两种:静态方法和动态方法。 静态方法 RR:轮询 WRR:加权轮询 SH:源地址哈希,将来自于同一个IP地址的请求始终发往第一次挑中的RS,从而实现会话绑定 DH:目标地址哈希,第一次轮询调度至RS,后续将发往同一个目标地址的请求始终转发至第一次挑中的RS FO: 加权故障转移 阅读全文
posted @ 2022-01-03 15:57 火火7412 阅读(75) 评论(0) 推荐(0)
摘要:一、网络配置 ##1.1 客户端 #客户端配置 [root@client ~]#cat /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0 NAME=eth0 BOOTPROTO=static IPADDR=192.168.50.6 GATEW 阅读全文
posted @ 2022-01-03 15:45 火火7412 阅读(48) 评论(0) 推荐(0)