openresty + orange centos7 安裝

  

Orange

Orange是一個基於OpenResty的API網關。除Nginx的基本功能外,它還可用於API監控、訪問控制(鑑權、WAF)、流量篩選、訪問限速、AB測試、動態分流等。它有如下特性:mysql

  • 提供了一套默認的Dashboard用於動態管理各類功能和配置
  • 提供了API接口用於實現第三方服務(如個性化運維需求、第三方Dashboard等)
  • 可根據規範編寫自定義插件擴展Orange功能

使用

安裝依賴

  • OpenResty: 版本應在1.9.7.3+
    • Orange的監控插件須要統計http的某些狀態數據,因此須要編譯OpenResty時添加--with-http_stub_status_module
  • lor框架
  • MySQL

 

Orange啓動成功後, dashboard和API server也隨之啓動:nginx

  • 內置的Dashboard可經過http://localhost:9999訪問
  • API Server默認在7777端口監聽,如不須要API Server可刪除nginx.conf裏對應的配置

 

openresty安裝git

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

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

[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/nginxide

[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 

 

相關文章
相關標籤/搜索