赞
踩
[root@nacos ~]# systemctl stop firewalld && systemctl disable firewalld && setenforce 0 && sed -ri s/SELINUX=.*$/SELINUX=disabled/g /etc/selinux/config # 解压压缩包 [root@nacos ~]# tar xf jdk-8u211-linux-x64.tar.gz [root@nacos ~]# tar xf apache-maven-3.5.4-bin.tar.gz [root@nacos ~]# tar xf apache-tomcat-8.5.50.tar.gz [root@nacos ~]# tar xf nacos-server-2.0.2.tar.gz [root@nacos ~]# mkdir /data [root@nacos ~]# mv jdk1.8.0_211 /data/java [root@nacos ~]# mv apache-maven-3.5.4 /data/java/maven # 配置环境变量 [root@nacos ~]# vim /etc/profile.d/java.sh JAVA_HOME=/data/java MAVEN_HOME=/data/java/maven PATH=$PATH:$JAVA_HOME/bin:$MAVEN_HOME/bin export JAVA_HOME MAVEN_HOME PATH # 使环境变量生效 [root@nacos ~]# source /etc/profile.d/java.sh [root@nacos ~]# java -version # 查看环境变量是否生效 java version "1.8.0_211" Java(TM) SE Runtime Environment (build 1.8.0_211-b12) Java HotSpot(TM) 64-Bit Server VM (build 25.211-b12, mixed mode) [root@nacos ~]# mvn -v Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-18T02:33:14+08:00) Maven home: /data/java/maven Java version: 1.8.0_211, vendor: Oracle Corporation, runtime: /data/java/jre Default locale: en_US, platform encoding: UTF-8 OS name: "linux", version: "3.10.0-957.el7.x86_64", arch: "amd64", family: "unix" # 安装Git [root@nacos ~]# yum install -y git [root@nacos ~]# cd nacos/bin/ # 启动nacos [root@nacos bin]# sh startup.sh -m standalone [root@nacos bin]# cd ../conf [root@nacos conf]# vim application.properties # 修改以下内容 server.servlet.contextPath=/nacos server.port=8848 # 数据库 db.url.0=jdbc:mysql://172.168.10.13:3306/nacos?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC db.user.0=dev db.password.0=dev#1234 [root@nacos bin]# curl -X POST 'http://127.0.0.1:8848/nacos/v1/ns/instance?serviceName=nacos.naming.serviceName&ip=172.168.10.8&port=8080' [root@nacos bin]# curl -X GET 'http://127.0.0.1:8848/nacos/v1/ns/instance/list?serviceName=nacos.naming.serviceName' [root@nacos bin]# curl -X POST "http://127.0.0.1:8848/nacos/v1/cs/configs?dataId=nacos.cfg.dataId&group=test&content=HelloWorld" [root@nacos bin]# curl -X GET "http://127.0.0.1:8848/nacos/v1/cs/configs?dataId=nacos.cfg.dataId&group=test"
nacos地址:http://172.168.10.8:8848/nacos
从旧nacos导出配置文件,得到一个nacos_config_export 的压缩包
在新的nacos创建命名空间
创建好命名空间后导入先前导出的配置文件即可
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。