yum -y install mariadb mariadb-server php php-mysqlnd nginx
systemctl start mariadb
mysql_secure_installation
create database zabbix character set utf8mb4 collate utf8mb4_bin;
grant all privileges on zabbix.* to zabbix@localhost identified by ‘123456’;
mysql -uzabbix -p123456
ubuntu 22.04 + apache + zabbix 7.0 LTS
https://www.zabbix.com/cn/download?zabbix=7.0&os_distribution=ubuntu&os_version=22.04&components=server_frontend_agent&db=mysql&ws=apache
zabbix-server
zabbix-agent
nginx
php-fpm
❌
把zabbix,换成prometheus。
据说负载均衡慢只可能是写错配置了
内部的flask也要挂上ssl证书,可以自签名
再装一个nginx
[root@www nginx-1.28.3]# wget https://nginx.org/download/nginx-1.28.3.tar.gz
./configure –prefix=/opt/nginx-flask-ssl –with-http_ssl_module
make
make install
# 生成自签名证书
cd /opt/nginx-flask-ssl/conf
openssl req -x509 -nodes -days 365 -newkey rsa:2048 \
-keyout flask-proxy.key \
-out flask-proxy.crt \
-subj “/CN=172.25.17.114”
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 8443 ssl; # 使用空闲端口 8443
server_name 172.25.17.114;
ssl_certificate /opt/nginx-flask-ssl/conf/flask-proxy.crt;
ssl_certificate_key /opt/nginx-flask-ssl/conf/flask-proxy.key;
location / {
proxy_pass http://127.0.0.1:5000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
}
}
}
/opt/nginx-flask-ssl/sbin/nginx -c /opt/nginx-flask-ssl/conf/nginx.conf
主nginx几处关键:
http {
upstream ebilibili_backend {
#ip_hash;
#least_conn;
#server 127.0.0.1:5000 max_fails=2 fail_timeout=30s;
server 127.0.0.1:8443 max_fails=2 fail_timeout=30s;
server backend.ebilibili.com:443 max_fails=2 fail_timeout=30s;
}
location /video/ {
proxy_ssl_verify off;
#proxy_pass http://127.0.0.1:5000/video/;
proxy_pass https://ebilibili_backend;
location /static/ {
proxy_ssl_verify off;
proxy_pass https://ebilibili_backend;
proxy_ssl_server_name on;
location /download {
proxy_ssl_verify off;
proxy_pass https://ebilibili_backend;
现在不管是www挂掉,还是backend挂掉,nginx都能快速处理转移到另一台服务器。
终于🥲
B是单向的从A获取,A不会主动访问B。正好避开炎火云共享IP和内网的二次转发🤗。
再加上redis主从:
A:
requirepass xxxxxxxxxxxxxx
bind 0.0.0.0
save 900 1
save 300 10
save 60 10000
appendonly yes
B:
requirepass xxxxxxxxxxxxxxxxxx
replicaof ip 6379
masterauth xxxxxxxxxxxxxxx
主从成功了,居然这么简单,这么顺利。
抖音评论:云计算运维还是网络安全呢?大专
运维吧,我也是安全的。班里45个人,我知道的只有一个人打算真的往安全行业就业。我在大二换方向转运维了。这个方向比较踏实。运气的成分少一些,学的东西固定一些,不会受到什么社会的阻力,以及未来可以离黑灰产业远一些。其实也得看个人,你自己探索吧,有人学个两三年就能冲src榜。很英雄主义,信息也很封闭,很多人刻意不想让你知道他是怎么做到的。很多先进的思路是不公开的,要自己一点点在各种地方收集才行,也很吃天赋。比谜语还谜语比急转弯还急转弯。
评论(1)