当前位置:网站首页>YAPI安装
YAPI安装
2022-07-26 04:25:00 【、wook】
前言: yapi安装所需要的依赖有点多,要不是公司用习惯了还真不想搞这个。。。
2.linux版本
1.安装node
curl -sL https://rpm.nodesource.com/setup_12.x | bash -
yum install -y nodejs
node -v
# 更新yum
yum -y update


2.通过yum安装MongoDB
可以通过官网下载压缩包安装:https://www.mongodb.com/try/download/community本文通过yum安装。
# 创建MongoDB源文件
touch /etc/yum.repos.d/mongodb-org.repo
# 编辑并写入下面的程序,注意5.0的位置,如果自己下的是6.0,就要改成6.0。鼠标放在上图的 copy link 可看出版本
vim /etc/yum.repos.d/mongodb-org.repo
[mongodb-org]
name=MongoDB Repository
baseurl=http://mirrors.aliyun.com/mongodb/yum/redhat/7Server/mongodb-org/5.0/x86_64/
gpgcheck=0
enabled=1
# 安装MongoDB
yum install -y mongodb-org

# 启动MongoDB
service mongod start
如果出现如下错误:(未出现直接跳到第三小点,开启启动!!!!!!!)
Redirecting to /bin/systemctl start mongod.service
Job for mongod.service failed because a fatal signal was delivered to the control process. See “systemctl status mongod.service” and “journalctl -xe” for details.
可执行下面命令查看配置
vim /etc/mongod.conf

可以输入 systemctl status mongod.service 查看错误信息,如果出现和我一样的错,好像是版本问题,试了几种方式都不行,最终我只能降低版本到 4.0,如果是其他错误可能是权限问题,百度解决即可。
清空mongodb相关信息
#移除安装包
sudo yum erase $(rpm -qa | grep mongodb-org)
#删除日志
sudo rm -r /var/log/mongodb
sudo rm -r /var/lib/mongo
#我这边好像还得删除 /etc/yum.repos.d/mongodb-org.repo ,然后重新创建
#再检查下
yum list installed | grep mongo
#如果上一步有识别除信息,复制到下一句 erase后面删除
#yum erase XXX (XX 例 mongodb-server.x86_64 为上一步查出的list)
#额外添加一行 gpgkey=https://www.mongodb.org/static/pgp/server-4.0.asc
vim /etc/yum.repos.d/mongodb-org.repo
#安装4.0版本
yum -y install mongodb-org-4.0.1 mongodb-org-mongos-4.0.1 mongodb-org-server-4.0.1 mongodb-org-shell-4.0.1 mongodb-org-tools-4.0.1
#启动
service mongod start

3.设置开机启动
chkconfig mongod on
注:如果提示Failed to execute operation: No such file or directory
这里是因为linux版本是centos是7.0以上版本,需要执行下面代码,如果没报错就忽略
systemctl enable mongod.service
#注释掉 127.0.0.1 ,即能远程访问
vim /etc/mongod.conf

#重启
service mongod restart
3.安装ypai
# 开放端口 3000和 9000
vim /etc/sysconfig/iptables
#安装yapi
npm install -g yapi-cli --registry https://registry.npm.taobao.org
yapi server

我的yapi目录装完后是在/usr/software/nodejs/bin
在该目录下执行./yapi server
浏览器访问:http://ip:9090/ (可视化部署)
图中所示3000是yapi后台地址,27017是刚刚安装的mongondb的连接端口,由于是内网,所以服务器没有必要开放27017端口。(记录下:/usr/software/nodejs/bin/my-yapi)
奇怪的问题比较多,1.4.1是默认的,但是点击开始部署时出错了,此处我将其替换为 1.8.0就成功了。。。
初始化管理员账号成功,账号名:“[email protected]”,密码:“ymfe.org”
部署成功,请切换到部署目录,输入: “node vendors/server/app.js” 指令启动服务器, 然后在浏览器打开 http://ip:3000 访问
4.启动yapi后台服务器
#前面输出的目录
cd /usr/software/nodejs/bin/my-yapi
#启动服务
#node vendors/server/app.js
#后台运行
service iptables restart
nohup node vendors/server/app.js &

边栏推荐
- Li Kou daily question - day 42 -661. Picture smoother
- Day24 job
- Soft simulation rasterization renderer
- Analyzing the curriculum design evaluation system of steam Education
- makefile知识再整理(超详细)
- 生活相关——减少期待,更快乐
- Page pull-up refresh and pull-down loading
- Weights & Biases (二)
- How to write the summary? (including 7 easily ignored precautions and a summary of common sentence patterns in 80% of review articles)
- Apisex's exploration in the field of API and microservices
猜你喜欢
![[SVN] please execute the 'cleanup' command appears all the time. The solution is that there is no response after cleanup](/img/44/69c434fc9564078e11735881d9bf34.png)
[SVN] please execute the 'cleanup' command appears all the time. The solution is that there is no response after cleanup

Unable to find sygwin.s file during vscode debugging

Wu Enda's machine learning after class exercises - logical regression

文献|关系研究能得出因果性结论吗

Optimization analysis and efficiency execution of MySQL
![[C language foundation] 13 preprocessor](/img/4c/ab25d88e9a0cf29bde6e33a2b14225.jpg)
[C language foundation] 13 preprocessor

支持代理直连Oracle数据库,JumpServer堡垒机v2.24.0发布

Acwing_ 12. Find a specific solution for the knapsack problem_ dp

What if win11 cannot wake up from sleep? Solution of win11 unable to wake up during sleep

Huawei executives talk about the 35 year old crisis. How can programmers overcome the worry of age?
随机推荐
Web Test Method Encyclopedia
荐书|《DBT技巧训练手册》:宝贝,你就是你活着的原因
UE4 通过按键控制物体的旋转
1. Mx6u-alpha development board (main frequency and clock configuration experiment)
FFmpeg 视频添加水印
Day26 job
Wu Enda's machine learning after class exercises - linear regression
Recommendation Book Educational Psychology: a book for tomorrow's teachers~
p-范数(2-范数 即 欧几里得范数)
Huawei executives talk about the 35 year old crisis. How can programmers overcome the worry of age?
Creative design principle of youth maker Education
Pat class a 1039 course list for student
SEGGER Embedded Studio找不到xxx.c或者xxx.h文件
Function knowledge points
RTSP/Onvif协议视频平台EasyNVR服务一键升级功能的使用教程
MySQL only checks the reasons for the slow execution of one line statements
Steam科学教育赋予课堂教学的创造力
Day24 job
Use of anonymous functions
Segger embedded studio cannot find xxx.c or xxx.h file