nginx-manager 安装配置
菜鸟工具
https://www.runoob.com/linux/nginx-install-setup.html
编译部分为:
默认的openssl
./auto/configure --prefix=/home/hwMindX --conf-path=/home/hwMindX/conf/nginx.conf --error-log-path=/home/hwMindX/log/error.log --http-log-path=/home/hwMindX/log/access.log --pid-path=/home/hwMindX/log/nginx.pid --lock-path=/home/hwMindX/log/nginx.lock --with-http_ssl_module --http-client-body-temp-path=/tmp/client_body_temp --http-proxy-temp-path=/tmp/proxy_temp --http-fastcgi-temp-path=/tmp/fastcgi_temp --http-uwsgi-temp-path=/tmp/uwsgi_temp --http-scgi-temp-path=/tmp/scgi_temp
指定openssl
cd ./opensource/pcre2/
autoreconf -ivf
./configure
cd ./opensource/nginx/"
chmod 750 auto/configure
./auto/configure --prefix=/home/hwMindX --with-openssl=./opensource/openssl/ --with-pcre=./opensource/pcre2/ --conf-path=/home/hwMindX/conf/nginx.conf --error-log-path=/home/hwMindX/logs/error.log --http-log-path=/home/hwMindX/logs/access.log --pid-path=/home/hwMindX/logs/nginx.pid --lock-path=/home/hwMindX/logs/nginx.lock --with-http_ssl_module --http-client-body-temp-path=/tmp/client_body_temp --http-proxy-temp-path=/tmp/proxy_temp --http-fastcgi-temp-path=/tmp/fastcgi_temp --http-uwsgi-temp-path=/tmp/uwsgi_temp --http-scgi-temp-path=/tmp/scgi_temp
make -j64
./auto/configure --prefix=/home/hwMindX \
--with-openssl=./opensource/openssl/ \
--with-pcre=./opensource/pcre2/ \
--conf-path=/home/hwMindX/conf/nginx.conf \
--error-log-path=/home/hwMindX/logs/error.log \
--http-log-path=/home/hwMindX/logs/access.log \
--pid-path=/home/hwMindX/logs/nginx.pid \
--lock-path=/home/hwMindX/logs/nginx.lock \
--with-http_ssl_module \
--http-client-body-temp-path=/tmp/client_body_temp \
--http-proxy-temp-path=/tmp/proxy_temp \
--http-fastcgi-temp-path=/tmp/fastcgi_temp \
--http-uwsgi-temp-path=/tmp/uwsgi_temp \
--http-scgi-temp-path=/tmp/scgi_temp
安装和依赖包地址:
https://github.com/nginx/nginx/archive/refs/tags/release-1.23.2.tar.gz
https://github.com/PhilipHazel/pcre2/releases/download/pcre2-10.39/pcre2-10.39.tar.gz
https://www.openssl.org/source/openssl-3.0.7.tar.gz
菜鸟的
./configure --prefix=/home/hwMindX --with-http_stub_status_module --with-http_ssl_module --with-pcre
实践中的问题
- docker build 报错
Sending build context to Docker daemon 90.26MB
Step 1/6 : FROM ubuntu:22.04 as build
---> 6a47e077731f
Step 2/6 : RUN useradd -d /home/hwMindX -u 9000 -m -s /usr/sbin/nologin hwMindX
---> Running in 52b7a928cb0a
Removing intermediate container 52b7a928cb0a
---> 5d4c2c37fed3
Step 3/6 : WORKDIR /home/hwMindX
---> Running in 1b85e2d97f78
Error removing intermediate container 1b85e2d97f78: No such container: 1b85e2d97f7844ec2a946025b68f119c86b79fc667f1f9006dc7c41e9067050e
---> 7b346b92034f
Step 4/6 : COPY nginx .
failed to export image: failed to set parent sha256:7b346b92034f74ee2159984fb3538364db9e83f05887b3fa1692237ed1a566e1: unknown parent image ID sha256:7b346b92034f74ee2159984fb3538364db9e83f05887b3fa1692237ed1a566e1
尝试解决:
- docker run -it 5d4c2c37fed3 /bin/bash 不能进
- systemctl daemon-reload 重启docker
- 换个环境低版本docker info可以运行
- 重装docker
- 发现居然有一个边侧,卸载了就可以了
问题定位
- 查看运行进程ps -ef|grep edge
- 查看edgecore再不断拉起
● edgecore.service - edgecore
Loaded: loaded (/lib/systemd/system/edgecore.service; enabled; vendor preset: enabled)
Active: activating (start-pre) since Sat 2023-09-23 09:17:07 UTC; 1ms ago
Cntrl PID: 2563854 (prepare.sh)
Tasks: 1 (limit: 76529)
Memory: 96.0K
CPU: 259us
CGroup: /system.slice/edgecore.service
└─2563854 /bin/bash /usr/local/mindx/MEFEdge/software/edge_core/script/prepare.sh /var/alog/MEFEdge_log /home/log/MEFEdge_logbackup
- cat /usr/local/mindx/MEFEdge/software/edge_core/script/prepare.sh
function ensure_pause_image()
{
if ! docker load < "${PAUSE_TAR_PATH}";then
echo "warning:load pause.tar.gz failed"
else
echo "load pause.tar.gz success"
fi
docker image prune -f
}
function main()
{
log_dir=$1
log_backup_dir=$2
edge_core_log_dir="${log_dir}/edge_core"
edge_core_log_backup_dir="${log_backup_dir}/edge_core"
edge_core_log="${log_dir}/edge_core/edge_core_run.log"
create_log_dir "$log_dir" 755
create_log_dir "$log_backup_dir" 755
create_log_dir "$edge_core_log_dir" 750
create_log_dir "$edge_core_log_backup_dir" 750
create_log "$edge_core_log" 640
# docker container prune -f
# docker image prune -f
ensure_pause_image
}
main "$@"
- 其中 docker container prune -f 和 docker image prune -f 会强制清除不使用的容器
- 并且edgecore子进程也在不停的重启
- 去掉shell中 docker xxx prune -f 就可以了
- 因为构建docker镜像需要用中间镜像,如果一定被清除,就无法构建
nginx-manager.yaml,apply之后,pod一直pending
1 原因定位:
通过kubectl describe xxx pod -n mindx-edge
报错提示: 0/1 nodes are available: 1 node(s) didn't match node selector
- 查看yaml 信息为 nodeSelector 配置错误且没有通过 k8s 命令设置
添加lable
kubectl label node hwuser masterselector=dls-master-node
删除lable
kubectl label node hwuser masterselector-
查看label
kubectl get nodes --show-labels
3.注意yaml中各个变量意义,修改的话,一定要注意对应的修改
nginx-manager.yaml,apply之后,pod一直crash
1 原因定位:
通过kubectl logs -f xxx pod -n mindx-edge
定位crash pod 的日志
本文来自博客园,作者:易先讯,转载请注明原文链接:https://www.cnblogs.com/gongxianjin/p/17724090.html
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· winform 绘制太阳,地球,月球 运作规律
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· AI 智能体引爆开源社区「GitHub 热点速览」
· 写一个简单的SQL生成工具