最近遇到的4个问题

版权声明:襄阳雷哥的版权声明 https://blog.csdn.net/FansUnion/article/details/89287869

1.SpringBoot项目
用到了feign
启动抛出: Attribute 'value' in annotation [org.springframework.cloud.netflix.feign.FeignClient] 
must be declared as an @AliasFor [serviceId], not [name].

解决:把spring-cloud-dependencies version升级到Brixton.SR5(netflix-core版本升到1.1.1就好了)

参考资料:http://www.ccblog.cn/97.htm

2. slf4j jar包冲突

Detected both log4j-over-slf4j.jar AND bound slf4j-log4j12.jar on the class path

SLF4J: Detected both log4j-over-slf4j.jar AND bound slf4j-log4j12.jar on the class path, preempting StackOverflowError. 
SLF4J: See also http://www.slf4j.org/codes.html#log4jDelegationLoop for more details.

参考资料:https://blog.csdn.net/qq_33663251/article/details/72667186 
 

手动排除了spring-boot-starter依赖的日志jar包

<dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter</artifactId>
            <exclusions>
                <exclusion>
                    <artifactId>logback-classic</artifactId>
                    <groupId>ch.qos.logback</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>log4j-over-slf4j</artifactId>
                    <groupId>org.slf4j</groupId>
                </exclusion>
            </exclusions>
        </dependency>

因为自己有个公共的项目 jtn-common配置了依赖

依赖管理真是个技术活

3. 阿里云部署redis服务器,以及远程访问

阿里云上有redis服务,本地想连一下,没问题。

最近用dubbo有点问题,需要设置 密码。没用采用 关闭保护模式的方式。

redis还是有不少配置的。

首先分析的是,阿里云的安全策略,端口号6379没开放,实际是开放了。

参考资料:

阿里云部署redis服务器,以及远程访问

https://blog.csdn.net/lwjdear/article/details/77771681

(

修改redis.conf

1、默认情况Redis不是在后台运行,我们需要修改把redis放在后台运行:daemonize yes

2、redis安全策略默认本机访问,所以远程访问的话需要将 bind 127.0.0.1加#注释掉

仅仅注释掉这些还不行,因为新版本增加了保护模式,具体提示信息

DENIED Redis is running in protected mode because protected mode is enabled, no bind address was specified, no authentication password is requested to clients. In this mode connections are only accepted from the loopback interface. If you want to connect from external computers to Redis you may adopt one of the following solutions: 1) Just disable protected mode sending the command 'CONFIG SET protected-mode no' from the loopback interface by connecting to Redis from the same host the server is running, however MAKE SURE Redis is not publicly accessible from internet if you do so. Use CONFIG REWRITE to make this change permanent. 2) Alternatively you can just disable the protected mode by editing the Redis configuration file, and setting the protected mode option to 'no', and then restarting the server. 3) If you started the server manually just for testing, restart it with the '--protected-mode no' option. 4) Setup a bind address or an authentication password. NOTE: You only need to do one of the above things in order for the server to start accepting connections from the outside.

虽然可以将保护模式设为no来关闭,但为了安全还是推荐设权限密码:

找到这一行# requirepass foobared,将#去掉并把foobared改成你的密码

)

4.最近正式开启了自己的技术中台战略

第1步,开放自己的jar包到公共maven库

如何上传自己的jar包到maven公共远程中央仓库

https://blog.csdn.net/z960339491/article/details/80334384

已经注册了账号,提交了issue,审核通过之后,就可以打包本地jar包,部署到maven中央仓库了。

更多问题,下次再总结。

技术问题实在是太多了,没完没了。

猜你喜欢

转载自blog.csdn.net/FansUnion/article/details/89287869
今日推荐