赞
踩
一种设计风格–微服务
微服务是指把一个架构复杂庞大的软件拆分成一个个功能模块,或者说一个个小服务,采用轻量级通信机制,一般是HTTP API
弹幕大多数说电脑至少需要16G内存
virtualBox6.0是开源的去官网直接下载即可,但是要注意开启CPU虚拟化才能开始安装
首先确认自己电脑是否已经开启了CPU虚拟化,打开任务管理器->性能->CPU,观察虚拟化字段是否已启动
下载完以后要在此处修改虚拟机安装路径
安装镜像Linux Vagrant2.25
下载完vagrant以后要设置环境变量
1)利用镜像安装centos7
vagrant init centos7 https://mirrors.ustc.edu.cn/centos-cloud/centos/7/vagrant/x86_64/images/CentOS-7.box
2)开始下载
遇见如下报错
Could not create a directory 'D:\xxx\vmFile\centos-7-1-1.x86_64_1716951173879_75099' to save the settings file (VERR_ACCESS_DENIED)
最后重新设置了virtualBox全局设定路径才行
每次开机使用
vagrant up
vagrant ssh
为虚拟机设置静态ip
具体操作如下
》首先,本机cmd执行ipconfig
找到VirtualBox虚拟网卡网址
进入VagrantFile文件中,找到如下行
# config.vm.network "private_network", ip: "192.168.xx.10"
将上面改为virtualbox同网段,并取消注释#
》然后,重新启动虚拟机
vagrant reload
》最后,登录虚拟机互相ping
# windows
ipconfig
#linux
ip addr
docker下载地址
安装前先卸载
安装依赖包
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
安装docker
sudo yum install docker-ce docker-ce-cli containerd.io
添加镜像
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
启动docker
sudo systemctl start docker
开机自启
sudo systemctl enable docker
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-‘EOF’
{
“registry-mirrors”: [“https://aszg8dso.mirror.aliyuncs.com”]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker
sudo docker pull mysql:5.7
docker run -p 3306:3306 --name mysql
-v /mydata/mysql/log:/var/log/mysql
-v /mydata/mysql/data:/var/lib/mysql
-v /mydata/mysql/conf:/etc/mysql
-e MYSQL_ROOT_PASSWORD=root
-d mysql:5.7
每次docker run就会启动一个容器
进入某ID容器
docker exec -it mysql /bin/bash
查看正在运行中的容器
docker ps
[client]
default-character-set=utf8
[mysql]
default-character-set=utf8
[mysqld]
init_connect=‘SET collation_connection = utf8_unicode_ci’
init_connect=‘SET NAMES utf8’
character-set-server=utf8
collation-server=utf8_unicode_ci
skip-character-set-client-handshake
skip-name-resolve
重启服务
docker restart mysql
开机自动启动mysql
docker update mysql --restart=always
docker pull redis:5.0.5
mkdir -p /mydata/redis/conf
touch /mydata/redis/conf/redis.conf
docker run -p 6379:6379 --name redis -v /mydata/redis/data:/data
-v /mydata/redis/conf/redis.conf:/etc/redis/redis.conf
-d redis:5.0.5 redis-server /etc/redis/redis.conf
配置缓存持久化
如果更改之后openfeign依赖找不到,在该依赖下面加上版本
找不到2.1.8版本的,先用新版本创建,然后手动更改
亲测 node 14.15.0版本可以跑起来
10.24.1在执行npm install会报错,换了14.21.3
npm config set registry http://registry.npm.taobao.org/
重启vscode在控制台执行
npm install
会在当前路径下多出文件夹node_modules
重新执行install要执行
npm cache clean --force
在cmd中执行最终成功
运行起来fast vue
npm run dev
renren generator配置
在pom中纳管该模块
修改yml文件
修改proprities文件
修改controller生成模板中的代码
运行generator下面的主函数,进入下页面
逆向生成所有表
加了这个注解就不需要get set方法,依赖lombok
导入mybatis-plus maven坐标
导入mysql驱动要关注版本适配,mysql版本 vs 驱动版本
见3.2中描述
@MapperScan(“com.atguigu.gulimall.product.dao”)
告诉主函数mapper.java文件在哪里
需要在yml文件中配置xml文件路径
在这里插入图片描述
标识主键属性,需要在yml文件中配置自增逐渐
import org.junit.jupiter.api.Test 用在Spring Boot 2.2.X以后
import org.junit.Test用在2.2.x之前
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'globalTransactionScanner' defined in class path resource [com/alibaba/cloud/seata/GlobalTransactionAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [io.seata.spring.annotation.GlobalTransactionScanner]: Factory method 'globalTransactionScanner' threw exception; nested exception is io.seata.common.exception.NotSupportYetException: not support register type: null at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:627) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE] at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:456) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1321) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1160) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:204) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE] at org.springframework.context.support.PostProcessorRegistrationDelegate.registerBeanPostProcessors(PostProcessorRegistrationDelegate.java:228) ~[spring-context-5.1.9.RELEASE.jar:5.1.9.RELEASE] at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:721) ~[spring-context-5.1.9.RELEASE.jar:5.1.9.RELEASE] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:534) ~[spring-context-5.1.9.RELEASE.jar:5.1.9.RELEASE] at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) ~[spring-boot-2.1.8.RELEASE.jar:2.1.8.RELEASE] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:744) [spring-boot-2.1.8.RELEASE.jar:2.1.8.RELEASE] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:391) [spring-boot-2.1.8.RELEASE.jar:2.1.8.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:312) [spring-boot-2.1.8.RELEASE.jar:2.1.8.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) [spring-boot-2.1.8.RELEASE.jar:2.1.8.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1204) [spring-boot-2.1.8.RELEASE.jar:2.1.8.RELEASE] at com.atguigu.gulimall.order.GulimallOrderApplication.main(GulimallOrderApplication.java:10) [classes/:na] Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [io.seata.spring.annotation.GlobalTransactionScanner]: Factory method 'globalTransactionScanner' threw exception; nested exception is io.seata.common.exception.NotSupportYetException: not support register type: null at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE] at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:622) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE] ... 19 common frames omitted Caused by: io.seata.common.exception.NotSupportYetException: not support register type: null at io.seata.config.ConfigurationFactory.buildConfiguration(ConfigurationFactory.java:80) ~[seata-all-0.7.1.jar:0.7.1] at io.seata.config.ConfigurationFactory.getInstance(ConfigurationFactory.java:65) ~[seata-all-0.7.1.jar:0.7.1] at io.seata.spring.annotation.GlobalTransactionScanner.<init>(GlobalTransactionScanner.java:81) ~[seata-all-0.7.1.jar:0.7.1] at io.seata.spring.annotation.GlobalTransactionScanner.<init>(GlobalTransactionScanner.java:124) ~[seata-all-0.7.1.jar:0.7.1] at io.seata.spring.annotation.GlobalTransactionScanner.<init>(GlobalTransactionScanner.java:113) ~[seata-all-0.7.1.jar:0.7.1] at com.alibaba.cloud.seata.GlobalTransactionAutoConfiguration.globalTransactionScanner(GlobalTransactionAutoConfiguration.java:58) ~[spring-cloud-alibaba-seata-2.1.0.RELEASE.jar:2.1.0.RELEASE] at com.alibaba.cloud.seata.GlobalTransactionAutoConfiguration$$EnhancerBySpringCGLIB$$e99a3ce9.CGLIB$globalTransactionScanner$0(<generated>) ~[spring-cloud-alibaba-seata-2.1.0.RELEASE.jar:2.1.0.RELEASE] at com.alibaba.cloud.seata.GlobalTransactionAutoConfiguration$$EnhancerBySpringCGLIB$$e99a3ce9$$FastClassBySpringCGLIB$$22db3d63.invoke(<generated>) ~[spring-cloud-alibaba-seata-2.1.0.RELEASE.jar:2.1.0.RELEASE] at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244) ~[spring-core-5.1.9.RELEASE.jar:5.1.9.RELEASE] at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:363) ~[spring-context-5.1.9.RELEASE.jar:5.1.9.RELEASE] at com.alibaba.cloud.seata.GlobalTransactionAutoConfiguration$$EnhancerBySpringCGLIB$$e99a3ce9.globalTransactionScanner(<generated>) ~[spring-cloud-alibaba-seata-2.1.0.RELEASE.jar:2.1.0.RELEASE] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_201] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_201] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_201] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_201] at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE] ... 20 common frames omitted Caused by: java.lang.IllegalArgumentException: illegal type:null at io.seata.config.ConfigType.getType(ConfigType.java:62) ~[seata-all-0.7.1.jar:0.7.1] at io.seata.config.ConfigurationFactory.buildConfiguration(ConfigurationFactory.java:78) ~[seata-all-0.7.1.jar:0.7.1] ... 35 common frames omitted Process finished with exit code 1
删除maven依赖
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。