<artifactId>spring-boot-starter-web</artifactId>
</dependency>
### 3、 hostname
java.lang.IllegalStateException: Request URI does not contain a valid hostname
微服务名称不合法(不能识别下划线的服务名称)或者不是注册中心所使用的名称
User user = restTemplate.getForObject(“http://EUREKA-USER/user/1”, User.class);
### 4、StatusRuntimeException
这个问题主要是nacos版本与spring-cloudalibaba版本对应问题
com.alibaba.nacos.shaded.io.grpc.StatusRuntimeException: UNAVAILABLE
<spring-cloud-alibaba>2021.0.1.0</spring-cloud-alibaba> 对应1.X版本 nacos
com.alibaba.cloud spring-cloud-alibaba-dependencies 2021.0.1.0 pom import com.alibaba.cloud spring-cloud-starter-alibaba-nacos-discovery ```
5、Param ‘serviceName’ is illegal
java.lang.IllegalArgumentException: Param ‘serviceName’ is illegal, serviceName is blank
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-bootstrap</artifactId>
</dependency>
6、could not be found
A component required a bean of type ‘com.openapi.xxx’ that could not be found
一般是引入的bean未被spring容器管理到,则需要将对应包的扫描路径进行配置,一般配置对应的注解中添加basePackages
其中很容易忽视的基础:工程规范问题
比如mybatis
// mybatis
@MapperScan(basePackages={"com.admin.mapper"})
// feign
@EnableFeignClients(clients = {xxx.class}) //方式1
//@EnableFeignClients(basePackages = {"com.openapi.xxx"}) //方式2
7、Failed to declare queue
org.springframework.amqp.rabbit.listener.BlockingQueueConsumer$DeclarationException:Failed to declare queue
添加rabbitmq的工作队列
8、An unexpected connection driver error occured
大概问题为没有为当前用户授权:一个是Virtual Hos 另外一个是 Topic permissions
新增一下配置到管理台:http://ip:15672/
elasticsearch
1.elasticsearch默认用户密码重置
默认用户elastic
基于docker方式,不是docker直接执行命令;会得到新的密码
【/usr/share/elasticsearch/bin/elasticsearch-reset-password】
[root@localhost indices]# docker exec -it es /usr/share/elasticsearch/bin/elasticsearch-reset-password -u elastic
This tool will reset the password of the [elastic] user to an autogenerated value.
The password will be printed in the console.
Please confirm that you would like to continue [y/N]y
Password for the [elastic] user successfully reset.
New value: 3AWmqC-E-K1nOd-9*GhF
2. cosign: 未找到命令
参考地址1(链接失效):使用 Sigstore 签名的 Elastic Stack 容器镜像!_Elastic 中国社区官方博客的博客-CSDN博客
参考地址: https://docs.sigstore.dev/system_config/installation/
[root@localhost tmp]# wget https://artifacts.elastic.co/cosign.pub
[root@localhost tmp]# curl -O -L “https://github.com/sigstore/cosign/releases/latest/download/cosign-linux-amd64”
[root@localhost tmp]# mv cosign-linux-amd64 /usr/local/bin/cosign
[root@localhost tmp]# chmod +x /usr/local/bin/cosign
[root@localhost tmp]# cosign verify --key cosign.pub docker.elastic.co/kibana/kibana:8.9.1
[root@localhost tmp]# curl -O -L "https://github.com/sigstore/cosign/releases/latest/download/cosign-linux-amd64"
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0
100 95.9M 100 95.9M 0 0 8192k 0 0:00:11 0:00:11 --:--:-- 9437k
[root@localhost tmp]# mv cosign-linux-amd64 /usr/local/bin/cosign
[root@localhost tmp]# chmod +x /usr/local/bin/cosign
[root@localhost tmp]# cosign verify --key cosign.pub docker.elastic.co/kibana/kibana:8.9.1
Verification for docker.elastic.co/kibana/kibana:8.9.1 --
The following checks were performed on each of these signatures:
- The cosign claims were validated
- Existence of the claims in the transparency log was verified offline
- The signatures were verified against the specified public key
[{"critical":{"identity":{"docker-reference":"docker.elastic.co/kibana/kibana"},"image":{"docker-manifest-digest":"sha256:8a973aefa3268cd92dbdc18f071bc6d4ece968fb39db41b7664b02e718007be7"},"type":"cosign container image signature"},"optional":{"Bundle":{"SignedEntryTimestamp":"MEUCIQD9J00J8MqSX9iRZbv5Hjr/XwlhsFRFaozhxbJwuYzWlgIgOYkYTpJBD+FXqyOcRheY480H4U1RiLIfVisyH94TLvg=","Payload":{"body":"eyJhcGlWZXJzaW9uIjoiMC4wLjEiLCJraW5kIjoiaGFzaGVkcmVrb3JkIiwic3BlYyI6eyJkYXRhIjp7Imhhc2giOnsiYWxnb3JpdGhtIjoic2hhMjU2IiwidmFsdWUiOiI0NjZmMzg0NDA4MDcyNDYwYjcwMzg1MWM1NjVlZGIzZjIxMWVhYTJkNjQ5N2QyNjdhM2U3NDU4ZDI1OWJiNGNiIn19LCJzaWduYXR1cmUiOnsiY29udGVudCI6Ik1FUUNJSDBQM3JZcThnZTVjYjFVUkxMQVA5R1RBVWduQmU1Mk1yTUpxck1Jd2dXekFpQTRWMWMyVFBXMnU3ek1iNTVOVTRIckc5STJqNUYrZVNGZlNFZmhrcDlUNWc9PSIsInB1YmxpY0tleSI6eyJjb250ZW50IjoiTFMwdExTMUNSVWRKVGlCUVZVSk1TVU1nUzBWWkxTMHRMUzBLVFVacmQwVjNXVWhMYjFwSmVtb3dRMEZSV1VsTGIxcEplbW93UkVGUlkwUlJaMEZGY1ZaMlRtUlJkR1JrZEdWdGRtWmpWV1V5VGpCbloxZ3ZjSFJxYVFwRlZYRjRlakp3UkZVM1ZWYzFiVE53WkcxSU1UTnJUVXR3ZURselJqUjJWVFZLVDJVM1ZYSXJSazVJVERkaFlXaE1hbWRIWXpBNGRXUkJQVDBLTFMwdExTMUZUa1FnVUZWQ1RFbERJRXRGV1MwdExTMHRDZz09In19fX0=","integratedTime":1692265232,"logIndex":31628155,"logID":"c0d23d6ad406973f9559f3ba2d1ca01f84147d8ffc5b8445c224f98b9591801d"}},"tag":"8.9.1"}}]
3.elasticsearch 8.9 &kibana问题
docker安装方式
- Could not find the file /usr/share/elasticsearch/config/certs/http_ca.crt in container
2. Unable to create an enrollment token. Elasticsearch node HTTP layer SSL configuration is not configured with a keystore
首先必须安装官网提供方式安装:Install Elasticsearch with Docker | Elasticsearch Guide [8.9] | Elastic
如果跳过了:cosign verify --key cosign.pub docker.elastic.co/elasticsearch/elasticsearch:8.9.1
安装就会出现很多问题,建议看上面先安装:cosign
如果已经安装,先卸载掉并清理所有es&kibana相关挂载的数据卷,再安装官网步骤安装
[root@localhost tmp]# docker volume ls
DRIVER VOLUME NAME
local es-config
local es-data
local es-plugins
local html
local kibana-config[root@localhost tmp]# docker volume rm es-config
es-config
[root@localhost tmp]# docker volume rm es-data
es-data
[root@localhost tmp]# docker volume rm es-plugins
es-plugins
[root@localhost tmp]# docker volume rm kibana-config
kibana-config
[root@localhost tmp]# docker volume ls
[root@localhost tmp]# docker pull docker.elastic.co/elasticsearch/elasticsearch:8.9.1
[root@localhost tmp]# wget https://artifacts.elastic.co/cosign.pub
[root@localhost tmp]# cosign verify --key cosign.pub docker.elastic.co/elasticsearch/elasticsearch:8.9.1
[root@localhost tmp]# docker network create es-net
[root@localhost tmp]#
docker run -d --name es01 -e "ES_JAVA_OPTS=-Xms512m -Xmx512m" -e "discovery.type=single-node" -v es-data:/usr/share/elasticsearch/data -v es-config:/usr/share/elasticsearch/config -v es-plugins:/usr/share/elasticsearch/plugins --privileged --network es-net -p 9200:9200 -p 9300:9300 docker.elastic.co/elasticsearch/elasticsearch:8.9.1
重置默认用户密码,记下控制台的密码内容
[root@localhost tmp]# docker exec -it es /usr/share/elasticsearch/bin/elasticsearch-reset-password -u elastic
[root@localhost tmp]# docker cp es01:/usr/share/elasticsearch/config/certs/http_ca.crt .
[root@localhost tmp]# curl --cacert http_ca.crt -u elastic https://localhost:9200
[root@localhost tmp]# docker run --name kb01 --net es-net -p 5601:5601 -v kibana-config:/usr/share/kibana/config -e ELASTICSEARCH_HOSTS:http://192.168.23.11:9200 -d docker.elastic.co/kibana/kibana:8.9.1
[root@localhost tmp]# docker exec -it es01 /usr/share/elasticsearch/bin/elasticsearch-create-enrollment-token -s node
[root@localhost ~]# docker logs -f kb01
控制台输出日志样子
i Kibana has not been configured.
Go to http://0.0.0.0:5601/?code=167452 to get started.
Your verification code is: 167 452
kibana控制台界面
最后使用elastic 和密码: 登录
集合
list与数组互转
1.List转数组
方式1:String[] array = list.toArray(new String[list.size()]);
方式2:String[] array = list.stream().toArray(String[]::new);
2.数组转List
方式1:Collections.addAll(list, array);
方式2:List<String> list1 = Arrays.asList(array);
方式3:List<String> collect = Arrays.stream(array).collect(Collectors.toList());
lamda方式排序
// 安装某个字段分组 常用JSON结构:{"key":[],"key2":[]}
Map<String, List<WordCheck>> collect = checkList.stream().collect(Collectors.groupingBy(f -> f.getWord_name()));
//排序
List<WordCheck> d_post_code = collect.get("d_post_code").stream().sorted(Comparator.comparing(WordCheck::getWord_order)).collect(Collectors.toList());
Docker
1、删除为none的镜像
【Error response from daemon: conflict: unable to delete 5a695b65d145 (must be forced) - image is being used by stopped container cd07b936e0fb】
[root@localhost /]# docker images
[root@localhost /]# docker rmi -f image_id
[root@localhost /]# docker rmi -f 9a3244537312
Deleted: sha256:9a3244537312288e435c00cc0d4d4cb8ebcd9ff630af4e2ea6454959e831364c
Deleted: sha256:79395207ed09b2835585c063a77c133d235c59d55c2ca0c85e719cdb30f35ec1
2、already in use by container
The container name “/rabbitmq” is already in use by container
删除占用的即可
[root@localhost ~]# docker ps -a
[root@localhost ~]# docker rm 5c1fb19d3999
附rabbitmq启动
[root@localhost ~]# docker run \
-v $(pwd)/data/rabbitmq:/var/lib/rabbitmq \
-p 5672:5672 -p 15672:15672 --name rabbitmq -d \
-e RABBITMQ_DEFAULT_USER=root \
-e RABBITMQ_DEFAULT_PASS=hadoop \
-e RABBITMQ_DEFAULT_VHOST=demo \
rabbitmq:3.8-management
正常安装步骤
参考docker官网文档【Install Docker Engine on CentOS | Docker Documentation】
公共镜像参考地址【Docker】
步骤1:sudo yum install -y yum-utils
步骤2:sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
步骤3:sudo yum install --allowerasing docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
有问题参考下面文章【3.linux centos8安装docker一系列问题解决】
主要解决:1.网络问题 2.yum安装包 3.安装依赖问题
windows与虚拟机(centos)
1、Device/Credential Guard
=解决VM 与 Device/Credential Guard 不兼容
Windows Powershell (管理员)(Windows键+X)
bcdedit /set hypervisorlaunchtype off
=解决VM 与 Device/Credential Guard 不兼容
2.没有东西提供 module(perl:5.26)
安装一下
[root@localhost ~]# yum module enable perl:5.26
[root@localhost ~]# sudo yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine
模块依赖问题:
问题 1: 冲突的请求
- 没有东西提供 module(perl:5.26)(模块 perl-DBD-SQLite:1.58:8030020200716174729:3a70019f.x86_64 需要它)
问题 2: 冲突的请求
- 没有东西提供 module(perl:5.26)(模块 perl-DBI:1.641:8030020200716150652:1e4bbb35.x86_64 需要它)
3.linux centos8安装docker一系列问题解决
如:
问题 1: 安装的软件包的问题 podman-3.3.1-9.module_el8.5.0+988+b1f0b741.x86_64
- 软件包 podman-3.3.1-9.module_el8.5.0+988+b1f0b741.x86_64 需要 runc >= 1.0.0-57,但没有提供者可以被安装
- 软件包 containerd.io-1.6.22-3.1.el8.x86_64 与 runc(由 runc-1.0.2-1.module_el8.5.0+911+f19012f9.x86_64 提供)冲突
- 软件包 containerd.io-1.6.22-3.1.el8.x86_64 取代了 runc(由 runc-1.0.2-1.module_el8.5.0+911+f19012f9.x86_64 提供)
如:
未提供依赖perl-DBD-SQLite、perl-DBI
如:
未知的名称或服务【域名解析问题】
下载元数据失败【AppStream 缓存失败,忽略这个 repo 等】
1.1 检查网络
[root@localhost ~]# ping www.baidu.com
PING www.a.shifen.com (157.148.69.74) 56(84) bytes of data.
64 bytes from 157.148.69.74 (157.148.69.74): icmp_seq=1 ttl=128 time=11.4 ms
64 bytes from 157.148.69.74 (157.148.69.74): icmp_seq=2 ttl=128 time=11.0 ms
1.2 域名解析 打开并添加域名解析地址 i进行编辑 --> esc退出–> shft+: 进行底行模式 -->wq -->回车保存[root@localhost ~]# vim /etc/resolv.conf
Generated by NetworkManager
nameserver 8.8.8.8
nameserver 114.114.114.114
[root@localhost ~]# service network restart关闭防火墙
[root@localhost ~]# systemctl stop firewalld.service
禁用防火墙
[root@localhost ~]# systemctl disable firewalld.service
参考文章地址:https://wenku.csdn.net/answer/7219741ce81111edbcb5fa163eeb3507
[root@localhost ~]# vim /etc/sysctl.conf
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
[root@localhost ~]# sysctl -p
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
[root@localhost ~]# dnf update dnf rpm -y
[root@localhost ~]# yum module enable perl:5.26
[root@localhost ~]# yum install -y podman修改三个文件
cd /etc/yum.repos.d-rw-r–r–. 1 root root 719 9月 14 2021 CentOS-Linux-AppStream.repo
-rw-r–r–. 1 root root 704 9月 14 2021 CentOS-Linux-BaseOS.repo
-rw-r–r–. 1 root root 704 9月 14 2021 CentOS-Linux-Extras.repo
CentOS-Linux-AppStream.repo
#CentOS-Linux-AppStream.repo内容
#[AppStream]
自我介绍一下,小编13年上海交大毕业,曾经在小公司待过,也去过华为、OPPO等大厂,18年进入阿里一直到现在。
深知大多数大数据工程师,想要提升技能,往往是自己摸索成长或者是报班学习,但对于培训机构动则几千的学费,着实压力不小。自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!
因此收集整理了一份《2024年大数据全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友。
既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,基本涵盖了95%以上大数据开发知识点,真正体系化!
由于文件比较大,这里只是将部分目录大纲截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且后续会持续更新
如果你觉得这些内容对你有帮助,可以添加VX:vip204888 (备注大数据获取)
一个人可以走的很快,但一群人才能走的更远。不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎扫码加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!
不知道该从何学起的朋友。**
[外链图片转存中…(img-bfsCOc2P-1713029909331)]
[外链图片转存中…(img-yQ9tmUjf-1713029909331)]
[外链图片转存中…(img-8QINc7d9-1713029909332)]
[外链图片转存中…(img-UVtDlcyD-1713029909332)]
[外链图片转存中…(img-7sPiHNTb-1713029909332)]
既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,基本涵盖了95%以上大数据开发知识点,真正体系化!
由于文件比较大,这里只是将部分目录大纲截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且后续会持续更新
如果你觉得这些内容对你有帮助,可以添加VX:vip204888 (备注大数据获取)
[外链图片转存中…(img-2yww45GL-1713029909333)]
一个人可以走的很快,但一群人才能走的更远。不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎扫码加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!