orange网关

几天之前试用过了kong效果不理想 ,今天来使用下小米出品(存疑?)的 orange网关。 一个明显的区别是 kong的后端存储使用了postgresql,orange使用的是mysql。 好了,废话不多说,贴出安装部署的过程如下: 安装 mysql 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 #!/bin/bash wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm sudo rpm -ivh mysql-community-release-el7-5.noarch.rpm sudo yum update sudo yum install mysql-server sudo systemctl start mysqld sudo systemctl enable mysqld sudo mysql_secure_installation vi save_your_root_pwd git clone https://github.com/sumory/orange.git cd orange/ ls cd install/ ls head orange-v0.6.4.sql head -n 100 orange-v0.6.4.sql head -n 50 orange-v0.6.4.sql mysql -V mysql -u root -p cd orange/ cd install/ ls mysql -u o_usr -p o_database < orange-v0.6.4.sql mysql -u o_usr -p o_database orange 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 #!/bin/bash yum remove kong-community-edition ## get rid of annoying lua 5.1 version conflict cd /data/nginx/conf/ cp api.conf api.conf.bak.18.03.09 ## always backup conf files : ) nginx -s stop netstat -nlp | grep 443 mv /usr/sbin/nginx /usr/sbin/nginx_old yum install yum-utils yum-config-manager --add-repo https://openresty.org/package/centos/openresty.repo yum install openresty openresty-resty -y git clone https://github.com/sumory/orange.git git clone https://github.com/sumory/lor.git pwd mv lor ~ mv orange ~ cd ls cd lor/ make install cd ../orange/ make install cd ln -s /usr/local/bin/orange /bin/orange ln -s /usr/local/openresty/nginx/sbin/nginx /bin/nginx mv /home/deoops/orange.conf /home/deoops/nginx.conf /usr/local/orange/conf/ vi /usr/local/orange/conf/orange.conf ## make sure orange.conf has the right mysql server info vi /data/nginx/conf/api.conf chown root:root /usr/local/orange/conf/*.conf orange start netstat -nlp | grep 443 小结 用了几天,感觉UI比起kong来说简单些,开箱即用的功能比kong也多一些。 稳定性还有待进一步的观察。 ...

February 5, 2018 · datewu

kong网关

updated: kong不满足要求,后面调研了另外一个API产品 orange 2015年接触openresty的时候接触过kong,了解到kong是基于openresty二次开发的商业产品, 正好目前新公司要调研稳定好用的API Gateway产品,所以本文简单记录下我对kong的安装配置感受。 安装 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 yum install https://bintray.com/kong/kong-community-edition-rpm/download_file?file_path=centos/7/kong-community-edition-0.12.1.el7.noarch.rpm kong systemctl stop nginx netstat -nlp netstat -nlp|grep 80 ls date vi /etc/kong/kong.conf.default vipw su - postgres create user kong; create database kong ownner kong; create database kong owner kong; cd /etc/kong/ cp kong.conf.default kong.conf vi kong.conf kong migrations up psql -U kong tail /media/data/pgdata/log/postgresql-Wed.log vi /media/data/pgdata/pg_hba.conf systemctl restart postgresql-10.service kong migrations up kong kong check kong start netstat -nlp | grep 80 which nginx curl localhost: netstat -nlp vi /usr/local/kong/nginx-kong.conf which -a nginx kong kong restart --nginx-conf /etc/nginx/nginx.conf cp /etc/nginx/nginx.conf /etc/nginx/nginx.conf.tmpl vi /etc/nginx/nginx.conf.tmpl kong restart --nginx-conf /etc/nginx/nginx.conf.tmpl which -a npm 安装控制台 使用 ...

February 3, 2018 · datewu