微服务网关soul搭建

1.git clone https://github.com/Dromara/soul.git 源码

2.安装zk

3.刷入 源码目录scripts/下soul.sql到数据库

4.修改soul-admin目录下相关参数

5.启动SoulAdminApplication ,访问http://localhost:8888/index.html 输入 admin /123456

 

6.安装 soul server

  首先注释掉soul-bootstrap工程中不使用插件信息application-local,如下:

server:
  port: 9001
  address: 0.0.0.0

spring:
   main:
     allow-bean-definition-overriding: true
   application:
    name: soul-bootstrap
#   redis:
#    password: foobaredbbexONE123
#    timeout: 300000ms
#    sentinel:
#          master: mymaster
#          nodes:
#              - 192.168.1.91:26379
#              - 192.168.1.92:26379
#              - 192.168.1.93:26379
#   influxdb:
#        url: http://localhost:8086
#        username: test
#        password: test
#        database: test
#        retention-policy: autogen
#        connect-timeout: 10
#        read-timeout: 30
#        write-timeout: 10
   zookeeper:
        url : localhost:2181
        sessionTimeout: 5000
        connectionTimeout : 2000
soul:
    bufferSize: 4096
    timeVerify:
       timeDelay : 10
       enabled: false
#eureka:
#  instance:
#    leaseRenewalIntervalInSeconds: 10
#    leaseExpirationDurationInSeconds: 30
#  client:
#    serviceUrl:
#      defaultZone: http://eureka.didispace.com/eureka/


logging:
    level:
        root: info
        org.springframework.boot: info
        org.apache.ibatis: info
        org.dromara.soul.bonuspoint: info
        org.dromara.soul.lottery: debug
        org.dromara.soul: debug

    path: "./logs/web"

 

再注释掉该soul-bootstrap工程pom中如下

<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~   Licensed to the Apache Software Foundation (ASF) under one or more
  ~   contributor license agreements.  See the NOTICE file distributed with
  ~   this work for additional information regarding copyright ownership.
  ~   The ASF licenses this file to You under the Apache License, Version 2.0
  ~   (the "License"); you may not use this file except in compliance with
  ~   the License.  You may obtain a copy of the License at
  ~
  ~      http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~   Unless required by applicable law or agreed to in writing, software
  ~   distributed under the License is distributed on an "AS IS" BASIS,
  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~   See the License for the specific language governing permissions and
  ~   limitations under the License.
  ~
  -->

<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>
        </dependency>

        <!--<dependency>-->
            <!--<groupId>org.springframework.cloud</groupId>-->
            <!--<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>-->
            <!--<version>2.0.0.RELEASE</version>-->
        <!--</dependency>-->

        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-commons</artifactId>
            <version>2.0.0.RELEASE</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-webflux</artifactId>
        </dependency>

        <dependency>
            <groupId>org.projectreactor</groupId>
            <artifactId>reactor-spring</artifactId>
            <version>1.0.1.RELEASE</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>

    </dependencies>


    <build>
        <finalName>soul-bootstrap</finalName>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <mainClass>org.dromara.soul.bootstrap.SoulBootstrapApplication</mainClass>
                    <executable>true</executable>
                </configuration>
            </plugin>
            <!-- maven install 跳过测试  等价于命令 mvn install -Dmaven.test.skip = true-->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <skip>true</skip>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>

然后启动SoulBootstrapApplication !

###################结束

  • 1
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
### 回答1: 微服务网关和shiro是两个不同的概念,它们的作用和功能也不同。 微服务网关是一个服务的入口,它可以负责路由、负载均衡、安全认证、流量控制等一系列功能,将客户端请求转发到不同的服务中。微服务网关可以统一管理服务,提高系统的可维护性和可扩展性,也可以优化系统的性能和安全性。 而shiro是一个用于权限管理的框架,它可以实现用户认证、授权、会话管理、密码加密等功能,可以保护应用程序的安全。shiro可以集成到各种应用程序中,提供安全保障,防止未授权的访问和攻击。 因此,微服务网关和shiro的作用和功能是不同的,它们在应用场景和使用方式上也有所不同。微服务网关适用于微服务架构中,可以提供服务的入口和安全保障;而shiro适用于各种应用程序中,可以提供安全控制和权限管理。 ### 回答2: 微服务网关和Shiro是两个不同的概念和技术。 微服务网关是一种用于管理和统一调度微服务的中间层组件。它的作用是将多个微服务统一对外提供服务,客户端只需要与网关进行交互,而无需直接与各个微服务进行通信。微服务网关可以进行路由、负载均衡、安全认证等功能,可以有效地提高微服务的可用性和安全性,同时也简化了客户端与微服务之间的交互过程。 而Shiro是一个用于应用程序的Java安全框架。它提供了身份认证、授权、会话管理等安全功能,可以帮助开发者快速地添加安全性到应用程序中。Shiro可以对整个应用程序进行保护,包括web应用、非web应用以及分布式应用。它的设计目标是简单、易用和灵活,可以满足各种不同类型的应用程序的安全需求。 从功能上来说,微服务网关主要是用于微服务的统一管理和调度,包括路由、负载均衡、安全认证等功能。而Shiro主要是用于应用程序的安全管理,包括身份认证、授权等功能。 总的来说,微服务网关和Shiro是两个不同的技术,各自有各自的功能和作用。微服务网关主要用于微服务的管理和调度,而Shiro主要用于应用程序的安全管理。 ### 回答3: 微服务网关和shiro是面向不同层面的技术组件,具有不同的功能和应用场景。 首先,微服务网关是一种用于处理多个微服务的入口,它可以集中管理和路由请求,对外提供统一的接口。微服务网关通常用于实现微服务架构中的API网关,可以提供统一的认证、鉴权、流量控制、日志记录等功能。它可以帮助简化系统架构,提高系统的可维护性和可扩展性。 而shiro是一种用于身份认证和访问控制的框架。它提供了一套完整的认证、授权、会话管理等安全功能,可以帮助开发者轻松地实现用户身份认证和权限控制。shiro可以与各种应用进行集成,可以用于传统的单体应用,也可以用于微服务架构中的每个微服务,实现微服务内的安全控制。 因此,微服务网关和shiro的区别主要体现在两个方面。 首先,在功能上,微服务网关主要用于实现微服务架构中的API网关功能,提供统一的入口和管理多个微服务之间的请求。而shiro主要用于实现身份认证和访问控制,提供可用于传统应用和微服务内部的安全控制。 其次,在应用场景上,微服务网关被广泛应用于微服务架构中,用于提供统一的服务接口,方便管理和监控多个微服务。而shiro可以用于各种类型的应用,无论是传统的单体应用还是微服务架构中的每个微服务。 总体而言,微服务网关和shiro是两种不同的技术组件,各自在不同层面和方面发挥作用。在实际应用中,可以根据具体需求选择使用其中的一种或两者结合,以达到更好的系统安全和可管理性。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值