nacos安装手册

1. 单机模式

1.1 准备安装介质

nacos-server-2.1.1.tar.gz

1.2 环境准备

  1. 1台服务器
  2. 安装JDK 1.8+

1.3 解压

tar-zxvf nacos-server-2.1.1.tar.gz

1.4 启动

进入解压的nacos目录,进入bin目录,运行:

./startup.sh -m standalone

1.5 验证

nacos服务默认端口是8848,如访问:http://10.1.192.120:8848/nacos/#/login,出现登录页面:

在这里插入图片描述

默认账号: nacos / nacos

在这里插入图片描述

1.6 关闭服务

# 进入nacos bin目录
./shutdown.sh

2. 集群模式

集群搭建以3个节点为例进行步骤说明。

2.1 介质准备

nacos-server-2.1.1.tar.gz

2.2 环境准备

  1. 准备3个节点机器
  2. 安装jdk 1.8+

2.3 解压

依次在服务节点进行安装介质解压:

tar-zxvf nacos-server-2.1.1.tar.gz

2.4 配置集群配置文件

在nacos的解压目录nacos的/config目录下,有配置文件cluster.conf,请每行配置成ip:port。(需要每个节点都配置。)

#it is ip
#example
10.1.192.120:8845
10.1.192.121:8845
10.1.192.122:8848

2.5 确定数据源

使用外置数据源

  1. 初始化MySQL数据库,sql可以在nacos config目录下面获取

    /*
    * Copyright 1999-2018 Alibaba Group Holding Ltd.
    *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
    *
    *http://www.apache.org/licenses/LICENSE-2.0
    *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    * See the License for the specific language governing permissions and
    * limitations under the License.
    */
    
    /**************/
    /* 数据库全名 = nacos_config */
    /* 表名称 = config_info */
    /**************/
    CREATE TABLEconfig_info(
    idbigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
    data_idvarchar(255) NOT NULL COMMENT 'data_id',
    group_idvarchar(255) DEFAULT NULL,
    contentlongtext NOT NULL COMMENT 'content',
    md5varchar(32) DEFAULT NULL COMMENT 'md5',
    gmt_createdatetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    gmt_modifieddatetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
    src_usertext COMMENT 'source user',
    src_ipvarchar(50) DEFAULT NULL COMMENT 'source ip',
    app_namevarchar(128) DEFAULT NULL,
    tenant_idvarchar(128) DEFAULT '' COMMENT '租户字段',
    c_descvarchar(256) DEFAULT NULL,
    c_usevarchar(64) DEFAULT NULL,
    effectvarchar(64) DEFAULT NULL,
    typevarchar(64) DEFAULT NULL,
    c_schematext,
    encrypted_data_keytext NOT NULL COMMENT '秘钥',
    PRIMARY KEY (id),
    UNIQUE KEYuk_configinfo_datagrouptenant(data_id,group_id,tenant_id)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='config_info';
    
    /**************/
    /* 数据库全名 = nacos_config */
    /* 表名称 = config_info_aggr */
    /**************/
    CREATE TABLEconfig_info_aggr(
    idbigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
    data_idvarchar(255) NOT NULL COMMENT 'data_id',
    group_idvarchar
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Coder-文小白

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值