当前位置: 首页> 教育> 幼教 > app界面设计优秀案例_学网页设计需要什么基础_南昌网站seo_周口seo公司

app界面设计优秀案例_学网页设计需要什么基础_南昌网站seo_周口seo公司

时间:2025/7/9 22:05:42来源:https://blog.csdn.net/hqq181011/article/details/146434411 浏览次数:1次
app界面设计优秀案例_学网页设计需要什么基础_南昌网站seo_周口seo公司

1.要求

在这里插入图片描述

角色主机名软件IP地址
用户client192.168.72.90
keepalivedvip192.168.72.100
masterserverAkeepalived, nginx192.168.72.30
backupserverBkeepalived, nginx192.168.72.31
backupserverCkeepalived, nginx192.168.72.32
webtomcat1tomcat192.168.72.41
webtomcat2tomcat192.168.72.42
webtomcat3tomcat192.168.72.43
DNS轮询dnsnginx192.168.72.11

2.环境准备

2.1修改主机名和ip地址
web:

hostnamectl hostname tomact1
nmcli c modify ens160 ipv4.method manual ipv4.address 192.168.72.41 ipv4.gateway 192.168.72.2 ipv4.dns 223.5.5.5 connection.autoconnect yes
hostnamectl hostname tomact2
nmcli c modify ens160 ipv4.method manual ipv4.address 192.168.72.42 ipv4.gateway 192.168.72.2 ipv4.dns 
223.5.5.5 connection.autoconnect yes
hostnamectl hostname tomact3
nmcli c modify ens160 ipv4.method manual ipv4.address 192.168.72.42 ipv4.gateway 192.168.72.2 ipv4.dns 
223.5.5.5 connection.autoconnect yes

master:

hostnamectl hostname master
nmcli c modify ens160 ipv4.method manual ipv4.address 192.168.72.30 ipv4.gateway 192.168.72.2 ipv4.dns 223.5.5.5 connection.autoconnect yes

bacup1:

hostnamectl hostname backup1
nmcli c modify ens160 ipv4.method manual ipv4.address 192.168.72.31 ipv4.gateway 192.168.72.2 ipv4.dns 223.5.5.5 connection.autoconnect yes

backup2:

hostnamectl hostname tomact1
nmcli c modify ens160 ipv4.method manual ipv4.address 192.168.72.32 ipv4.gateway 192.168.72.2 ipv4.dns 223.5.5.5 connection.autoconnect yes

dns:

hostnamectl hostname dns
nmcli c modify ens160 ipv4.method manual ipv4.address 192.168.72.11 ipv4.gateway 192.168.72.2 ipv4.dns 223.5.5.5 connection.autoconnect yes

2.2配置仓库(所有虚拟机)

[BaseOS]
name=BaseOS
baseurl=/mnt/BaseOS
gpgcheck=0
[AppStream]
name=AppStream
baseurl=/mnt/AppStream
gpgcheck=0

2.3挂载仓库(所有虚拟机)

mount /dev/sr0 /mnt

2.4关闭防火墙和selinux(所有虚拟机)

systemctl stop firewalld
setenforce 0

3.配置tomact服务

3.1下载tomact
官网:https://tomcat.apache.org/
tomact1:

wgt  https://dlcdn.apache.org/tomcat/tomcat-11/v11.0.5/bin/apache-tomcat-11.0.5.tar.gz
ls

apache-tomcat-11.0.5.tar.gz

3.2解压并配置环境

tar -xzf apache-tomcat-11.0.5.tar.gz -C /usr/local
vim /etc/profile
export TOMACT_HOME=/usr/local/apache-tomcat-11.0.5
export PAHT=$PATH:$TOMACT_HOME/bin

3.3下载jdk
官网:https://www.oracle.com

wget  https://download.oracle.com/java/21/latest/jdk-21_linux-x64_bin.tar.gz
ls jdk-21_linux-x64_bin.tar.gz

3.4 解压并配置环境

tar- xzf jdk-21_linux-x64_bin.tar.gz -C /usr/local
vim /usr/local
export JAVA_HOME=/usr/local/jdk-21.0.6
export PATH=$PATH:$JAVA_HOME/bin
vim /usr/local/apache-tomcat-11.0.5/webapps/
ls

docs examples host-manager manager ROOT

rm -rf docs  examples  host-manager  manager  
cd ROOT
rm -rf *
vim index.jsp
tomact1 192.168.72.41

3.5启动文件

source /ect/profile
startup.sh
curl 192.168.72.41:8080

tomact 192.168.72.41

tomact2
复制相关配置文件(tomact1上进行)

scp -r /usr/local/jdk-21.0.6/ root@192.168.72.42:/usr/local
scp -r /usr/local/apache-tomcat-11.0.5/ root@192.168.72.42:/usr/local
scp -r /etc/profile root@192.168.72.42:/etx/profile

验证复制的目录

source /etc/profile
startup.sh

修改tomact主页

cd /usr/local/apache-tomcat-11.0.5/webapps/
ls

docs examples host-manager manager ROOT

rm -rf docs examples host-manager manager 
cd ROOT
rm -rf *
vim index.jsp
tomact2 192.168.72.42

启动tomact

startup.sh
curl 192.168.72.42> tomact2 3192.168.72.42

tomact3:
复制相关配置文件(tomact1上进行)

scp -r /usr/local/jdk-21.0.6/ root@192.168.72.43:/usr/local
scp -r /usr/local/apache-tomcat-11.0.5/ root@192.168.72.43:/usr/local
scp -r /etc/profile root@192.168.72.43:/etx/profile

验证复制的目录

source /etc/profile
startup.sh

修改tomact主页

cd /usr/local/apache-tomcat-11.0.5/webapps/
ls

docs examples host-manager manager ROOT

rm -rf docs examples host-manager manager 
cd ROOT
rm -rf *
vim index.jsp
tomact3 192.168.72.43

启动tomact

startup.sh
curl 192.168.72.43> tomact 3192.168.72.43

4.keepalived和nginx相关服务

4.1下载nginx和keepalived
mastr:

dnf install nginx -y
dnf install keepalived

4.2配置nginx

vim /etc/nginx/conf.d/master.conf
upstream tpmact1 {server 192.168.72.41:8080;server 192.168.72.42:8080;server 192.168.72.43:8080;
}
server{server_name 192.168.72.30;listen 80;access_log /var/log/nginx/master_access.log;error_log /var/log/nginx/master_error.log;location / {proxy_pass http://tomact1}
}

4.3配置keepalived

vim /etc/keepalived/keepalived.conf
global_defs {router_id master
}vrrp_instance VI_1 {state MASTERinterface ens160virtual_router_id 51priority 100advert_int 1authentication {auth_type PASSauth_pass 1111}virtual_ipaddress {192.168.72.100}
}
vrrp_instance VI_1 {state BACKUPinterface ens160virtual_router_id 51priority 80advert_int 1authentication {auth_type PASSauth_pass 1111}virtual_ipaddress {192.168.72.101}
}
vrrp_instance VI_1 {state BACKUPinterface ens160virtual_router_id 51priority 60advert_int 1authentication {auth_type PASSauth_pass 1111}virtual_ipaddress {192.168.72.102}
}

4.4配置nginx高可用

vim /etc/keepalived/check_nginx.sh
#!/bin/bash
counter=$(ps -C nginx --no-header | wc -l)
if [$counter -eq 0]; thensystemctl start nginxif [`ps  -C --no-header | wc -l` -eq 0]; thensystemctl stop keepalivedfi
fi

4.5给脚本赋予执行权限

chmod +x /etc/keepalived/check_nginx.sh

4.6修改keepalived.conf文件

vim /etc/keepalived/keepalived.conf
global_defs {router_id master
}
vrrp_script check_nginx{script  "/etc/keepalived/check_nginx.sh"interval 2}
vrrp_instance VI_1 {state MASTERinterface ens160virtual_router_id 51priority 100advert_int 1authentication {auth_type PASSauth_pass 1111}virtual_ipaddress {192.168.72.100}track check_nginx{check_nginx}
}
vrrp_instance VI_1 {state BACKUPinterface ens160virtual_router_id 51priority 80advert_int 1authentication {auth_type PASSauth_pass 1111}virtual_ipaddress {192.168.72.101}track check_nginx{check_nginx}
}
vrrp_instance VI_1 {state BACKUPinterface ens160virtual_router_id 51priority 60advert_int 1authentication {auth_type PASSauth_pass 1111}virtual_ipaddress {192.168.72.102}track check_nginx{check_nginx}
}

4.7启动keepalived和nginx

systemctl start keepalived
systemctl start nginx

4.8 测试

curl192.168.72.30> tomact1 192.168.72.41 tomact1 192.168.72.42 tomact1 192.168.72.43

backup1:
下载nginx和keepalived

dnf install nginx -y
dnf install keepalived -y

复制相关配置文件(master上进行)

scp /etc/keepalived/keepalived.conf root@192.168.72.31:/etc/keepalived/keepalived.conf/
scp /etc/keepalived/check_nginx.sh root@192.168.72.31:/etc/keepalived/

查看脚本文件

ls /etc/keepalived/check_nginx.sh

修改keepalived.conf文件

vim /etc/keepalived/keepalived.conf
global_defs {router_id backup
}
vrrp_script check_nginx{script  "/etc/keepalived/check_nginx.sh"interval 2}
vrrp_instance VI_1 {state BACKUPinterface ens160virtual_router_id 51priority 60advert_int 1authentication {auth_type PASSauth_pass 1111}virtual_ipaddress {192.168.72.100}track check_nginx{check_nginx}
}
vrrp_instance VI_1 {state MASTERinterface ens160virtual_router_id 51priority 100advert_int 1authentication {auth_type PASSauth_pass 1111}virtual_ipaddress {192.168.72.101}track check_nginx{check_nginx}
}
vrrp_instance VI_1 {state BACKUPinterface ens160virtual_router_id 51priority 80advert_int 1authentication {auth_type PASSauth_pass 1111}virtual_ipaddress {192.168.72.102}track check_nginx{check_nginx}
}

启动nginx和keepalived


```bash
systemctl start nginx
systemctl start keepalived
测试:```bash
curl 192.168.72.31> tomact1 192.168.72.41 tomact1 192.168.72.42 tomact1 192.168.72.43

backup2:
下载nginx和keepalived

dnf install nginx -y
dnf install keepalived -y

复制相关配置文件(master上进行)

scp /etc/keepalived/keepalived.conf root@192.168.72.32:/etc/keepalived/keepalived.conf/
scp /etc/keepalived/check_nginx.sh root@192.168.72.32:/etc/keepalived/

查看脚本文件

ls /etc/keepalived/check_nginx.sh

修改keepalived.conf文件

vim /etc/keepalived/keepalived.conf
global_defs {router_id backup
}
vrrp_script check_nginx{script  "/etc/keepalived/check_nginx.sh"interval 2}
vrrp_instance VI_1 {state BACKUPinterface ens160virtual_router_id 51priority 80advert_int 1authentication {auth_type PASSauth_pass 1111}virtual_ipaddress {192.168.72.100}track check_nginx{check_nginx}
}
vrrp_instance VI_1 {state BACKUPinterface ens160virtual_router_id 51priority 60advert_int 1authentication {auth_type PASSauth_pass 1111}virtual_ipaddress {192.168.72.101}track check_nginx{check_nginx}
}
vrrp_instance VI_1 {state MASTERinterface ens160virtual_router_id 51priority 100advert_int 1authentication {auth_type PASSauth_pass 1111}virtual_ipaddress {192.168.72.102}track check_nginx{check_nginx}
}

启动nginx和keepalived


```bash
systemctl start nginx
systemctl start keepalived

测试:```bash
curl 192.168.72.32> tomact1 192.168.72.41 tomact1 192.168.72.42 tomact1 192.168.72.43

5.dns相关配置:

5.1下载nginx

dnf install nginx -y

5.2配置文件

vim /etc/nginx/conf.d/dns.conf
upstream web {server 192.168.72.100;server 192.168.72.101;server 192.168.72.102;}
server {server_name 192.168.72.11;listen 80;access_log /var/log/ngonx/dns_access.log;error_log /var/log/nginx/dns_error.log;location / {proxy_pass http://web;}}

5.3 启动nginx

systemctl start nginx

5.4 测试

curl 1912.168.72.100> tomact1 192.168.72.41 tomact1 192.168.72.42 tomact1 192.168.72.43

至此,keepalived+nginx+tomact的高可用轮询搭建完成

关键字:app界面设计优秀案例_学网页设计需要什么基础_南昌网站seo_周口seo公司

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: