首页 技术 正文
技术 2022年11月21日
0 收藏 346 点赞 2,599 浏览 1675 个字

  

Orange

Orange是一个基于OpenResty的API网关。除Nginx的基本功能外,它还可用于API监控、访问控制(鉴权、WAF)、流量筛选、访问限速、AB测试、动态分流等。它有以下特性:

  • 提供了一套默认的Dashboard用于动态管理各种功能和配置
  • 提供了API接口用于实现第三方服务(如个性化运维需求、第三方Dashboard等)
  • 可根据规范编写自定义插件扩展Orange功能

使用

安装依赖

  • OpenResty: 版本应在1.9.7.3+

    • Orange的监控插件需要统计http的某些状态数据,所以需要编译OpenResty时添加--with-http_stub_status_module
  • lor框架
  • MySQL

Orange启动成功后, dashboard和API server也随之启动:

  • 内置的Dashboard可通过http://localhost:9999访问
  • API Server默认在7777端口监听,如不需要API Server可删除nginx.conf里对应的配置

openresty安装

[root@k8s5 ~]#  wget  https://openresty.org/download/openresty-1.11.2.2.tar.gz

[root@k8s5 ~]#  tar  -zxvf openresty-1.11.2.2.tar.gz

[root@k8s5 ~]#  yum -y install libuuid-devel   pcre-devel openssl-devel   zlib-devel

[root@k8s5 ~]#  ./configure –with-http_stub_status_module –with-http_v2_module –with-http_ssl_module

[root@k8s5 ~]#  gmake && gmake install

[root@k8s5 ~]#  ln -s /usr/local/openresty/nginx/sbin/nginx /usr/sbin/nginx

[root@k8s5 ~]#  ln -s /usr/local/openresty/bin/resty /usr/bin/resty

安装mariadb

[root@k8s5 ~]#   yum  -y  install   mariadb-server mariadb

[root@k8s5 ~]#  mysql -u root -p

[root@k8s5 ~]#  CREATE DATABASE orange CHARACTER SET utf8 COLLATE utf8_general_ci;

[root@k8s5 ~]#   grant all on *.* to ‘orange’@’%’ identified by ‘orange’;

[root@k8s5 ~]#   source /root/orange/install/orange-v0.6.4.sql    #导入的orange的数据库

安装lor 框架

[root@k8s5 ~]#   git clone https://github.com/sumory/lor

[root@k8s5 ~]#   cd lor

[root@k8s5 ~]#    make install

安装 orange

[root@k8s5 ~]#     https://github.com/sumory/orange.git

[root@k8s5 ~]#   cd orange

[root@k8s5 ~]#   make install   会在/usr/local/orange 目录生成路径

[root@k8s5 ~]#   cp start.sh   /usr/local/orange/

修改  /usr/local/orange/config/中 nginx.conf.example  , orange.conf.example

主要修改orange.conf.example 配置文件

openresty + orange centos7 安装

启动orange

[root@k8s5 ~]#   cd /usr/local/orange

[root@k8s5 ~]#  sh start.sh

openresty + orange centos7 安装

openresty + orange centos7 安装

访问地址 http://192.168.20.233:9999

openresty + orange centos7 安装

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:8,997
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,511
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,356
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,139
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,770
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,848