A Managerment API Gateway in Java . Fizz Gateway 是一个基于 Java开发的微服务网关,能够实现热服务编排、自动授权选择、线上服务脚本编码、在线测试、高性能路由、API审核管理、回调管理等目的,拥有强大的自定义插件系统可以自行扩展,并且提供友好的图形化配置界面,能够快速帮助企业进行API服务治理、减少中间层胶水代码以及降低编码投入、提高 API 服务的稳定性和安全性
wget https://downloads.mysql.com/archives/get/p/23/file/mysql-5.7.30-1.el6.x86_64.rpm-bundle.tar # 解压 tar -xvf mysql-5.7.30-1.el6.x86_64.rpm-bundle.tar # 安装 sudo yum install mysql-community-{server,client,common,libs}-* # 启动 sudo service mysqld start
[root@localhost ~]# sudo service mysqld start Initializing MySQL database: [ OK ] Starting mysqld: [ OK ] 初始密码 sudo grep 'temporary password' /var/log/mysqld.log 使用初始密码登录 mysql -uroot -p 修改密码 ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass4!'; 退出登录 quit
nacos: discovery: # if use Nacos discovery set this flag to true enabled: true # 设置为true启用Nacos注册中心 # need replace server-addr: 127.0.0.1:8848 # 设置Nacos服务的IP地址以及端口 # need replace namespace: public # 设置服务使用的命名空间 register: group-name: fizz-gateway
nacos: config: # if use Nacos config set this flag to true enabled: false # need replace server-addr: 127.0.0.1:8848 auto-refresh: true group: fizz-gateway data-id: application type: PROPERTIES # need replace namespace: public discovery: # if use Nacos discovery set this flag to true enabled: true # 设置为true启用Nacos注册中心 # need replace server-addr: 127.0.0.1:8848 # 设置Nacos服务的IP地址以及端口 # need replace namespace: public # 设置服务使用的命名空间 auto-register: true register: group-name: fizz-gateway
@RestController @RequestMapping("/api") public class DemoController { @GetMapping("/echo") public Result echo(@RequestParam("msg") String msg) { Result result = new Result(); result.setMsg(msg); return result; }
static class Result { private Integer code = 0; private String msg;
public Integer getCode() { return code; }
public void setCode(Integer code) { this.code = code; }