服务器
- 操作系统:openEuler 20.03 64bit with ARM
安装JDK
- 执行
java -version
查看是否已安装JDK
[root@0001 ~]# java -version
-bash: java: command not found
- 执行
yum -y list java*
,搜索可安装的JDK
[root@0001 ~]# yum -y list java*
Last metadata expiration check: 2:55:46 ago on Tue 20 Jun 2023 06:10:42 AM CST.
Available Packages
java-1.8.0-openjdk.src 1:1.8.0.242.b08-1.h5.oe1 source
java-1.8.0-openjdk.aarch64 1:1.8.0.262.b10-0.oe1 update
java-1.8.0-openjdk-debuginfo.aarch64 1:1.8.0.262.b10-0.oe1 update
java-1.8.0-openjdk-debugsource.aarch64 1:1.8.0.262.b10-0.oe1 update
java-1.8.0-openjdk-demo.aarch64 1:1.8.0.262.b10-0.oe1 update
java-1.8.0-openjdk-demo-slowdebug.aarch64 1:1.8.0.262.b10-0.oe1 update
java-1.8.0-openjdk-devel.aarch64 1:1.8.0.262.b10-0.oe1 update
java-1.8.0-openjdk-devel-slowdebug.aarch64 1:1.8.0.262.b10-0.oe1 update
java-1.8.0-openjdk-headless.aarch64 1:1.8.0.262.b10-0.oe1 update
java-1.8.0-openjdk-headless-slowdebug.aarch64 1:1.8.0.262.b10-0.oe1 update
java-1.8.0-openjdk-javadoc.noarch 1:1.8.0.262.b10-0.oe1 update
java-1.8.0-openjdk-javadoc-zip.noarch 1:1.8.0.262.b10-0.oe1 update
java-1.8.0-openjdk-slowdebug.aarch64 1:1.8.0.262.b10-0.oe1 update
java-1.8.0-openjdk-src.aarch64 1:1.8.0.262.b10-0.oe1 update
java-1.8.0-openjdk-src-slowdebug.aarch64 1:1.8.0.262.b10-0.oe1 update
javacc.noarch 7.0.2-7.oe1 EPOL
javacc-help.noarch 7.0.2-7.oe1 EPOL
javapackages-filesystem.noarch 5.3.0-2.oe1 OS
javapackages-filesystem.noarch 5.3.0-2.oe1 everything
javapackages-local.noarch 5.3.0-2.oe1 EPOL
javapackages-local.noarch 5.3.0-2.oe1 update
javapackages-tools.noarch 5.3.0-2.oe1 everything
javapackages-tools.src 5.3.0-2.oe1 source
- 执行
yum install -y java-1.8.0-openjdk.aarch64 --nogpgcheck
,安装JDK - 执行
java -version
验证是否安装成功
[root@0001 ~]# java -version
openjdk version "1.8.0_262"
OpenJDK Runtime Environment Boole (build 1.8.0_262-b10)
OpenJDK 64-Bit Server VM Boole (build 25.262-b10, mixed mode)
- 如果要卸载JDK,执行如下命令
yum -y remove java-1.8.0*
yum -y remove tzdata-java.noarch
yum -y remove javapackages-tools.noarch
- 执行
vi /etc/profile
,在/etc/profile
文件最后中添加环境变量,添加内容如下
export JAVA_HOME=/usr/lib/jvm/jre
- 执行
source /etc/profile
使环境变量生效
安装Nacos
- 前往 https://github.com/alibaba/nacos/releases 下载需要安装的版本,我使用的是
nacos-server-2.1.1.tar.gz
- 将安装包上传到主机任意目录,我放到了
/home
目录下 - 执行
tar -xzvf /home/nacos-server-2.1.1.tar.gz -C /usr/local
解压到指定目录 Nacos
的配置文件和数据库脚本在/usr/local/nacos/conf
目录下,有需要的可以修改后再启动- 执行
sh /usr/local/nacos/bin/startup.sh -m standalone
启动Nacos
,启动成功如下
[root@0001 ~]# sh /usr/local/nacos/bin/startup.sh -m standalone
/usr/lib/jvm/jre/bin/java -Djava.ext.dirs=/usr/lib/jvm/jre/jre/lib/ext:/usr/lib/jvm/jre/lib/ext -Xms512m -Xmx512m -Xmn256m -Dnacos.standalone=true -Dnacos.member.list= -Xloggc:/usr/local/nacos/logs/nacos_gc.log -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M -Dloader.path=/usr/local/nacos/plugins/health,/usr/local/nacos/plugins/cmdb,/usr/local/nacos/plugins/selector -Dnacos.home=/usr/local/nacos -jar /usr/local/nacos/target/nacos-server.jar --spring.config.additional-location=file:/usr/local/nacos/conf/ --logging.config=/usr/local/nacos/conf/nacos-logback.xml --server.max-http-header-size=524288
nacos is starting with standalone
nacos is starting,you can check the /usr/local/nacos/logs/start.out
- 启动成功后,访问
ip:8848/nacos
,默认用户名nacos
,密码nacos
- 停止
Nacos
的命令sh /usr/local/nacos/bin/shutdown.sh
Nacos
的日志文件路径/usr/local/nacos/logs
,如果启动失败可以查看日志