springAlibaba实践(一)
source link: http://www.blogjava.net/zzsuje/archive/2022/04/20/450721.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
第四步: vagrant up 下载启动镜像
vagrant up
有下载过慢的问题,可以复制链接到网页上下载
或者:
一、进入vagrant官网 https://www.vagrantup.com/
二、点击findbox【寻找box】,进入有很多box的列表 https://app.vagrantup.com/boxes/search
三、下载链接:https://cloud.centos.org/centos/7/vagrant/x86_64/images/CentOS-7-x86_64-Vagrant-2004_01.VirtualBox.box
这里的2004_01可以修改成自己想要的版本
四 加载下载的镜像
添加镜像语法
vagrant box add [名称] [源路径]
添加 centos/7 镜像
已经下载好的 源文件路径: E:\cenos\CentOS-7-x86_64-Vagrant-2004_01.VirtualBox.box
第五步 :重新加载镜像
vagrant up
第五步:vagrant ssh
虚拟机网络配置
C:\Users\Medimpact(peking)\Vagrantfile
config.vm.network "private_network", ip: "192.168.56.100"
配置保存后 需重启虚拟机
或者命令行
ping 192.168.56.100
另:
为什么使用56.100
ipconfig本机
虚拟机的ip 为56段的
设置virtualBox的网络链接方式为 仅主机(Host-Only)网络
下载FinalShell链接192.168.56.100
用户名 root
密码 vagrant
连接不成功
说明没有开启远程连接
sudo vi ect/ssh/sshd_config
查看文件 点I
Insert
改动两个选项
PermitRootLogin yes
passwordAuthentication yes
修改成功后
systemctl restart sshd
按insert 编辑
:wq 保存退出
用final shell 连接 192.168.56.100 用户 root 密码 vagrant
docker 安装
$sudo yum remove docker \ docker-client \ docker-client-latest \ docker-common \ docker-latest \ docker-latest-logrotate \ docker-logrotate \ docker-engine
sudo yum install -y yum-utils
sudo yum-config-manager \
--add-repo \ https://download.docker.com/linux/centos/docker-ce.repo
sudo yum install docker-ce docker-ce-cli containerd.io
安装完成后
docker -v 查看docker版本
docker images 查看docker 已有镜像 (未启动)
启动docker
设置docker 开机启动
使用阿里云的镜像加速器 在阿里云的控制台中 找产品和服务 ---容器镜像服务---镜像加速器
https://cr.console.aliyun.com/cn-hangzhou/instances/mirrors
1.sudo mkdir -p /etc/docker 2.sudo tee /etc/docker/daemon.json <<-'EOF' { "registry-mirrors": ["https://d6gqzuc3.mirror.aliyuncs.com"] } EOF 3.sudo systemctl daemon-reload 4.sudo systemctl restart docker 安装mysql
https://hub.docker.com/_/mysql?tab=tags&page=1&ordering=last_updated
docker pull mysql:5.7
安装成功后 查看镜像
docker images
设置端口映射
docker ps 查看已启用的容器
修改配日志文件
[client]
default-character-set=utf8
保存后 重启 设置 启动docker时 即运行mysql
docker pull redis
https://docs.spring.io/spring-boot/docs/2.1.18.RELEASE/reference/html/
https://docs.spring.io/spring-boot/docs/2.1.18.RELEASE/reference/html/getting-started-installing-spring-boot.html#getting-started-maven-installation
替换自己的pom文件
Greenwich.SR3
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK