美文网首页SpringCloudSpringboot
soul安装教程 - 开源API网关(JAVA系)

soul安装教程 - 开源API网关(JAVA系)

作者: DreamsonMa | 来源:发表于2019-05-14 11:13 被阅读287次

    从soul的介绍可以看出是一款不错的产品。国人开发,全中文文档。使用主流java语言,支持api网关大部分功能。很合适二开的一个系统。

    先贴上地址:https://dromara.org/website/zh-cn/docs/soul/soul.html

    后面记录一下搭建过程。

    1、安装influxdb,及新建用户
    influxdb介绍:https://www.influxdata.com/

    [root@mvxl52738 logs]# cat /etc/yum.repos.d/influxdb.repo 
    [influxdb]
    name = InfluxDB Repository - RHEL $releasever
    baseurl = https://repos.influxdata.com/rhel/$releasever/$basearch/stable
    enabled = 1
    gpgcheck = 1
    gpgkey = https://repos.influxdata.com/influxdb.key
    
    [root@mvxl52738 logs]# yum install -y influxdb
    [root@mvxl52738 logs]# systemctl start influxd
    [root@mvxl52738 logs]# systemctl status influxd
    ● influxdb.service - InfluxDB is an open-source, distributed, time series database
       Loaded: loaded (/usr/lib/systemd/system/influxdb.service; enabled; vendor preset: disabled)
       Active: active (running) since Mon 2019-05-13 21:22:42 CST; 13h ago
         Docs: https://docs.influxdata.com/influxdb/
     Main PID: 52637 (influxd)
       CGroup: /system.slice/influxdb.service
               └─52637 /usr/bin/influxd -config /etc/influxdb/influxdb.conf
    
    [root@mvxl52738 logs]# influx
    Connected to http://localhost:8086 version 1.7.6
    InfluxDB shell version: 1.7.6
    Enter an InfluxQL query
    >CREATE DATABASE "test"
    >CREATE USER "test" WITH PASSWORD "test" WITH ALL PRIVILEGES
    

    2、这里还需要安装zk,redis,mysql。略过。。。

    3、clone项目修改配置

    clone项目

    修改admin配置文件:soul\soul-admin\src\main\resources\application-dev.yml
    修改server配置文件:soul\soul-bootstrap\src\main\resources\application-dev.yml

    参考一下官网 。

    4、去掉server端springcloud依赖:

    <?xml version="1.0" encoding="UTF-8"?>
    
    <project xmlns="http://maven.apache.org/POM/4.0.0"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
        <parent>
            <artifactId>soul</artifactId>
            <groupId>org.dromara</groupId>
            <version>1.0.5-RELEASE</version>
        </parent>
        <modelVersion>4.0.0</modelVersion>
    
        <artifactId>soul-bootstrap</artifactId>
    
        <dependencies>
    
            <dependency>
                <groupId>org.dromara</groupId>
                <artifactId>soul-spring-boot-starter</artifactId>
                <exclusions>
                    <exclusion>
                        <artifactId>spring-cloud-starter-netflix-ribbon</artifactId>
                        <groupId>org.springframework.cloud</groupId>
                    </exclusion>
                </exclusions>
            </dependency>
    
            <!--<dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
                <version>2.0.0.RELEASE</version>
            </dependency>-->
           ...
        </dependencies>
        ...
    </project>
    

    6、打包soul工程

    MAJX2@majx2704 MINGW64 /e/workspace/github/soul (master)
    $ mvn -DskipTests clean install -U
    

    7、导出sql文件:soul\script\soul.sql

    8、上传文件及启动:

    [root@mvxl52738 soul]# pwd
    /data/apps/soul
    [root@mvxl52738 soul]# ls
    logs  soul-admin.jar  soul-bootstrap.jar  soul-bootstrap.pid  start-admin.sh  start-web.sh
    [root@mvxl52738 soul]# history | egrep 'start-admin|start-web'
     1012  2019/05/14 10:24:02 chmod +x start-admin.sh 
     1013  2019/05/14 10:24:06 chmod +x start-web.sh 
     1019  2019/05/14 10:27:35 ./start-admin.sh dev start
     1021  2019/05/14 10:28:18 ./start-web.sh dev start
    

    9、最后访问界面:http://10.18.40.183:8082/index.html
    默认用户名:admin;密码:123456

    soul网关admin

    THE END !

    相关文章

      网友评论

        本文标题:soul安装教程 - 开源API网关(JAVA系)

        本文链接:https://www.haomeiwen.com/subject/cuwjaqtx.html