CentOS7 下如何安装各类环境
安装 OpenJDK 1.8
1、检查当前机器是否有自带的JDK:
1 rpm -qa |grep java
2 rpm -qa |grep jdk
3 rpm -qa |grep gcj
2、如果没有 则跳至安装步骤,有的话 进行卸载:
1 rpm -qa | grep java | xargs rpm -e–nodeps
3、更新yum源:
1 yum update -y
4、搜索yum中的软件包:
1 yum list java-1.8*
5、安装OpenJDK:
1 yum install java-1.8.0-openjdk* -y
6、验证是否安装成功:
1 java -version
返回信息如下,则说明安装成功:
UBUNTU@TEST-SCRM:~$ JAVA-VERSION
OPENJDK VERSION “1.8.0_352”
0PENJDK RUNTIME ENVIRONMENT (BUILD 1.8.0_352-8U352-GA-1~22.04-B08)
OPENJDK 64-BIT SERVER VM(BUILD 25.352-B08, MIXED MODE)
安装 Maven
1、下载网址:maven,下载apache-maven-3.8.1-bin.tar.gz即可;
2、上传到/usr/java/目录下,然后直接将其解压:
1 tar -zxvf apache-maven-3.8.1-bin.tar.gz
2 mv apache-maven-3.8.1 maven3.8
3、新建仓库目录:
1 mkdir /usr/java/maven3.8/repository
4、更换阿里云镜像并设置maven仓库位置:
1 vim /usr/java/maven3.8/conf/settings.xml
2 <mirrors>
3 <mirror>
4 <id>alimaven</id>
5 <name>aliyun maven</name>
6 <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
7 <mirrorOf>central</mirrorOf>
8 </mirror>
9 </mirrors>
10 <localRepository>/usr/java/maven3.8/repository</localRepository>
5、配置环境变量:
6、刷新配置文件查看版本信息:
安装 NodeJS
1、下载:
2、解压缩:
3、创建软链接:
4、验证是否安装成功:
UBUNTU@TEST-SCRM:~$ NODE-V
V14.21.1
UBUNTU@TEST-SCRM:~$
安装 Docker
1、卸载docker旧版本:
2、安装yum-utils软件包:
3、设置Docker仓库(这里使用阿里云地址):
4、更新yum软件包索引:
1 yum makecache fast
5、安装最新版本的Docker:
1 yum install docker-ce docker-ce-cli containerd.io
6、启动docker:
1 systemctl start docker
7、测试运行:
1 docker run hello-world
UBUNTU@TEST-SCRM:~$ SUDO DOCKER RUN HELLO-WORLD
HELLO FROM DOCKER!
THIS MESSAGE SHOWS THAT YOUR INSTALLATION APPEARS TO BE WORKING CORRECTLY.
E DOCKER TOOK THE FOLLOWING STEPS:
TO GENERATE THIS MESSAGE,DO
CLIENT CONTACTED
1. THE DOCKER CLIE
THE DOCKER DAEMON.
2.THE DOCKER DAEMON PULLED THE “HELLO-WORLD” IMAGE FROM THE DOCKER HUB.
(AMD64)
3.THE DOCKER DAEMON CREATED A NEW CONTAINER FROM THAT IMAGE WHICH RUNS THE
PRODUCES THE OUTPUT YOU ARE CURRENTLY READING.
EXECUTABLE THAT PRODUCE
4. THE DOCKER DAEMON STREAMED THAT OUTPUT TO THE DOCKER CLIENT, WHICH SENT IT
TO YOUR TERMINAL.
TO TRY SOMETHING MORE AMBITIOUS,YOU CAN RUN AN UBUNTU CONTAINER WITH:
$ DOCKER RUN-IT UBUNTU BASH
SHARE IMAGES,AUTOMATE WORKFLOWS,AND MORE WITH A FREE DOCKER ID:
安装 Docker-Compose
1、下载二进制文件:
1 wget https://github.com/docker/compose/releases/download/1.24.0/docker-compose-Linux-x86_64
2、移动文件:
1 mv docker-compose-Linux-x86_64 /usr/local/bin/docker-compose
3、赋予可执行权限:
1 chmod+x /usr/local/bin/docker-compose
4、创建软链:
1 ln-s /usr/local/bin/docker-compose /usr/bin/docker-compose
5、测试是否安装成功:
1 docker-compose –version