IDEA Ultimate版本安装教程转载https://javamana.com/2021/05/20210510064135472q.html
Maven 下载安装配置教程转载maven的下载安装配置教程(详细图文) - 砰砰的猿 - 博客园 (cnblogs.com)
点击new project,选择Maven项目
设置项目选择项目的根目录,设置项目名称,修改包名,之后点击Finish
左上角FIle -> Setting -> Build, Excution, Deployment -> Build Tools ->Maven,修改Maven home path为你安装的Maven的根目录,并修改User setting file为Maven根目录下settings.xml的路径,Local repository修改为Maven配置的本地仓库的路径,最后将这两个勾选为Override。
在POM.xml文件下导入下列依赖
<parent>
<groupId>org.springframework.bootgroupId>
<artifactId>spring-boot-starter-parentartifactId>
<version>2.1.0.RELEASEversion>
parent>
<properties>
<mysql.version>5.1.47mysql.version>
<jackson.version>2.9.9jackson.version>
<druid.version>1.0.9druid.version>
<servlet-api.version>2.5servlet-api.version>
<jsp-api.version>2.0jsp-api.version>
<joda-time.version>2.5joda-time.version>
<commons-lang3.version>3.3.2commons-lang3.version>
<commons-io.version>1.3.2commons-io.version>
<mybatis.version>3.2.8mybatis.version>
<mybatis.mybatis-plus>3.1.1mybatis.mybatis-plus>
<lombok.version>1.18.4lombok.version>
properties>
<dependencies>
<dependency>
<groupId>org.springframework.bootgroupId>
<artifactId>spring-boot-starter-testartifactId>
<scope>testscope>
dependency>
<dependency>
<groupId>junitgroupId>
<artifactId>junitartifactId>
<version>4.12version>
<scope>testscope>
dependency>
dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.baomidougroupId>
<artifactId>mybatis-plusartifactId>
<version>${mybatis.mybatis-plus}version>
dependency>
<dependency>
<groupId>mysqlgroupId>
<artifactId>mysql-connector-javaartifactId>
<version>${mysql.version}version>
dependency>
<dependency>
<groupId>org.mongodbgroupId>
<artifactId>mongodb-driver-syncartifactId>
<version>3.9.1version>
dependency>
<dependency>
<groupId>org.projectlombokgroupId>
<artifactId>lombokartifactId>
<optional>trueoptional>
<version>${lombok.version}version>
dependency>
<dependency>
<groupId>org.apache.commonsgroupId>
<artifactId>commons-lang3artifactId>
<version>${commons-lang3.version}version>
dependency>
<dependency>
<groupId>org.apache.rocketmqgroupId>
<artifactId>rocketmq-spring-boot-starterartifactId>
<version>2.0.0version>
dependency>
<dependency>
<groupId>org.apache.rocketmqgroupId>
<artifactId>rocketmq-clientartifactId>
<version>4.3.2version>
dependency>
<dependency>
<groupId>org.apache.commonsgroupId>
<artifactId>commons-lang3artifactId>
<version>3.7version>
dependency>
<dependency>
<groupId>com.fasterxml.jackson.coregroupId>
<artifactId>jackson-databindartifactId>
<version>${jackson.version}version>
dependency>
<dependency>
<groupId>com.alibabagroupId>
<artifactId>druidartifactId>
<version>${druid.version}version>
dependency>
<dependency>
<groupId>commons-codecgroupId>
<artifactId>commons-codecartifactId>
<version>1.11version>
dependency>
dependencies>
dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.pluginsgroupId>
<artifactId>maven-compiler-pluginartifactId>
<version>3.2version>
<configuration>
<source>1.8source>
<target>1.8target>
<encoding>UTF-8encoding>
configuration>
plugin>
plugins>
build>
点击右上角的按键,刷新Maven
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-gsmFjv0R-1649164525886)(D:\WORK\FF\images\39.jpg)]
左侧项目目录下,External Libraries一栏打开,若如下图基本相同,则说明导入成功
创建sso模块
点击右上角的设置图标,然后点击Project Structure
在弹窗左侧选择Modules,点击 ”+“号,选择New Module
在弹框中如最开始一样,选择Maven项目,在设置项目名时,在Parent一栏选择项目mytanhuatan,并修改项目名为tanhua-sso,点击Finish。
在tanhua-sso项目下的POM.xml文件中添加依赖
<dependencies>
<dependency>
<groupId>org.springframework.bootgroupId>
<artifactId>spring-boot-starter-webartifactId>
dependency>
<dependency>
<groupId>com.baomidougroupId>
<artifactId>mybatis-plusartifactId>
dependency>
<dependency>
<groupId>com.baomidougroupId>
<artifactId>mybatis-plus-boot-starterartifactId>
<version>${mybatis.mybatis-plus}version>
dependency>
<dependency>
<groupId>mysqlgroupId>
<artifactId>mysql-connector-javaartifactId>
dependency>
<dependency>
<groupId>com.alibabagroupId>
<artifactId>druidartifactId>
dependency>
<dependency>
<groupId>org.projectlombokgroupId>
<artifactId>lombokartifactId>
dependency>
<dependency>
<groupId>org.apache.commonsgroupId>
<artifactId>commons-lang3artifactId>
dependency>
<dependency>
<groupId>com.fasterxml.jackson.coregroupId>
<artifactId>jackson-databindartifactId>
dependency>
<dependency>
<groupId>org.springframework.bootgroupId>
<artifactId>spring-boot-starter-data-redisartifactId>
dependency>
<dependency>
<groupId>commons-codecgroupId>
<artifactId>commons-codecartifactId>
dependency>
<dependency>
<groupId>org.apache.rocketmqgroupId>
<artifactId>rocketmq-spring-boot-starterartifactId>
<version>2.0.0version>
dependency>
<dependency>
<groupId>org.apache.rocketmqgroupId>
<artifactId>rocketmq-clientartifactId>
<version>4.3.2version>
dependency>
<dependency>
<groupId>io.jsonwebtokengroupId>
<artifactId>jjwtartifactId>
<version>0.9.1version>
dependency>
<dependency>
<groupId>com.aliyun.ossgroupId>
<artifactId>aliyun-sdk-ossartifactId>
<version>2.8.3version>
dependency>
<dependency>
<groupId>joda-timegroupId>
<artifactId>joda-timeartifactId>
dependency>
<dependency>
<groupId>com.arcsoft.facegroupId>
<artifactId>arcsoft-sdk-faceartifactId>
<version>2.2.0.1version>
dependency>
dependencies>
同样刷新Maven,若不报错,则说明依赖导入成功。
下载Ubuntu系统
下载地址:www.ubuntu.com
百度网盘链接:https://pan.baidu.com/s/1a9NOi99QviELG-8oeeDvJg 提取码:2dut
配置Ubuntu虚拟机系统
点击下一步,到此界面后,选择如下
完成后点击编辑虚拟机设置,设置ios,选择第一步下载的.ios
文件
启动虚拟机,虚拟机开始自动安装系统,直接下一步即可。
sudo apt install docker.io
,然后输入你的用户密码,有选择就输入y
。sudo gpasswd -a $USER docker
newgrp docker
docker ps
docker create --name redis-node01 --net host -v redis-node01:/data
redis:5.0.2 --cluster-enabled yes --cluster-config-file nodes-node-01.conf
--port 6379
docker create --name redis-node02 --net host -v redis-node02:/data
redis:5.0.2 --cluster-enabled yes --cluster-config-file nodes-node-02.conf
--port 6380
docker create --name redis-node03 --net host -v redis-node03:/data
redis:5.0.2 --cluster-enabled yes --cluster-config-file nodes-node-03.conf
--port 6381
启动容器
docker start redis-node01 redis-node02 redis-node03
进入redis-node01容器进行操作,遇到选项就输入yes
。
docker exec -it redis-node01 /bin/bash
redis-cli --cluster create 你的ip地址:6379 你的ip地址:6380
你的ip地址:6381 --cluster-replicas 0
出现以下内容,说明创建成功
点击快捷键 Ctrl + D 退出docker容器。
输入sudo -s
授予当前用户root权限。
输入sudo apt-get install vim
安装vim,遇到[Y/n]输入y
,接着一路enter。
拉取镜像
docker pull foxiswho/rocketmq:server-4.3.2
docker pull foxiswho/rocketmq:broker-4.3.2
创建nameserver容器
docker create -p 9876:9876 --name rmqserver \
-e "JAVA_OPT_EXT=-server -Xms128m -Xmx128m -Xmn128m" \
-e "JAVA_OPTS=-Duser.home=/opt" \
-v rmqserver-logs:/opt/logs \
-v rmqserver-store:/opt/store \
foxiswho/rocketmq:server-4.3.2
创建broker.conf文件
vim /itcast/rmq/rmqbroker/conf/broker.conf
brokerIP1=你的ip地址
namesrvAddr=你的ip地址:9876
brokerName=broker_tanhua
按ESC进入Command模式,输入:wq
保存文件并退出vi编辑器。
创建broker容器
docker create -p 10911:10911 -p 10909:10909 --name rmqbroker \
-e "JAVA_OPTS=-Duser.home=/opt" \
-e "JAVA_OPT_EXT=-server -Xms128m -Xmx128m -Xmn128m" \
-v /itcast/rmq/rmqbroker/conf/broker.conf:/etc/rocketmq/broker.conf \
-v rmqbroker-logs:/opt/logs \
-v rmqbroker-store:/opt/store \
foxiswho/rocketmq:broker-4.3.2
docker run -e "JAVA_OPTS=-Drocketmq.namesrv.addr=你的ip地址:9876 -
Dcom.rocketmq.sendMessageWithVIPChannel=false" -p 8082:8080 -t