Nacos一些理解

news2024/11/17 19:43:06

下载Mysql 

//下载mysql
docker pull mysql:5.7
//运行容器
docker run  -p 3306:3306 --name mysql -v /home/mysql/log:/var/log/mysql   -v /home/mysql/data:/var/lib/mysql     -e MYSQL_ROOT_PASSWORD='xx'  -d mysql:5.7

 将导入数据库

1.新建数据库 nacos

/*
 Navicat Premium Data Transfer

 Source Server         : localhost_3306
 Source Server Type    : MySQL
 Source Server Version : 50735
 Source Host           : localhost:3306
 Source Schema         : nacos

 Target Server Type    : MySQL
 Target Server Version : 50735
 File Encoding         : 65001

 Date: 08/12/2022 10:03:24
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for config_info
-- ----------------------------
DROP TABLE IF EXISTS `config_info`;
CREATE TABLE `config_info`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `data_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'data_id',
  `group_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
  `content` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'content',
  `md5` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT 'md5',
  `gmt_create` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `gmt_modified` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
  `src_user` text CHARACTER SET utf8 COLLATE utf8_bin NULL COMMENT 'source user',
  `src_ip` varchar(50) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT 'source ip',
  `app_name` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
  `tenant_id` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT '' COMMENT '租户字段',
  `c_desc` varchar(256) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
  `c_use` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
  `effect` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
  `type` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
  `c_schema` text CHARACTER SET utf8 COLLATE utf8_bin NULL,
  `encrypted_data_key` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `uk_configinfo_datagrouptenant`(`data_id`, `group_id`, `tenant_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 11 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = 'config_info' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of config_info
-- ----------------------------
INSERT INTO `config_info` VALUES (2, 'cloudalibaba-config-service-dev.yaml', 'devGroup', 'server:\r\n  port: 8002\r\n  servlet:\r\n    context-path: /api\r\n    \r\n#日志\r\n#logging:\r\n#  level:\r\n#    com.home: info\r\n#  file:\r\n#    name: test.log\r\n    \r\n#nacos配置\r\nspring:\r\n  application:\r\n  #应用名称\r\n    name: cloudalibaba-config-service\r\n  profiles:\r\n  #配置环境\r\n    active: dev\r\n  cloud:\r\n    nacos:\r\n      discovery: \r\n        # 服务注册地址\r\n        server-addr: 127.0.0.1:8848\r\n      config: \r\n        # 配置中心地址\r\n        server-addr: 127.0.0.1:8848\r\n        # 配置文件格式\r\n        file-extension: yaml  #后缀名\r\n        group: devGroup      #分组\r\n        namespace: 6c0d1238-2c4a-4c1c-b790-8a5783d3acb1  #命名空间的id\r\n        info: 111\r\n\r\n\r\n', '04aaac5d4d69c8f45f648d15cde9a6a7', '2022-12-08 01:39:26', '2022-12-08 01:39:26', NULL, '0:0:0:0:0:0:0:1', '', '6c0d1238-2c4a-4c1c-b790-8a5783d3acb1', NULL, NULL, NULL, 'yaml', NULL, '');
INSERT INTO `config_info` VALUES (4, 'cloudalibaba-config-service-dev.yaml', 'devGroup', 'server:\n  port: 8002\n  servlet:\n    context-path: /api\n    \n#日志\n#logging:\n#  level:\n#    com.home: info\n#  file:\n#    name: test.log\n    \n#nacos配置\nspring:\n  application:\n  #应用名称\n    name: cloudalibaba-config-service\n  profiles:\n  #配置环境\n    active: dev\n  cloud:\n    nacos:\n      discovery: \n        # 服务注册地址\n        server-addr: 127.0.0.1:8848\n      config: \n        # 配置中心地址\n        server-addr: 127.0.0.1:8848\n        # 配置文件格式\n        file-extension: yaml  #后缀名\n        group: devGroup      #分组\n        namespace: a298fe41-a0c0-4c3d-9e8a-91788bc646e4  #命名空间的id\nconfig:\n  info: 111112332\n\n\n', '7057d3875104bad8dba3da2484963a17', '2022-12-08 01:41:30', '2022-12-08 01:52:03', 'nacos', '0:0:0:0:0:0:0:1', '', 'a298fe41-a0c0-4c3d-9e8a-91788bc646e4', '', '', '', 'yaml', '', '');

-- ----------------------------
-- Table structure for config_info_aggr
-- ----------------------------
DROP TABLE IF EXISTS `config_info_aggr`;
CREATE TABLE `config_info_aggr`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `data_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'data_id',
  `group_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'group_id',
  `datum_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'datum_id',
  `content` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '内容',
  `gmt_modified` datetime(0) NOT NULL COMMENT '修改时间',
  `app_name` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
  `tenant_id` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT '' COMMENT '租户字段',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `uk_configinfoaggr_datagrouptenantdatum`(`data_id`, `group_id`, `tenant_id`, `datum_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '增加租户字段' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for config_info_beta
-- ----------------------------
DROP TABLE IF EXISTS `config_info_beta`;
CREATE TABLE `config_info_beta`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `data_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'data_id',
  `group_id` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'group_id',
  `app_name` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT 'app_name',
  `content` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'content',
  `beta_ips` varchar(1024) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT 'betaIps',
  `md5` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT 'md5',
  `gmt_create` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `gmt_modified` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
  `src_user` text CHARACTER SET utf8 COLLATE utf8_bin NULL COMMENT 'source user',
  `src_ip` varchar(50) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT 'source ip',
  `tenant_id` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT '' COMMENT '租户字段',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `uk_configinfobeta_datagrouptenant`(`data_id`, `group_id`, `tenant_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = 'config_info_beta' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for config_info_tag
-- ----------------------------
DROP TABLE IF EXISTS `config_info_tag`;
CREATE TABLE `config_info_tag`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `data_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'data_id',
  `group_id` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'group_id',
  `tenant_id` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT '' COMMENT 'tenant_id',
  `tag_id` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'tag_id',
  `app_name` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT 'app_name',
  `content` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'content',
  `md5` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT 'md5',
  `gmt_create` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `gmt_modified` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
  `src_user` text CHARACTER SET utf8 COLLATE utf8_bin NULL COMMENT 'source user',
  `src_ip` varchar(50) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT 'source ip',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `uk_configinfotag_datagrouptenanttag`(`data_id`, `group_id`, `tenant_id`, `tag_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = 'config_info_tag' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for config_tags_relation
-- ----------------------------
DROP TABLE IF EXISTS `config_tags_relation`;
CREATE TABLE `config_tags_relation`  (
  `id` bigint(20) NOT NULL COMMENT 'id',
  `tag_name` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'tag_name',
  `tag_type` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT 'tag_type',
  `data_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'data_id',
  `group_id` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'group_id',
  `tenant_id` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT '' COMMENT 'tenant_id',
  `nid` bigint(20) NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`nid`) USING BTREE,
  UNIQUE INDEX `uk_configtagrelation_configidtag`(`id`, `tag_name`, `tag_type`) USING BTREE,
  INDEX `idx_tenant_id`(`tenant_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = 'config_tag_relation' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for group_capacity
-- ----------------------------
DROP TABLE IF EXISTS `group_capacity`;
CREATE TABLE `group_capacity`  (
  `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `group_id` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT 'Group ID,空字符表示整个集群',
  `quota` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '配额,0表示使用默认值',
  `usage` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '使用量',
  `max_size` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '单个配置大小上限,单位为字节,0表示使用默认值',
  `max_aggr_count` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '聚合子配置最大个数,,0表示使用默认值',
  `max_aggr_size` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '单个聚合数据的子配置大小上限,单位为字节,0表示使用默认值',
  `max_history_count` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '最大变更历史数量',
  `gmt_create` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `gmt_modified` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `uk_group_id`(`group_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '集群、各Group容量信息表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for his_config_info
-- ----------------------------
DROP TABLE IF EXISTS `his_config_info`;
CREATE TABLE `his_config_info`  (
  `id` bigint(64) UNSIGNED NOT NULL,
  `nid` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
  `data_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
  `group_id` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
  `app_name` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT 'app_name',
  `content` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
  `md5` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
  `gmt_create` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `gmt_modified` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `src_user` text CHARACTER SET utf8 COLLATE utf8_bin NULL,
  `src_ip` varchar(50) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
  `op_type` char(10) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
  `tenant_id` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT '' COMMENT '租户字段',
  `encrypted_data_key` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
  PRIMARY KEY (`nid`) USING BTREE,
  INDEX `idx_gmt_create`(`gmt_create`) USING BTREE,
  INDEX `idx_gmt_modified`(`gmt_modified`) USING BTREE,
  INDEX `idx_did`(`data_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 13 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '多租户改造' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of his_config_info
-- ----------------------------
INSERT INTO `his_config_info` VALUES (0, 1, '1111', 'DEFAULT_GROUP', '', '111', '698d51a19d8a121ce581499d7b701668', '2022-12-08 09:38:33', '2022-12-08 01:38:33', NULL, '0:0:0:0:0:0:0:1', 'I', '6c0d1238-2c4a-4c1c-b790-8a5783d3acb1', '');
INSERT INTO `his_config_info` VALUES (1, 2, '1111', 'DEFAULT_GROUP', '', '111', '698d51a19d8a121ce581499d7b701668', '2022-12-08 09:38:46', '2022-12-08 01:38:47', NULL, '0:0:0:0:0:0:0:1', 'D', '6c0d1238-2c4a-4c1c-b790-8a5783d3acb1', '');
INSERT INTO `his_config_info` VALUES (0, 3, 'cloudalibaba-config-service-dev.yaml', 'devGroup', '', 'server:\r\n  port: 8002\r\n  servlet:\r\n    context-path: /api\r\n    \r\n#日志\r\n#logging:\r\n#  level:\r\n#    com.home: info\r\n#  file:\r\n#    name: test.log\r\n    \r\n#nacos配置\r\nspring:\r\n  application:\r\n  #应用名称\r\n    name: cloudalibaba-config-service\r\n  profiles:\r\n  #配置环境\r\n    active: dev\r\n  cloud:\r\n    nacos:\r\n      discovery: \r\n        # 服务注册地址\r\n        server-addr: 127.0.0.1:8848\r\n      config: \r\n        # 配置中心地址\r\n        server-addr: 127.0.0.1:8848\r\n        # 配置文件格式\r\n        file-extension: yaml  #后缀名\r\n        group: devGroup      #分组\r\n        namespace: 6c0d1238-2c4a-4c1c-b790-8a5783d3acb1  #命名空间的id\r\n        info: 111\r\n\r\n\r\n', '04aaac5d4d69c8f45f648d15cde9a6a7', '2022-12-08 09:39:25', '2022-12-08 01:39:26', NULL, '0:0:0:0:0:0:0:1', 'I', '6c0d1238-2c4a-4c1c-b790-8a5783d3acb1', '');
INSERT INTO `his_config_info` VALUES (0, 4, 'cloudalibaba-config-service-dev.yaml', 'devGroup', '', 'server:\r\n  port: 8002\r\n  servlet:\r\n    context-path: /api\r\n    \r\n#日志\r\n#logging:\r\n#  level:\r\n#    com.home: info\r\n#  file:\r\n#    name: test.log\r\n    \r\n#nacos配置\r\nspring:\r\n  application:\r\n  #应用名称\r\n    name: cloudalibaba-config-service\r\n  profiles:\r\n  #配置环境\r\n    active: dev\r\n  cloud:\r\n    nacos:\r\n      discovery: \r\n        # 服务注册地址\r\n        server-addr: 127.0.0.1:8848\r\n      config: \r\n        # 配置中心地址\r\n        server-addr: 127.0.0.1:8848\r\n        # 配置文件格式\r\n        file-extension: yaml  #后缀名\r\n        group: devGroup      #分组\r\n        namespace: a298fe41-a0c0-4c3d-9e8a-91788bc646e4  #命名空间的id\r\n        info: 111\r\n\r\n\r\n', '0a343a4d8485b11ecc705da1cb120a4f', '2022-12-08 09:40:59', '2022-12-08 01:41:00', NULL, '0:0:0:0:0:0:0:1', 'I', '', '');
INSERT INTO `his_config_info` VALUES (0, 5, 'cloudalibaba-config-service-dev.yaml', 'devGroup', '', 'server:\r\n  port: 8002\r\n  servlet:\r\n    context-path: /api\r\n    \r\n#日志\r\n#logging:\r\n#  level:\r\n#    com.home: info\r\n#  file:\r\n#    name: test.log\r\n    \r\n#nacos配置\r\nspring:\r\n  application:\r\n  #应用名称\r\n    name: cloudalibaba-config-service\r\n  profiles:\r\n  #配置环境\r\n    active: dev\r\n  cloud:\r\n    nacos:\r\n      discovery: \r\n        # 服务注册地址\r\n        server-addr: 127.0.0.1:8848\r\n      config: \r\n        # 配置中心地址\r\n        server-addr: 127.0.0.1:8848\r\n        # 配置文件格式\r\n        file-extension: yaml  #后缀名\r\n        group: devGroup      #分组\r\n        namespace: a298fe41-a0c0-4c3d-9e8a-91788bc646e4  #命名空间的id\r\n        info: 111\r\n\r\n\r\n', '0a343a4d8485b11ecc705da1cb120a4f', '2022-12-08 09:41:30', '2022-12-08 01:41:30', NULL, '0:0:0:0:0:0:0:1', 'I', 'a298fe41-a0c0-4c3d-9e8a-91788bc646e4', '');
INSERT INTO `his_config_info` VALUES (3, 6, 'cloudalibaba-config-service-dev.yaml', 'devGroup', '', 'server:\r\n  port: 8002\r\n  servlet:\r\n    context-path: /api\r\n    \r\n#日志\r\n#logging:\r\n#  level:\r\n#    com.home: info\r\n#  file:\r\n#    name: test.log\r\n    \r\n#nacos配置\r\nspring:\r\n  application:\r\n  #应用名称\r\n    name: cloudalibaba-config-service\r\n  profiles:\r\n  #配置环境\r\n    active: dev\r\n  cloud:\r\n    nacos:\r\n      discovery: \r\n        # 服务注册地址\r\n        server-addr: 127.0.0.1:8848\r\n      config: \r\n        # 配置中心地址\r\n        server-addr: 127.0.0.1:8848\r\n        # 配置文件格式\r\n        file-extension: yaml  #后缀名\r\n        group: devGroup      #分组\r\n        namespace: a298fe41-a0c0-4c3d-9e8a-91788bc646e4  #命名空间的id\r\n        info: 111\r\n\r\n\r\n', '0a343a4d8485b11ecc705da1cb120a4f', '2022-12-08 09:41:34', '2022-12-08 01:41:34', NULL, '0:0:0:0:0:0:0:1', 'D', '', '');
INSERT INTO `his_config_info` VALUES (4, 7, 'cloudalibaba-config-service-dev.yaml', 'devGroup', '', 'server:\r\n  port: 8002\r\n  servlet:\r\n    context-path: /api\r\n    \r\n#日志\r\n#logging:\r\n#  level:\r\n#    com.home: info\r\n#  file:\r\n#    name: test.log\r\n    \r\n#nacos配置\r\nspring:\r\n  application:\r\n  #应用名称\r\n    name: cloudalibaba-config-service\r\n  profiles:\r\n  #配置环境\r\n    active: dev\r\n  cloud:\r\n    nacos:\r\n      discovery: \r\n        # 服务注册地址\r\n        server-addr: 127.0.0.1:8848\r\n      config: \r\n        # 配置中心地址\r\n        server-addr: 127.0.0.1:8848\r\n        # 配置文件格式\r\n        file-extension: yaml  #后缀名\r\n        group: devGroup      #分组\r\n        namespace: a298fe41-a0c0-4c3d-9e8a-91788bc646e4  #命名空间的id\r\n        info: 111\r\n\r\n\r\n', '0a343a4d8485b11ecc705da1cb120a4f', '2022-12-08 09:43:02', '2022-12-08 01:43:03', 'nacos', '0:0:0:0:0:0:0:1', 'U', 'a298fe41-a0c0-4c3d-9e8a-91788bc646e4', '');
INSERT INTO `his_config_info` VALUES (4, 8, 'cloudalibaba-config-service-dev.yaml', 'devGroup', '', 'server:\n  port: 8002\n  servlet:\n    context-path: /api\n    \n#日志\n#logging:\n#  level:\n#    com.home: info\n#  file:\n#    name: test.log\n    \n#nacos配置\nspring:\n  application:\n  #应用名称\n    name: cloudalibaba-config-service\n  profiles:\n  #配置环境\n    active: dev\n  cloud:\n    nacos:\n      discovery: \n        # 服务注册地址\n        server-addr: 127.0.0.1:8848\n      config: \n        # 配置中心地址\n        server-addr: 127.0.0.1:8848\n        # 配置文件格式\n        file-extension: yaml  #后缀名\n        group: devGroup      #分组\n        namespace: a298fe41-a0c0-4c3d-9e8a-91788bc646e4  #命名空间的id\nconfig:\n  info: 222\n\n\n', '95c16f98f68c074d198b5dcdfe436adc', '2022-12-08 09:44:35', '2022-12-08 01:44:35', 'nacos', '0:0:0:0:0:0:0:1', 'U', 'a298fe41-a0c0-4c3d-9e8a-91788bc646e4', '');
INSERT INTO `his_config_info` VALUES (4, 9, 'cloudalibaba-config-service-dev.yaml', 'devGroup', '', 'server:\n  port: 8002\n  servlet:\n    context-path: /api\n    \n#日志\n#logging:\n#  level:\n#    com.home: info\n#  file:\n#    name: test.log\n    \n#nacos配置\nspring:\n  application:\n  #应用名称\n    name: cloudalibaba-config-service\n  profiles:\n  #配置环境\n    active: dev\n  cloud:\n    nacos:\n      discovery: \n        # 服务注册地址\n        server-addr: 127.0.0.1:8848\n      config: \n        # 配置中心地址\n        server-addr: 127.0.0.1:8848\n        # 配置文件格式\n        file-extension: yaml  #后缀名\n        group: devGroup      #分组\n        namespace: a298fe41-a0c0-4c3d-9e8a-91788bc646e4  #命名空间的id\nconfig:\n  info: 222\n\n\n', '95c16f98f68c074d198b5dcdfe436adc', '2022-12-08 09:46:48', '2022-12-08 01:46:49', 'nacos', '0:0:0:0:0:0:0:1', 'U', 'a298fe41-a0c0-4c3d-9e8a-91788bc646e4', '');
INSERT INTO `his_config_info` VALUES (4, 10, 'cloudalibaba-config-service-dev.yaml', 'devGroup', '', 'server:\n  port: 8002\n  servlet:\n    context-path: /api\n    \n#日志\n#logging:\n#  level:\n#    com.home: info\n#  file:\n#    name: test.log\n    \n#nacos配置\nspring:\n  application:\n  #应用名称\n    name: cloudalibaba-config-service\n  profiles:\n  #配置环境\n    active: dev\n  cloud:\n    nacos:\n      discovery: \n        # 服务注册地址\n        server-addr: 127.0.0.1:8848\n      config: \n        # 配置中心地址\n        server-addr: 127.0.0.1:8848\n        # 配置文件格式\n        file-extension: yaml  #后缀名\n        group: devGroup      #分组\n        namespace: a298fe41-a0c0-4c3d-9e8a-91788bc646e4  #命名空间的id\nconfig:\n  info: 333\n\n\n', 'c0456765a82f826585ab72406214f6aa', '2022-12-08 09:50:58', '2022-12-08 01:50:59', 'nacos', '0:0:0:0:0:0:0:1', 'U', 'a298fe41-a0c0-4c3d-9e8a-91788bc646e4', '');
INSERT INTO `his_config_info` VALUES (4, 11, 'cloudalibaba-config-service-dev.yaml', 'devGroup', '', 'server:\n  port: 8002\n  servlet:\n    context-path: /api\n    \n#日志\n#logging:\n#  level:\n#    com.home: info\n#  file:\n#    name: test.log\n    \n#nacos配置\nspring:\n  application:\n  #应用名称\n    name: cloudalibaba-config-service\n  profiles:\n  #配置环境\n    active: dev\n  cloud:\n    nacos:\n      discovery: \n        # 服务注册地址\n        server-addr: 127.0.0.1:8848\n      config: \n        # 配置中心地址\n        server-addr: 127.0.0.1:8848\n        # 配置文件格式\n        file-extension: yaml  #后缀名\n        group: devGroup      #分组\n        namespace: a298fe41-a0c0-4c3d-9e8a-91788bc646e4  #命名空间的id\nconfig:\n  info: 555\n\n\n', '581d859118e82478112337febc2d637d', '2022-12-08 09:51:51', '2022-12-08 01:51:51', 'nacos', '0:0:0:0:0:0:0:1', 'U', 'a298fe41-a0c0-4c3d-9e8a-91788bc646e4', '');
INSERT INTO `his_config_info` VALUES (4, 12, 'cloudalibaba-config-service-dev.yaml', 'devGroup', '', 'server:\n  port: 8002\n  servlet:\n    context-path: /api\n    \n#日志\n#logging:\n#  level:\n#    com.home: info\n#  file:\n#    name: test.log\n    \n#nacos配置\nspring:\n  application:\n  #应用名称\n    name: cloudalibaba-config-service\n  profiles:\n  #配置环境\n    active: dev\n  cloud:\n    nacos:\n      discovery: \n        # 服务注册地址\n        server-addr: 127.0.0.1:8848\n      config: \n        # 配置中心地址\n        server-addr: 127.0.0.1:8848\n        # 配置文件格式\n        file-extension: yaml  #后缀名\n        group: devGroup      #分组\n        namespace: a298fe41-a0c0-4c3d-9e8a-91788bc646e4  #命名空间的id\nconfig:\n  info: 666\n\n\n', 'd9ee02a94ef6c667598be3aec08cbebe', '2022-12-08 09:52:02', '2022-12-08 01:52:03', 'nacos', '0:0:0:0:0:0:0:1', 'U', 'a298fe41-a0c0-4c3d-9e8a-91788bc646e4', '');

-- ----------------------------
-- Table structure for permissions
-- ----------------------------
DROP TABLE IF EXISTS `permissions`;
CREATE TABLE `permissions`  (
  `role` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `resource` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `action` varchar(8) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  UNIQUE INDEX `uk_role_permission`(`role`, `resource`, `action`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for roles
-- ----------------------------
DROP TABLE IF EXISTS `roles`;
CREATE TABLE `roles`  (
  `username` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `role` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  UNIQUE INDEX `idx_user_role`(`username`, `role`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of roles
-- ----------------------------
INSERT INTO `roles` VALUES ('nacos', 'ROLE_ADMIN');

-- ----------------------------
-- Table structure for tenant_capacity
-- ----------------------------
DROP TABLE IF EXISTS `tenant_capacity`;
CREATE TABLE `tenant_capacity`  (
  `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `tenant_id` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT 'Tenant ID',
  `quota` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '配额,0表示使用默认值',
  `usage` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '使用量',
  `max_size` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '单个配置大小上限,单位为字节,0表示使用默认值',
  `max_aggr_count` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '聚合子配置最大个数',
  `max_aggr_size` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '单个聚合数据的子配置大小上限,单位为字节,0表示使用默认值',
  `max_history_count` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '最大变更历史数量',
  `gmt_create` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `gmt_modified` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `uk_tenant_id`(`tenant_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '租户容量信息表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for tenant_info
-- ----------------------------
DROP TABLE IF EXISTS `tenant_info`;
CREATE TABLE `tenant_info`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `kp` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'kp',
  `tenant_id` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT '' COMMENT 'tenant_id',
  `tenant_name` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT '' COMMENT 'tenant_name',
  `tenant_desc` varchar(256) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT 'tenant_desc',
  `create_source` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT 'create_source',
  `gmt_create` bigint(20) NOT NULL COMMENT '创建时间',
  `gmt_modified` bigint(20) NOT NULL COMMENT '修改时间',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `uk_tenant_info_kptenantid`(`kp`, `tenant_id`) USING BTREE,
  INDEX `idx_tenant_id`(`tenant_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = 'tenant_info' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of tenant_info
-- ----------------------------
INSERT INTO `tenant_info` VALUES (1, '1', 'a298fe41-a0c0-4c3d-9e8a-91788bc646e4', 'dazhi', '123456', 'nacos', 1670463623444, 1670463623444);

-- ----------------------------
-- Table structure for users
-- ----------------------------
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users`  (
  `username` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `password` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `enabled` tinyint(1) NOT NULL,
  PRIMARY KEY (`username`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of users
-- ----------------------------
INSERT INTO `users` VALUES ('nacos', '$2a$10$EuWPZHzz32dJN7jexM34MOeYirDdFAZm2kuWj7VEOJhhZkDrxfvUu', 1);

SET FOREIGN_KEY_CHECKS = 1;

linux下安装 

1.下载
docker pull nacos/nacos-server

#推荐使用这种方式,可以连接自己的数据库
# 创建 nacos 配置存放目录
mkdir -p /home/nacos/conf  && chown -R 200 /home/nacos/conf

# 创建 nacos 日志存放目录
mkdir -p /home/nacos/logs  && chown -R 200 /home/nacos/logs

# 创建 nacos 数据存放目录
mkdir -p /home/nacos/data  && chown -R 200 /home/nacos/data

--------------------启动一个最初级的--------- 
  

docker run -d -p 8848:8848 \
--name nacos \
--env MODE=standalone \
--env SPRING_DATASOURCE_PLATFORM=mysql \
--env MYSQL_SERVICE_HOST=152.136.145.72 \
--env MYSQL_SERVICE_PORT=3306 \
--env MYSQL_SERVICE_DB_NAME=nacos_config \
--env MYSQL_SERVICE_USER=root \
--env MYSQL_SERVICE_PASSWORD=171226zxY \
nacos/nacos-server:latest

//复制相关文件
# 把容器中的 nacos 文件复制出来
docker cp -a nacos:/home/nacos /home/docker/

# 删除 nacos 容器
docker rm -f nacos

//启动新的nacos,可以自定义配置
docker run -d -p 8848:8848 \
--name nacos \
--env MODE=standalone \
--env SPRING_DATASOURCE_PLATFORM=mysql \
--env MYSQL_SERVICE_HOST=152.136.145.72 \
--env MYSQL_SERVICE_PORT=3306 \
--env MYSQL_SERVICE_DB_NAME=nacos_config \
--env MYSQL_SERVICE_USER=root \
--env MYSQL_SERVICE_PASSWORD=171226zxY \
-v /home/docker/nacos/conf:/home/nacos/conf \
-v /home/docker/nacos/logs:/home/nacos/logs \
-v /home/docker/nacos/data:/home/nacos/data \
nacos/nacos-server:latest

//启动  内存2G的设备启动不起来
http://17.94.194.88:8848/nacos

windows下安装 

 

 修改数据库的配置

修改启动配置standalone

 启动nacos成功!进入http://localhost:8848/nacos账号密码都是nacos

新建命名空间

 作为配置中心

回滚,将配置文件回滚到这个版本

 添加配置,要注意Data ID和Group

 代码中的组合获取到

 如果想nocas修改完立即生效,Controller要加@RefreshScope

 JAVA项目中的配置

pom

<?xml version="1.0"?>
<project
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
	xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<modelVersion>4.0.0</modelVersion>
	<parent>
		<groupId>com.home</groupId>
		<artifactId>Home</artifactId>
		<version>0.0.1-SNAPSHOT</version>
	</parent>
	<artifactId>home-first</artifactId>
	<packaging>jar</packaging>
	
	<properties>
		<java.version>8</java.version>
		<maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
	</properties>
	
	<dependencies>
		<dependency>
	        <groupId>org.springframework.boot</groupId>
	        <artifactId>spring-boot-starter</artifactId>
	    </dependency>
	  	<dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
         <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
		<dependency>
			<groupId>org.springframework.cloud</groupId>
			<artifactId>spring-cloud-context</artifactId>
		</dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <scope>runtime</scope>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.junit.vintage</groupId>
                    <artifactId>junit-vintage-engine</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-pool2</artifactId>
        </dependency>
        <!--阿里json-->
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>fastjson</artifactId>
            <version>1.2.46</version>
        </dependency>
        
	    <!-- SpringCloud Ailibaba Nacos client  -->
		<dependency>
            <groupId>com.alibaba.cloud</groupId>
            <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
        </dependency>
        <!-- SpringCloud Ailibaba Nacos Config -->
        <dependency>
            <groupId>com.alibaba.cloud</groupId>
            <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
        </dependency>
        
		<dependency>
			<groupId>com.home</groupId>
			<artifactId>home-common</artifactId>
			<version>${home.version}</version>
		</dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<scope>test</scope>
		</dependency>
	</dependencies>
</project>

yml

 bootstrap.yml

spring:
  profiles:
    active: dev

bootstrap-dev.yml

server:
  port: 8002
  servlet:
    context-path: /api
    
#日志
#logging:
#  level:
#    com.home: info
#  file:
#    name: test.log
    
#nacos配置
spring:
  application:
  #应用名称
    name: cloudalibaba-config-service
  profiles:
  #配置环境
    active: dev
  cloud:
    nacos:
      discovery: 
        # 服务注册地址
        server-addr: 192.168.60.246:8848
        namespace: a298fe41-a0c0-4c3d-9e8a-91788bc646e4  #命名空间的id
        group: devGroup      #分组
      config: 
        # 配置中心地址
        server-addr: 192.168.60.246:8848
        # 配置文件格式
        file-extension: yaml  #后缀名
        group: devGroup      #分组
        namespace: a298fe41-a0c0-4c3d-9e8a-91788bc646e4  #命名空间的id
config:
  info: 111

 共享多个配置-shared-configs

server:
  port: 8099
  servlet:
    context-path: /bjjuli
    
#日志
#logging:
#  level:
#    com.home: info
#  file:
#    name: test.log
    
#nacos配置
spring:
  application:
  #应用名称
    name: order-server
  profiles:
  #配置环境
    active: dev
  cloud:
    nacos:
      discovery: 
        # 服务注册地址
        server-addr: 192.168.60.114:8848
        namespace: ef6fb30c-43a9-4292-b9a2-09eb500e73ab  #命名空间的id
        group: devGroup      #分组
      config: 
        # 配置中心地址
        server-addr: 192.168.60.114:8848
        prefix: ${spring.application.name}
        # 配置文件格式
        file-extension: yaml  #后缀名
        group: devGroup      #分组
        namespace: ef6fb30c-43a9-4292-b9a2-09eb500e73ab  #命名空间的id
        shared-configs:  #共享多个配置
          - data-id: server-all.yaml
            group: devGroup
            refresh: true #动态刷新配置开启
          - data-id: server-all2.yaml
            group: devGroup
            refresh: false #动态刷新配置关闭

代码

@RefreshScope  加这个配置会实时刷新nacos更新后的数据

 nacos更新后,项目就会收到更新的通知

@RestController
@RequestMapping("/test")
@RefreshScope
public class Test {

	public final static Logger Log = LoggerFactory.getLogger(Test.class);

	@Value("${config.info}")
	private String info;     //该属性值是从nacos配置中心拉取到的配置

	@GetMapping("/testConfig")
	public String testConfig(){
		return info;
	}

}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/72897.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

HyperMesh宝典 | 跟着老师学,你也可以做好二次开发

说到二次开发&#xff0c;你的脑海里是不是浮现出了“码农”两个字&#xff1f;有人可能会问&#xff0c;码农又是什么&#xff1f; 你是不是觉得二次开发这种码农干的事情感觉起来也太困难了吧&#xff1f; 其实有时候二次开发真的很简单&#xff0c;懂一点二次开发会让你的工…

机器学习中的数学原理——多项式回归

这个专栏主要是用来分享一下我在机器学习中的学习笔记及一些感悟&#xff0c;也希望对你的学习有帮助哦&#xff01;感兴趣的小伙伴欢迎私信或者评论区留言&#xff01;这一篇就更新一下《白话机器学习中的数学——多项式回归》&#xff01; 目录 一、什么多项式回归 二、算法…

Java#33(IO流)

目录 一.IO流 作用: (对于程序而言)用于读写数据(本地数据, 网络数据) 二.IO流体系 1.字节输出流 2.字节输入流 3.文件拷贝 3.字符集 字符流 字符输入流 字符输出流 缓冲流 转换流 序列化流 ​编辑反序列流 打印流 一.IO流 I: input O: output 流: 想流…

Linux下创建动态链接库与静态链接库

动态链接库 Linux下的动态链接库文件扩展名为so&#xff0c;可以用多个文件生成一个动态链接库。 在头文件中定义三个函数&#xff0c;三个函数分别于三个cpp文件中实现。 将三个cpp文件编译成动态库libdynamic.so -fPIC表示编译为位置独立的代码&#xff0c;如果不选择默…

使用YOLOv5练自己的数据集

说明 上次使用学习了如何运行yolov5检测自己的数据&#xff0c;这次学习yolov5如何训练自己的数据集 本次记录如何使用yolov5训练自己的数据集以及遇到报错解决方案 数据 使用数据&#xff1a;水果数据集 数据包含了png图片和相应的标注文件 切分数据 代码如下&#xff1…

[ vulhub漏洞复现篇 ] solr 远程命令执行(CVE-2019-0193)

&#x1f36c; 博主介绍 &#x1f468;‍&#x1f393; 博主介绍&#xff1a;大家好&#xff0c;我是 _PowerShell &#xff0c;很高兴认识大家~ ✨主攻领域&#xff1a;【渗透领域】【数据通信】 【通讯安全】 【web安全】【面试分析】 &#x1f389;点赞➕评论➕收藏 养成习…

Kubernetes的基础概念

一、Kubernetes的介绍 用于自动部署、扩展和管理"容器化&#xff08;containerized&#xff09;应用程序"的开源系统 可以理解成K8S是负责自动化运维管理多个容器化程序&#xff08;比如Docker&#xff09;的集群&#xff0c;是一个生态极其丰富的容器编排框架工具 …

【现场问题】zookeeper的集群,其中两台起来了,但是另外一台就是起不来,或者起来也是standalone

zookeeper问题现象集群的配置zookeeper的启动以及状态查看问题报错点问题现象 1、总共三台机器&#xff0c;node92&#xff0c;node93&#xff0c;node94 其中node92做了拉起&#xff0c;但是node93&#xff08;leader&#xff09;和node94&#xff08;follower&#xff09;&a…

浅谈MVVM ——Model-View-View-Model

浅谈MVVM ——Model-View-View-Model 前言&#xff1a; 笔者最近接到这样一个机器人项目&#xff0c;接入他们的机器人平台做二次开发&#xff0c;开发自己的opk移植到机器人上做医院展示使用。opk是必须使用机器人厂家提供的经过一定封装过的&#xff0c;该opk的架构是MVVM。…

48W字?GitHub上下载量破百万的阿里:图解Java、网络、算法笔记

Java基础这个东西&#xff0c;无论在哪个公司都被看得尤为重要&#xff0c;而面试中关于基础的问题也是层出不穷。所以基础可以说是重中之重&#xff0c;当你的基础打牢了&#xff0c;其他的也就没有那么重要了。 说到基础&#xff0c;无外乎操作系统&#xff0c;网络&#xf…

pikachu-CSRF-SSRF-RCE速通

pikachu-CSRF-SSRF-RCE速通 目录pikachu-CSRF-SSRF-RCE速通CSRFCSRF(get)CSRF(post)CSRF TokenSSRFSSRF(curl)SSRF(file_get_content)RCEexec "ping"RCE exec "eval"CSRF 跨站请求伪造&#xff0c;说的通俗一点就是攻击者构造出某个网站的数据包请求并部署…

p3.第一章 基础入门 -- Python编程基本概念 (三)

1.2.2 Python语言 1.2.2.1 Python发展 1989年圣诞节期间&#xff0c;为了打发无聊的时间&#xff0c;荷兰人Guido van Rossum&#xff08;吉多范罗苏姆&#xff09;&#xff08;数学、计算机双硕士&#xff0c;2005年加入Google&#xff0c;2013年加入DropBox&#xff09;&am…

JavaUUID的理解

可笑&#xff0c;你竟然不知道 Java 如何生成 UUID - 沉默王二博客 UUID是通用唯一标识符的意思&#xff0c;就是唯一不重复的一串字符。 UUID的用途&#xff1a; 随机生成的文件名&#xff1b;Java Web 应用程序的 sessionID&#xff1b;数据库表的主键&#xff1b;事务 ID&…

EMQ 助力阿里云洛神云网络构建新一代“亿级并发、百万级吞吐”NLB 网络型负载均衡系统

万物智联的数字化时代,我们正走在从“数据量变”到“连接质变”的道路上。在日益丰富的物联网应用场景中,实现海量设备与云端之间双向通信连接,分析并从中获得实时洞察成了打造成功物联网解决方案的核心推动因素。EMQ 映云科技(以下简称“EMQ”)作为全球领先的开源物联网基础设…

UE在TextRender上显示中文文本

文章目录 1.实现目标2.实现过程2.1 添加字体2.2 创建字体材质2.3 将字体应用到TextRender3.参考资料1.实现目标 UE的UMG可以正常支持中文,但是TextRender并不支持中文,因此需要添加本地离线中文字体库,使TextRender显示中文。 2.实现过程 2.1 添加字体 (1)选择User Int…

day6bom操作浏览器

apis-day6bom-操作浏览器 文章目录apis-day6bom-操作浏览器1、window对象1.1BOM(浏览器对象模型1.2定时器-延时函数1.3JS执行机制&#xff08;重要&#xff09;1.4 location对象1.5 navigator对象1.6histroy对象&#xff08;用的少&#xff09;2、swiper插件3、本地存储&#x…

当前的数字化,CIO 们到底需要什么?

“做数字化&#xff0c;没人、没钱、没资源&#xff0c;但还要做效果&#xff0c;该怎么办&#xff1f;” 这是很多 CIO 当下都面临的困境。 那么&#xff0c;对于不同企业来说&#xff0c;到底该如何有效探索数字化转型之路呢&#xff1f; 数字化转型的三个阶段 Gartner 把…

简易黑客初级教程:黑客技术,分享教学

前言 第一节&#xff0c;伸展运动。这节操我们要准备道具&#xff0c;俗话说&#xff1a;“工欲善其事&#xff0c;必先利其器”(是这样吗?哎!文化低……)说得有道理&#xff0c;我们要学习黑客技术&#xff0c;一点必要的工具必不可少。 1&#xff0c;一台属于自己的可以上…

【面试题】2023 中级前端面试题

前言 从前端学习到找一份合适的工作&#xff0c;大大小小的面试必不可少&#xff0c;所以我对初级前端面试题进行了初步整理&#xff0c;也方便自己查阅&#xff0c;也希望对小伙伴们有所帮助&#xff01; 给大家推荐一个实用面试题库 1、前端面试题库 &#xff08;面试必备&…

C语言——内存中数据存储的详解(整型与浮点型)

文章目录1.数据类型的详细介绍1.1数据类型介绍1.2类型的基本归类整型类型浮点类型构造类型指针类型空类型2.整型在内存中的存储2.1原码、反码、补码2.2大小端存储大小端存储存在的意义编写一个程序判断当前机器的存储方式是大端存储还是小端存储2.3经典习题练习一练习二练习三c…