你的浏览器不支持canvas

做你害怕做的事情,然后你会发现,不过如此。

华为云鲲鹏openEuler服务器安装Nacos

时间: 作者: 黄运鑫

本文章属原创文章,未经作者许可,禁止转载,复制,下载,以及用作商业用途。原作者保留所有解释权。


服务器

  • 操作系统: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,如果启动失败可以查看日志

对于本文内容有问题或建议的小伙伴,欢迎在文章底部留言交流讨论。