esf修改器(elex修改器)
在ELB环境下限制客户端的访问
ELB(Elastic Load Balancer)ELB全称Elastic Load Balancer,是AWS提供的弹性负载均衡器,可根据实际情况为外部访问分配最合适的服务器。在实际使用过程中,会需要对经由ELB的客户端访问加以限制,本文将介绍如何通过配置EC2实例来实现对此类客户端的限制访问。
如图所示,由于ELB不属于安全组,所以对于安全组实施限制并不会对ELB生效,经由ELB的客户端访问依然可以抵达EC2。
然而倘若限制ELB访问EC2,ELB对EC2发出HealthCheck(健康检查)动作时,ELB将无法访问成功检查,而判断该EC2出现异常情况。所以只有通过在EC2实例上的Web服务器上配置访问限制,才能对经由ELB的客户端访问加以限制。
可是在对访问的客户端实施限制时,由于访问全部经由ELB,则检知的访问IP均为ELB的IP,此时需要借助XFF头(X-Forwarded-For)实施确认和限制。
Amazon ELB相关文章
从0开始学习Amazon ELB(弹性负载均衡)ELB架构下,在APACHE如何获取客户端IP举例说明1.只允许地址为172.24.40.83的IP访问该网站。
编辑网站配置文件,添加或修改配置文件如下:
SetEnvIf X-Forwarded-For \"172.24.40.83\" allow_ip Order deny,allow Deny from all Allow from env=allow_ip
2.拒绝地址为172.24.40.83和17224.40.84的IP访问该网站。
编辑网站配置文件,添加或修改配置文件如下:
SetEnvIf X-Forwarded-For \"172.24.40.83\" deny_ip01 SetEnvIf X-Forwarded-For \"172.24.40.84\" deny_ip02 Order allow,deny Allow from all Deny from env=allow_ip01 Deny from env=allow_ip02
X-Forwarded-For的功能是在ELB接受客户端的请求后,分配到EC2时在数据包的尾部添加上真正客户端的IP地址。
采用Apache的Web服务器,通过mod_extract_forwarded的安装和配置,可以将客户端的IP修改成X-Forwarded-For,具体的方法目前还有待研究。
# yum install mod_extract_forwarded
负载均衡器分配方式简介ELB弹性负载均衡器是一款比较简单易用的负载均衡器,其采用Round Robin方式平均的将外部访问分配到ELB管理下的EC2实例中,保障实例群在大访问量下最好的分配使用系统资源。
此外,常见的高性能的负载均衡器,一般含有:Least Connections,Observed,Dynamic Ratio,Round Robin,Ratio,Fastest,Predictive等等。由于ELB只提供Round Robin功能所以说是简单的,通过万维网只几步就可以拥有负载均衡器,因此说它又是易用的。
SOFABoot 4.0 正式发布,多项新特性等你来体验!
Part.1 「亿点点」新特性基于 Java 17SOFABoot 4.0 依赖 Java 17 作为最小支持的 JDK 版本。如果你的应用目前使用 Java 8 或 11,你需要先将自己的 JDK 版本升级到 17 才能基于 SOFABoot 4.0 进行开发。
二方库升级SOFABoot 4.0 基于 Spring Boot 3.0 与 Spring Framework 6 构建。在 Spring Boot 4.0 与 Spring Framework 6 引入的二方库升级列表可参考文档 Spring Boot 3.0 Release Notes
在 SOFABoot 4.0 引入的二方库升级列表如下:
Spring Boot 3.0.5Spring Cloud 4.0.0Spring Cloud Stream 3.2.6SOFA Common tools 2.0.0SOFATracer 4.0.0SOFARPC 5.10.0FastJson 1.2.83Guava 31.1-jreGrpc 1.51.1Grpc common protos 2.11.0Druid 1.2.16A 9.4Javassist 3.29.2-GACurator 4.3.0Dubbo 3.1.8Nacos 2.0.3Swagger 1.6.7Swagger2 2.2.8基于 Jakarta EESpring Boot 3.0 中依赖 Jakarta EE 规范的部分已经升级到了 Jakarta EE 10 版本。例如,使用 Servlet 6.0 和 JPA 3.1 规范。因此,部分包的命名空间也进行了替换,例如你应该使用:
✅jakarta.servlet.Filter
而不是 javax.servlet.Filter。
同时,如果你使用了自己的依赖提供 Jakarta EE 规范的 API,需注意进行对应的依赖升级,例如你应该使用:
✅jakarta.servlet:jakarta.servlet-api
而不是 javax.servlet:javax.servlet-api。
可参考文档:Migrate to Jakarta EE 9 来修改 Jakarta 相关的包名以及依赖。
支持 SOFAArk 2.0SOFAArk 2.0 模式是 SOFAArk 框架的整体优化版本,相较于 SOFAArk 1.0 模式,它的整体优化思路和原则是 Ark Master Biz 保持和原生 SOFABoot 保持一致,弱化复杂的 Ark Plugin 类管控机制,将 Ark Plugin 与 Master Biz 合并。使得 Ark Master Biz 和原生 SOFABoot 应用的启动方式、类加载方式保持一致,大大降低了 Master Biz 应用的编程难度。
SOFABoot 4.0 版本不再支持 SOFAArk 1.0 模式,如果你想要在 SOFABoot 应用中使用 SOFAArk 2.0 模式,可以按照以下步骤进行操作:
1、在项目中引入 SOFAArk 组件依赖
xml复制代码<dependency> <groupId>com.alipayfa</groupId> <artifactId>ark-sofa-boot-starter</artifactId></dependency>
2、添加 Spring Boot 的 Package 插件
xml复制代码<build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <version>4.0.0</version> <configuration> <outputDirectory>target</outputDirectory> <classifier>ark-biz</classifier> </configuration> <executions> <execution> <id>package</id> <goals> <goal>repackage</goal> </goals> </execution> </executions> </plugin> </plugins></build>
3、启动应用
方式一:IDEA 启动,注意需要添加启动参数:-Dsofa.ark.embed.enable=true -Dcom.alipayfa.ark.master=${bizName}
方式二:命令行启动,先运行 mvn clean package 命令进行打包,生成 �������−bizName−{bizVersion}-ark-biz.jar 的可执行文件,然后在终端运行以下启动参数:
java -jar -Dsofa.ark.embed.enable=true -Dcom.alipayfa.ark.master=${bizName} ${bizName}-${bizVersion}-ark-biz.jar
支持场景化的按配置加载能力通常情况下,应用在不同的场景下可能需要开启或者关闭不同的功能,Spring Boot 提供了丰富的 Configuration 动态配置能力[4] 能力以支持应用在不同的场景下加载不同的 Bean。SOFABoot 在此基础上,对 org.springframeworkntext.ApplicationContextInitializer 等扩展点进行了增强,支持通过统一风格的配置定制各类 Bean 以及扩展点的开启与关闭,并提供了定制模版配置的开启方式以降低应用配置项的复杂度。
通过:com.alipayfa.bootconfigurendition.ConditionalOnSwitch 注解为 Bean 添加按配置开启能力:
java复制代码@Configuration(proxyBeanMethods = false)@ConditionalOnSwitch(id="sample")public class SampleConfiguration { @Bean public SampleBean sampleBean() { return new SampleBean(); }}
添加:
sofa.boot.switch.bean.sample.enabled=false 配置后,SampleConfiguration 配置类将不再加载。
通过继承:com.alipayfa.boot.Initializer.SwitchableApplicationContextInitializer 类为:
ApplicationContextInitializer 添加按配置开启能力:
java复制代码public class SampleSwitchSpringContextInitializer extends SwitchableApplicationContextInitializer { @Override protected void doInitialize(ConfigurableApplicationContext applicationContext) { applicationContext.getEnvironment().addActiveProfile("sampleswitchtest"); } @Override protected String switchKey() { return "sample"; }}
添加:
sofa.boot.switchitializer.sample.enabled=false 配置后,
SampleSwitchSpringContextInitializer 类将不再执行 doInitialize 方法。
通过继承:com.alipayfa.boot.listener.SwitchableApplicationListener 类为:
ApplicationListener 添加添加按配置开启能力:
java复制代码public class SampleSwitchApplicationListener extends SwitchableApplicationListener<ContextRefreshedEvent> { @Override protected void doOnApplicationEvent(ContextRefreshedEvent event) { SampleBean sampleBean = event.getApplicationContext().getBean(SampleBean.class); sampleBean.setTrigger(true); } @Override protected String switchKey() { return "sample"; }}
添加:
sofa.boot.switch.listener.sample.enabled=false 配置后,
SampleSwitchApplicationListener 类将不再执行 doOnApplicationEvent 方法。
在使用上述扩展点为你的 Bean 和扩展点添加按配置开启能力后,你可以在 /sofa-boot/scenens 目录下添加指定场景名 scene-key 前缀的配置文件 (支持 application 及 yaml 格式) ,在配置文件中添加该场景下的配置文件模版,例如:
ini复制代码sofa.boot.switch.bean.a.enabled=falsesofa.boot.switch.bean.b.enabled=truesofa.boot.switchitializer.a.enabled=falsesofa.boot.switchitializer.b.enabled=falsesofa.boot.switchitializer.c.enabled=false
当你的应用打包后,你只需要添加配置 sofa.bootenens=scene-key 便可以生效 /sofa-boot/scenens/scene-keyperites 配置文件中的开关配置。该配置项同时支持配置多个场景名,可以同时生效多个场景配置文件。
启动耗时统计能力增强SOFABoot 在 3.6.0 版本提供了 /actuator/startup 能力用于查询应用启动过程中的耗时细节。后来,Spring Boot 在 2.4 版本也提供了官方的 /actuator/startup 能力用于展示应用启动耗时详情。在 SOFA Boot 4.0 版本中,我们整合了 SOFA Boot 与 Spring Boot 提供的启动耗时统计能力:
保留了 SOFABoot 特有的阶段耗时统计能力,例如 SOFA 模块化刷新耗时统计、健康检查耗时统计等;使用 Spring Framework 提供的 org.springframework.bootntexttrics.buffering.BufferingApplicationStartup 统计 Applicaiton Context 的启动耗时详情。你可以通过下述方式使用 SOFABoot 增强的 /actuator/startup 能力:
1、在项目中引入 actuator 组件依赖:
xml复制代码<dependency> <groupId>com.alipayfa</groupId> <artifactId>actuator-sofa-boot-starter</artifactId></dependency>
2、使用:
com.alipayfa.boot.startup.StartupSpringApplication 作为启动类启动应用:
java复制代码public static void main(String[] args) { StartupSpringApplication startupSpringApplication = new StartupSpringApplication(Sofaboot4DemoApplication.class); startupSpringApplication(args);}
3、启动应用后,访问:
localhost:8080/actuator/startup 查看启动耗时详情信息。
更丰富的 SPISOFABoot 4.0 版本中新增了大量 SPI ,你可以通过这些 SPI 定制 SOFABoot 框架的运行逻辑。
添加自定义的启动耗时阶段信息com.alipayfa.boot.startup.StartupReporterAware 接口的使用方式与 org.springframeworkntext.ApplicationContextAware 接口的使用方法使用类似,当你的 Bean 实现了该接口时,你可以感知到应用中的:com.alipayfa.boot.startup.StartupReporter 实例。
com.alipayfa.boot.startup.StartupReporter 类用于管理 SOFABoot 提供的 /actuator/startup 耗时信息,你可以通过 com.alipayfa.boot.startup.StartupReporter#addCommonStartupStat 方法添加你定制的耗时阶段信息。
添加自定义的 Bean 启动耗时信息com.alipayfa.boot.startup.BeanStatCustomizer 接口用于定制 SOFABoot 提供的 /actuator/startup 耗时信息中的 Bean 启动耗时特征。如果你想注册自定义的 com.alipayfa.boot.startup.BeanStatCustomizer 接口实现类,需要在 META-INF/spring.factories 文件注册 Spring Factories 形式的 SPI。你可以参考框架内置的 com.alipayfatime.startup.ComponentBeanStatCustomizer 类用于提取 ServiceFactoryBean 类型的 Bean 的 Interface 字段用于展示。
定制 BeanPostProcessor 与 BeanFactoryPostProcessor 在 SOFA 上下文中的共享模式在开启模块化隔离特性时,你在 Spring Boot 上下文中注册的 BeanPostProcessor 以及 BeanFactoryPostProcessor 将 BeanDefinition 将被共享至所有的 SOFA 模块中,每个 SOFA 模块的上下文中都会创建一个 PostProcessor 类的实例。你可以通过以下方式,修改指定的 BeanPostProcessor 或者BeanFactoryPostProcessor 的共享方式:
在 PostProcessor 类上添加:com.alipayfa.bootntextcessor.UnshareSofaPostProcessor 注解,PostProcessor 将不会被共享至 SOFA 模块中。
在 PostProcessor 类上添加:com.alipayfa.bootntextcessor.SingletonSofaPostProcessor 注解,SOFA Boot 框架会获取其在 Spring Boot 上下文中的 Singleton 实例注册至 SOFA 模块中,而不是注册 BeanDefinition,这将确保 PostProcessor 类在整个应用中保持单例。
自定义:com.alipayfa.bootntextcessor.SofaPostProcessorShareFilter 接口的实现类并将其注册至 Spring Boot 上下文中,通过 bean name 或 bean class 指定 PostProcessor 的共享方式。
添加感知 SOFA 模块刷新的扩展点在开启模块化隔离特性时,你可以自定义 com.alipayfa.bootntext.ContextRefreshInterceptor 接口的实现类并将其注册至 Spring Boot 上下文中,当每个 SOFA 模块的 Spring 上下文开始刷新前以及刷新完成后,都会触发该接口的 beforeRefresh 以及 afterRefresh 方法。
你可以参考框架内置的:com.alipayfatimentext.ComponentContextRefreshInterceptor 类,它用于在 SOFA 模块中的 Spring 上下文刷新成功后,将其注为 SpringContextComponent,在 SOFA 模块中的 Spring 上下文刷新失败后取消注册的 ComponentInfo。
支持注解参数的占位符替换在一些情况下,我们希望自定义注解中的属性使用非固定值,通过 Spring 配置进行定制。SOFABoot 提供了:
com.alipayfa.boot.annotation.WrapperAnnotation 工具类,用于快速实现上述功能。例如,你自定义了一个注解类 DemoAnnotation,并在某个类上使用了该注解:
java复制代码@Retention(RetentionPolicy.RUNTIME)@Target({ ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER })public @interface DemoAnnotation { String key() default "";}
java复制代码@DemoAnnotation(key = "${spring.annotationnfig}")public class TestClass {}
通过以下方式获取的 key 字段数值将转换为你在 Spring Envrionment 中定义的 spring.annotationnfig 配置值:
java复制代码public String getAnnotationKey(Environment environment, DemoAnnotation demoAnnotation) { AnnotationWrapper<DemoAnnotation> serviceAnnotationWrapper = AnnotationWrapper.create(DemoAnnotation.class) .withEnvironment(environment) .withBinder(DefaultPlaceHolderBinder.INSTANCE); return serviceAnnotationWrapper.wrap(demoAnnotation).key();}Part.2 注意有重命名哦!
请先留意以下信息!
通过 actuator-sofa-boot-starter 引入的 SOFABoot 增强的 actuator 能力,通过配置项定制开启的 actuator。依赖 health-sofa-boot-starter 与 startup-sofa-boot-starter 已被废弃,请使用 actuator-sofa-boot-starter 替换。依赖 log-sofa-boot-starter 已被废弃,如果你引入了其他的 sofa boot starter,可以直接删除该依赖。如果你没有引入任何其他 sofa boot starter,使用 sofa-boot-starter 代替它。依赖 rpc-sofa-boot-plugin、runtime-sofa-boot-plugin、tracer-sofa-boot-plugin 已被废弃,可使用 ark-sofa-boot-starter 代替它们。我们对下表中包名下的类进行了重命名,如果你使用了对应的类,则需要修改为新的包名:
| 原包名 | 新包名 | 
| com.alipayfa.startup | com.alipayfa.boot.actuator.startup | 
| com.alipayfa.healthcheck | com.alipayfa.boot.actuator.health | 
| com.alipayfa.isle | com.alipayfa.boot.isle | 
| com.alipayfa.tracer.boot | com.alipayfa.boot.tracer | 
| com.alipayfa.service.apiponent | com.alipayfatime.ext | 
SOFABoot 提供的以下 API 类进行了重命名,如果你使用了对应的类,则需要修改为新的类名:
| 原类名 | 新类名 | 
| com.alipayfa.healthcheckre.HealthChecker | com.alipayfa.boot.actuator.health.HealthChecker | 
| com.alipayfa.healthcheck.startup.ReadinessCheckCallback | com.alipayfa.boot.actuator.health.ReadinessCheckCallback | 
| com.alipayfatime.spring.singleton.SingletonSofaPostProcessor | com.alipayfa.bootntextcessor.SingletonSofaPostProcessor | 
| com.alipayfatime.spring.share.UnshareSofaPostProcessor | com.alipayfa.bootntextcessor.UnshareSofaPostProcessor | 
| com.alipayfatime.factory.BeanLoadCostBeanFactory | com.alipayfa.bootntext.SofaDefaultListableBeanFactory | 
再见啦,SOFAArk 1.0
SOFABoot 4.0 不再支持 SOFAArk 1.0 模式,用于支持 Ark 测试的相关工具类已被移除,SOFAArk 2.0 模式下你不再需要这些类:
com.alipayfa.test.annotation.DelegateToRunnercom.alipayfa.testner.SofaBootRunnercom.alipayfa.testner.SofaJUnit4RunnerPart.4 请收下这份升级指南♂️Before You Start升级 SOFABoot 至 最新的 3.x 版本在开始升级之前,请确保升级到最新可用的 3.x 版本。这将确保你正在针对该行的最新依赖项进行构建。
检查依赖列表迁移到 SOFABoot 4.0 将升级许多依赖项 (包括 Spring Boot 3.0 升级的依赖项) ,请确认依赖项升级对你的应用的影响。请参考:
Spring Boot 2.7.x 依赖索引Spring Boot 3.0.x 依赖索引检查已废弃的特性SOFABoot 3 以及 Spring Boot 2 中弃用的类、方法和属性,请确保在升级之前没有调用已弃用的功能。详情请参考上方「Part.3 废弃特性|再见啦,SOFAArk 1.0」章节。
检查系统配置SOFABoot 4.0 依赖 Java 17 或者更高的版本,不再支持 Java 8。同时依赖 Spring Boot 3.0。
升级至 SOFA Boot 4.0修改重命名的配置项请参考下方「Part.5 附录|配置变更」章节以及文档 Spring Boot 2 -> 3 配置变更
修改重命名的类与依赖参考上方「Part.2 注意有重命名哦! 」章节
升级 Spring Boot 3.0参考文档: Spring Boot 3.0 升级文档
Part.5 附录|配置变更注:配置属性对比基于 3.16.3 与 4.0 版本。
在 4.0 版本中废弃的配置| key | 
| com.alipayfa.boot.serviceNameWithBeanId | 
| com.alipayfa.boot.unregisterComponentWhenModuleInstallFailure | 
| com.alipayfa.boot.startuppSofaBean | 
| key | default value | description | 
| sofa.boot.isle.ignoreModules | 无 | 指定忽略的 SOFA 模块列表 | 
| sofa.boot.isle.ignoreCalculateRequireModules | 无 | 指定忽略 require module 属性的 SOFA 模块列表 | 
| sofa.bootenes | 无 | 开启的场景配置列表 | 
| sofa.boot.startup.bufferSize | 4096 | 框架内置的 BufferingApplicationStartup 的缓存大小 | 
| sofa.boot.threadPoolMonitor.disable | false | 关闭 SOFA 线程池监控能力 | 
| sofa.boot.rpc.enableAutoPublish | false | 支持应用启动时自动发布 rpc服务,不依赖 Actuator 模块 | 
runtime properties
| origin key | replaced key | 
| com.alipayfa.boot.jvmFilterEnable | sofa.boottime.jvmFilterEnable | 
| com.alipayfa.boot.disableJvmFirst | sofa.boottime.disableJvmFirst | 
| com.alipayfa.bootpJvmReferenceHealthCheck | sofa.boottimepJvmReferenceHealthCheck | 
| com.alipayfa.boot.extensionFailureInsulating | sofa.boottime.extensionFailureInsulating | 
| com.alipayfa.bootpExtensionHealthCheck | sofa.boottimepExtensionHealthCheck | 
| com.alipayfa.boot.serviceInterfaceTypeCheck | sofa.boottime.serviceInterfaceTypeCheck | 
| com.alipayfa.bootpAllComponentShutdown | sofa.boottimepAllComponentShutdown | 
| com.alipayfa.bootpCommonComponentShutdown | sofa.boottimepCommonComponentShutdown | 
| com.alipayfa.boot.asyncInitBeanCoreSize | sofa.boottime.asyncInitExecutorCoreSize | 
| com.alipayfa.boot.asyncInitBeanMaxSize | sofa.boottime.asyncInitExecutorMaxSize | 
| com.alipayfa.boot.dynamicJvmServiceCacheEnable | sofa.boot.ark.jvmServiceCache | 
| com.alipayfa.bootpJvmSerialize | sofa.boot.ark.jvmInvokeSerialize | 
| com.alipayfa.boot.beanLoadCost | sofa.boot.startupstThreshold | 
isle properties
| origin key | replaced key | 
| com.alipayfa.boot.activeProfiles | sofa.boot.isle.activeProfiles | 
| com.alipayfa.boot.allowBeanDefinitionOverriding | sofa.boot.isle.allowBeanDefinitionOverriding | 
| com.alipayfa.boot.moduleStartUpParallel | sofa.boot.isle.moduleStartUpParallel | 
| com.alipayfa.bootlishEventToParent | sofa.boot.islelishEventToParent | 
| com.alipayfa.boot.enableIsle | sofa.boot.isle.enabled | 
| com.alipayfa.boot.allowModuleOverriding | sofa.boot.isle.allowModuleOverriding | 
| com.alipayfa.boot.ignoreModuleInstallFailure | sofa.boot.isle.ignoreModuleInstallFailure | 
| com.alipayfa.boot.parallelRefreshCoreCountFactor | sofa.boot.isle.parallelRefreshPoolSizeFactor | 
| com.alipayfa.boot.parallelRefreshTimeout | sofa.boot.isle.parallelRefreshTimeout | 
| com.alipayfa.boot.parallelRefreshCheckPeriod | sofa.boot.isle.parallelRefreshCheckPeriod | 
| com.alipayfa.boot.share.parentntext.postcessor.enabled | sofa.boot.isle.shareParentPostProcessor | 
actuator properties
| origin key | replaced key | 
| com.alipayfa.boot.manualReadinessCallback | sofa.boot.actuator.health.manualReadinessCallback | 
| com.alipayfa.healthcheckp.all | sofa.boot.actuator.healthpAll | 
| com.alipayfa.healthcheckpponent | sofa.boot.actuator.healthpHealthChecker | 
| com.alipayfa.healthcheckpdicator | sofa.boot.actuator.healthpHealthIndicator | 
| com.alipayfa.healthcheckponent.check.retryunt | sofa.boot.actuator.health.healthCheckerConfigponents.retryCount | 
| com.alipayfa.healthcheckponent.check.retryterval | sofa.boot.actuator.health.healthCheckerConfigponents.retryTimeInterval | 
| com.alipayfa.healthcheckponent.check.strict.enabled | sofa.boot.actuator.health.healthCheckerConfigponents.strictCheck | 
| com.alipayfa.healthcheckponent.timeout | sofa.boot.actuator.health.healthCheckerConfigponents.timeout | 
| com.alipayfa.healthcheck.module.check.retryunt | sofa.boot.actuator.health.healthCheckerConfig.modules.retryCount | 
| com.alipayfa.healthcheck.module.check.retryterval | sofa.boot.actuator.health.healthCheckerConfig.modules.retryTimeInterval | 
| com.alipayfa.healthcheck.module.check.strict.enabled | sofa.boot.actuator.health.healthCheckerConfig.modules.strictCheck | 
| com.alipayfa.healthcheck.module.timeout | sofa.boot.actuator.health.healthCheckerConfig.modules.timeout | 
| com.alipayfa.healthcheck.default.timeout | sofa.boot.actuator.health.globalHealthCheckerTimeout | 
| com.alipayfa.healthcheckdicator.timeout | sofa.boot.actuator.health.globalHealthIndicatorTimeout | 
| com.alipayfa.boot.healthCheckInsulator | sofa.boot.actuator.healthsulator | 
| com.alipayfa.boot.healthCheckParallelEnable | sofa.boot.actuator.health.parallelCheck | 
| com.alipayfa.boot.healthCheckParallelTimeout | sofa.boot.actuator.health.parallelCheckTimeout | 
| com.alipayfa.boot.excludedIndicators | sofa.boot.actuator.health.excludedIndicators | 
tracer properties
| origin key | replaced key | 
| com.alipayfa.tracer.datasource.enable | sofa.boot.tracer.datasource.enabled | 
| com.alipayfa.tracer.feign.enabled | sofa.boot.tracer.feign.enabled | 
| com.alipayfa.tracer.springmvc.enable | sofa.boot.tracer.springmvc.enabled | 
| com.alipayfa.tracer.springmvc.filterOrder | sofa.boot.tracer.springmvc.filterOrder | 
| com.alipay.tracer.kafka.enabled | sofa.boot.tracer.kafka.enabled | 
| com.alipay.tracer.mongodb.enabled | sofa.boot.tracer.mongodb.enabled | 
| com.alipayfa.tracer.rabbitmq.enable | sofa.boot.tracer.rabbitmq.enabled | 
| com.alipayfa.traceris.enabled | sofa.boot.traceris.enabled | 
| com.alipayfa.tracer.resttemplate | sofa.boot.tracer.resttemplate.enabled | 
| com.alipayfa.tracer.rocketmq | sofa.boot.tracer.rocketmq.enabled | 
| com.alipayfa.tracerssage | sofa.boot.tracer.springmessage.enabled | 
| com.alipayfa.tracer.flexible | sofa.boot.tracer.flexible.enabled | 
| com.alipayfa.tracer.zipkin.enabled | sofa.boot.tracer.zipkin.enabled | 
| com.alipayfa.tracer.zipkin.baseUrl | sofa.boot.tracer.zipkin.baseUrl | 
| com.alipayfa.tracer.zipkin.gzipped | sofa.boot.tracer.zipkin.gzipped | 
| com.alipayfa.tracer.disableDigestLog | sofa.boot.tracer.disableDigestLog | 
| com.alipayfa.tracer.disableConfiguration | sofa.boot.tracer.disableConfiguration | 
| com.alipayfa.tracer.tracerGlobalRollingPolicy | sofa.boot.tracer.tracerGlobalRollingPolicy | 
| com.alipayfa.tracer.tracerGlobalLogReserveDay | sofa.boot.tracer.tracerGlobalLogReserveDay | 
| com.alipayfa.tracer.statLogInterval | sofa.boot.tracer.statLogInterval | 
| com.alipayfa.tracer.baggageMaxLength | sofa.boot.tracer.baggageMaxLength | 
| com.alipayfa.tracer.samplerName | sofa.boot.tracer.samplerName | 
| com.alipayfa.tracer.samplerPercentage | sofa.boot.tracer.samplerPercentage | 
| com.alipayfa.tracer.samplerCustomRuleClassName | sofa.boot.tracer.samplerCustomRuleClassName | 
| com.alipayfa.tracer.reporterName | sofa.boot.tracer.reporterName | 
| com.alipayfa.tracer.jsonOutput | sofa.boot.tracer.jsonOutput | 
rpc properties
| origin key | replaced key | 
| com.alipayfa.rpc.aftRegulationEffective | sofa.boot.rpc.aftRegulationEffective | 
| com.alipayfa.rpc.aftDegradeEffective | sofa.boot.rpc.aftDegradeEffective | 
| com.alipayfa.rpc.aftTimeWindow | sofa.boot.rpc.aftTimeWindow | 
| com.alipayfa.rpc.aftLeastWindowCount | sofa.boot.rpc.aftLeastWindowCount | 
| com.alipayfa.rpc.aftLeastWindowExceptionRateMultiple | sofa.boot.rpc.aftLeastWindowExceptionRateMultiple | 
| com.alipayfa.rpc.aftWeightDegradeRate | sofa.boot.rpc.aftWeightDegradeRate | 
| com.alipayfa.rpc.aftWeightRecoverRate | sofa.boot.rpc.aftWeightRecoverRate | 
| com.alipayfa.rpc.aftDegradeLeastWeight | sofa.boot.rpc.aftDegradeLeastWeight | 
| com.alipayfa.rpc.aftDegradeMaxIpCount | sofa.boot.rpc.aftDegradeMaxIpCount | 
| com.alipayfa.rpc.boltPort | sofa.boot.rpc.boltPort | 
| com.alipayfa.rpc.boltThreadPoolCoreSize | sofa.boot.rpc.boltThreadPoolCoreSize | 
| com.alipayfa.rpc.boltThreadPoolMaxSize | sofa.boot.rpc.boltThreadPoolMaxSize | 
| com.alipayfa.rpc.boltThreadPoolQueueSize | sofa.boot.rpc.boltThreadPoolQueueSize | 
| com.alipayfa.rpc.boltAcceptsSize | sofa.boot.rpc.boltAcceptsSize | 
| com.alipayfa.rpc.boltProcessInIoThread | sofa.boot.rpc.boltProcessInIoThread | 
| com.alipayfa.rpc.enableSwagger | sofa.boot.rpc.enableSwagger | 
| com.alipayfa.rpc.mockUrl | sofa.boot.rpc.mockUrl | 
| com.alipayfa.rpc.h2cPort | sofa.boot.rpc.h2cPort | 
| com.alipayfa.rpc.h2cThreadPoolCoreSize | sofa.boot.rpc.h2cThreadPoolCoreSize | 
| com.alipayfa.rpc.h2cThreadPoolMaxSize | sofa.boot.rpc.h2cThreadPoolMaxSize | 
| com.alipayfa.rpc.h2cThreadPoolQueueSize | sofa.boot.rpc.h2cThreadPoolQueueSize | 
| com.alipayfa.rpc.h2cAcceptsSize | sofa.boot.rpc.h2cAcceptsSize | 
| com.alipayfa.rpc.restHostname | sofa.boot.rpc.restHostname | 
| com.alipayfa.rpc.restPort | sofa.boot.rpc.restPort | 
| com.alipayfa.rpc.restIoThreadSize | sofa.boot.rpc.restIoThreadSize | 
| com.alipayfa.rpc.restContextPath | sofa.boot.rpc.restContextPath | 
| com.alipayfa.rpc.restAllowedOrigins | sofa.boot.rpc.restAllowedOrigins | 
| com.alipayfa.rpc.restThreadPoolCoreSize | sofa.boot.rpc.restThreadPoolCoreSize | 
| com.alipayfa.rpc.restThreadPoolMaxSize | sofa.boot.rpc.restThreadPoolMaxSize | 
| com.alipayfa.rpc.restMaxRequestSize | sofa.boot.rpc.restMaxRequestSize | 
| com.alipayfa.rpc.restTelnet | sofa.boot.rpc.restTelnet | 
| com.alipayfa.rpc.restDaemon | sofa.boot.rpc.restDaemon | 
| com.alipayfa.rpc.restSwagger | sofa.boot.rpc.restSwagger | 
| com.alipayfa.rpc.dubboPort | sofa.boot.rpc.dubboPort | 
| com.alipayfa.rpc.dubboIoThreadSize | sofa.boot.rpc.dubboIoThreadSize | 
| com.alipayfa.rpc.dubboThreadPoolCoreSize | sofa.boot.rpc.dubboThreadPoolCoreSize | 
| com.alipayfa.rpc.dubboThreadPoolMaxSize | sofa.boot.rpc.dubboThreadPoolMaxSize | 
| com.alipayfa.rpc.dubboThreadPoolQueueSize | sofa.boot.rpc.dubboThreadPoolQueueSize | 
| com.alipayfa.rpc.dubboAcceptsSize | sofa.boot.rpc.dubboAcceptsSize | 
| com.alipayfa.rpc.httpPort | sofa.boot.rpc.httpPort | 
| com.alipayfa.rpc.httpThreadPoolCoreSize | sofa.boot.rpc.httpThreadPoolCoreSize | 
| com.alipayfa.rpc.httpThreadPoolMaxSize | sofa.boot.rpc.httpThreadPoolMaxSize | 
| com.alipayfa.rpc.httpThreadPoolQueueSize | sofa.boot.rpc.httpThreadPoolQueueSize | 
| com.alipayfa.rpc.httpAcceptsSize | sofa.boot.rpc.httpAcceptsSize | 
| com.alipayfa.rpc.triplePort | sofa.boot.rpc.triplePort | 
| com.alipayfa.rpc.tripleThreadPoolCoreSize | sofa.boot.rpc.tripleThreadPoolCoreSize | 
| com.alipayfa.rpc.tripleThreadPoolMaxSize | sofa.boot.rpc.tripleThreadPoolMaxSize | 
| com.alipayfa.rpc.tripleThreadPoolQueueSize | sofa.boot.rpc.tripleThreadPoolQueueSize | 
| com.alipayfa.rpc.tripleAcceptsSize | sofa.boot.rpc.tripleAcceptsSize | 
| com.alipayfa.rpc.registryAddress | sofa.boot.rpc.registryAddress | 
| com.alipayfa.rpc.virtualHost | sofa.boot.rpc.virtualHost | 
| com.alipayfa.rpc.virtualPort | sofa.boot.rpc.virtualPort | 
| com.alipayfa.rpc.enabledIpRange | sofa.boot.rpc.enabledIpRange | 
| com.alipayfa.rpc.bindNetworkInterface | sofa.boot.rpc.bindNetworkInterface | 
| com.alipayfa.rpc.boundHost | sofa.boot.rpc.boundHost | 
| com.alipayfa.rpc.lookoutCollectDisable | sofa.boot.rpc.lookoutCollectDisable | 
| com.alipayfa.rpc.registries | sofa.boot.rpc.registries | 
| com.alipayfa.rpc.enableMesh | sofa.boot.rpc.enableMesh | 
| com.alipayfa.rpcnsumerRepeatedReferenceLimit | sofa.boot.rpcnsumerRepeatedReferenceLimit | 
| com.alipayfa.rpc.hystrixEnable | sofa.boot.rpc.hystrixEnable | 
| com.alipayfa.rpc.defaultTracer | sofa.boot.rpc.defaultTracer | 
| com.alipayfa.rpc.dynamicConfig | sofa.boot.rpc.dynamicConfig | 
| sofa.rpc.registry.disablePub | sofa.boot.rpc.registry.disablePub | 
| sofa.rpc.registry.defaultRegistry | sofa.boot.rpc.registry.defaultRegistry | 
ElasticSearch IK 分词器快速上手
一、安装 IK 分词器1.分配伪终端
我的 ElasticSearch 是使用 Docker 安装的,所以先给容器分配一个伪终端.之后就可以像登录服务器一样直接操作docker 中的内容了docker exec -it 容器ID /bin/bash
2.使用 elasticsearch-plugin 安装插件
cd plugins进入到 plugins 文件夹执行如下命令,7.12.0 需要修改成你的 es 版本号
../bin/elasticsearch-plugin install https://github/medcl/elasticsearch-analysis-ik/releases/download/v7.12.0/elasticsearch-analysis-ik-7.12.0.zip
3.重启 elasticsearch 容器
docker restart 容器ID
4.常见问题
(1)javang.IllegalStateException
执行elasticsearch-plugin install的时候,出现了 Failed installing和javang.IllegalStateException
查看了一下,我的 plugins/ 目录下已经有一个名为 ik 的文件夹了.抱着试试的心态,删掉了这个名为 ik 的文件夹,重新执行
../bin/elasticsearch-plugin install https://github/medcl/elasticsearch-analysis-ik/releases/download/v7.12.0/elasticsearch-analysis-ik-7.12.0.zip
安装成功
二、ik 分词原理(占位,等有时间读源码再来补充)
三、ik_smart 和 ik_max_wordGET _analyze?pretty{ "analyzer": "ik_smart", "text": "不像我,只会心疼鸽鸽"}
GET _analyze?pretty{ "analyzer": "ik_max_word", "text": "不像我,只会心疼鸽鸽"}
结论_analyzer构建索引时候的分词,索引的时候使用 max_wordsearch_analyzer搜索时的分词,查询的时候使用 smart原文链接:http://click.aliyun/m/1000292763/
本文为阿里云原创内容,未经允许不得转载。
声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送至邮件举报,一经查实,本站将立刻删除。转载务必注明出处:http://www.hixs.net/article/20230925/169494793719967.html


















