openresty + orange centos7 安装

  

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 配置文件

 

 启动orange

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

[root@k8s5 ~]#  sh start.sh

 

 

访问地址 http://192.168.20.233:9999 

 

 

posted @ 2017-06-20 15:03  fengjian1585  阅读(773)  评论(0编辑  收藏  举报