本次实验环境准备用一台服务器模拟3台redis服务器,1主2从

主从集群搭建

第一步:安装Redis

安装Redis,参考前面安装Redis文章,保证单机使用没有问题。

第二步:配置服务器文件

定位到安装后的redis目录:cd /usr/local/redis

对单机的redis配置文件拷贝出3份出来

cp redis.conf  redis6381.conf

cp redis.conf  redis6382.conf

cp redis.conf  redis6383.conf

清空新拷贝的三份配置文件,命令为 “> 文件名”

[root@localhost redis]# > redis6381.conf

[root@localhost redis]# > redis6382.conf

[root@localhost redis]# > redis6383.conf

再对三份配置文件分别配置内容

6381端口的配置文件

include /usr/local/redis/redis.conf  #包含redis.conf文件
daemonize yes
port
pidfile /var/run/redis_6381.pid
logfile .log
dbfilename dump6381.rdb

6382端口的配置文件

include /usr/local/redis/redis.conf  #包含redis.conf文件
daemonize yes
port
pidfile /var/run/redis_6382.pid
logfile .log
dbfilename dump6382.rdb
slaveof 127.0.0.1 #说明是从属于6381端口的主机

6383端口的配置文件

include /usr/local/redis/redis.conf  #包含redis.conf文件
daemonize yes
port
pidfile /var/run/redis_6383.pid
logfile .log
dbfilename dump6383.rdb
slaveof 127.0.0.1 6381 #说明是从属于6381端口的主机

第三步:启动redis服务器

模拟启动三台redis服务器

[root@localhost redis]# ./bin/redis-server redis6381.conf
[root@localhost redis]# ./bin/redis-server redis6382.conf
[root@localhost redis]# ./bin/redis-server redis6383.conf

查看进程

[root@localhost redis]# ps -ef|grep redis
root      90648      1  0 17:17 ?        00:00:00 ./bin/redis-server 127.0.0.1:6381
root      90652      1  0 17:17 ?        00:00:00 ./bin/redis-server 127.0.0.1:6382
root      90657      1  1 17:17 ?        00:00:00 ./bin/redis-server 127.0.0.1:6383
root      90664   4536  0 17:17 pts/2    00:00:00 grep --color=auto redis

说明3台服务器已经启动成功,端口分别是指定的6381,6382,6383

第四步,客户端连接redis服务器

分别打开三个窗口,定位到redis目录:cd /usr/local/redis

通过客户端工具连接不同端口的服务器

如连接6381端口服务器

[root@localhost redis]# ./bin/redis-cli -p 6381

查看信息,如下:

127.0.0.1:6381> info replication

# Replication
role:master
connected_slaves:2
slave0:ip=127.0.0.1,port=6382,state=online,offset=253,lag=1
slave1:ip=127.0.0.1,port=6383,state=online,offset=253,lag=1
master_repl_offset:253
repl_backlog_active:1
repl_backlog_size:1048576
repl_backlog_first_byte_offset:2
repl_backlog_histlen:252

可以看到它是主服务器,我们在前面配置文件中指定它就是主服务器。

因为是主机,它可读可写,写的数据同步到从机。

写:

127.0.0.1:6381> set key1 v1
OK
127.0.0.1:6381> set key2 v2
OK

读:

127.0.0.1:6381> get key1
"v1"
127.0.0.1:6381> get key2
"v2"

如连接6382端口服务器
[root@localhost redis]# ./bin/redis-cli -p 6382

查看信息,如下:

127.0.0.1:6382> info replication
# Replication
role:slave
master_host:127.0.0.1
master_port:6381
master_link_status:up
master_last_io_seconds_ago:10
master_sync_in_progress:0
slave_repl_offset:883
slave_priority:100
slave_read_only:1
connected_slaves:0
master_repl_offset:0
repl_backlog_active:0
repl_backlog_size:1048576
repl_backlog_first_byte_offset:0
repl_backlog_histlen:0

可以看到,它是从服务器,我们在前面配置文件中指定它就是从服务器。

因为是从机,它只读不可写。数据只能从主机6381同步。

读:

127.0.0.1:6382> keys *
1) "key1"
2) "key2"
127.0.0.1:6382> get key2
"v2"

写:

127.0.0.1:6382> set key3 v3
(error) READONLY You can't write against a read only slave.

哨兵模式

配置哨兵配置文件

定位到redis的源文件目录,将哨兵配置文件sentinel.conf作为模板,拷贝出3份

[root@localhost local]# cd redis-3.2.9/

[root@localhost redis-3.2.9]# cp sentinel.conf  sentinel26381.conf
[root@localhost redis-3.2.9]# cp sentinel.conf  sentinel26382.conf
[root@localhost redis-3.2.9]# cp sentinel.conf  sentinel26383.conf

分别修改拷贝的配置文件

[root@localhost redis-3.2.9]# vim sentinel26381.conf

将哨兵的工作端口端口26379和监控的redis主机127.0.0.1 6379 2修改为自己定义的值

模板中的两处要被修改的地方:

port 26379

sentinel monitor mymaster 127.0.0.1 6379 2

我这里修改为该哨兵端口为26381,监控的redis主机为127.0.0.1 6381

port 26381

sentinel monitor mymaster 127.0.0.1 6381 2

其他两台哨兵配置文件也按照这样修改,只是哨兵的端口要不一样,监控的redis主机应该一样。

启动哨兵程序

分别打开3个窗口,定为到/usr/local/redis-3.2.9/src,找到redis-sentinel,配合上步的配置文件启动

注意需要3个窗口,因为这里是前台启动,需要看监控信息

[root@localhost src]# ./redis-sentinel ../sentinel26381.conf

[root@localhost src]# ./redis-sentinel ../sentinel26382.conf

[root@localhost src]# ./redis-sentinel ../sentinel26383.conf

等3台哨兵都启动成功以后,

分别查看监控信息,26381哨兵的监控信息,如下:

[root@localhost src]# ./redis-sentinel ../sentinel26381.conf
94744:X 01 Feb 18:29:03.171 * Increased maximum number of open files to 10032 (it was originally set to 1024).
                _._                                                  
           _.-``__ ''-._                                             
      _.-``    `.  `_.  ''-._           Redis 3.2.9 (00000000/0) 64 bit
  .-`` .-```.  ```\/    _.,_ ''-._                                   
 (    '      ,       .-`  | `,    )     Running in sentinel mode
 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 26381
 |    `-._   `._    /     _.-'    |     PID: 94744
  `-._    `-._  `-./  _.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |           http://redis.io        
  `-._    `-._`-.__.-'_.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |                                  
  `-._    `-._`-.__.-'_.-'    _.-'                                   
      `-._    `-.__.-'    _.-'                                       
          `-._        _.-'                                           
              `-.__.-'

94744:X 01 Feb 18:29:03.172 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
94744:X 01 Feb 18:29:03.174 # Sentinel ID is 9044885c3cd355b168a93bc68ed4c2b7c78ebca6
94744:X 01 Feb 18:29:03.174 # +monitor master mymaster 127.0.0.1 6381 quorum 2
94744:X 01 Feb 18:29:03.175 * +slave slave 127.0.0.1:6382 127.0.0.1 6382 @ mymaster 127.0.0.1 6381
94744:X 01 Feb 18:29:03.176 * +slave slave 127.0.0.1:6383 127.0.0.1 6383 @ mymaster 127.0.0.1 6381
/usr/local/redis-3.2.9/src/usr/local/redis-3.2.9/src94744:X 01 Feb 18:33:35.645 * +sentinel sentinel 7bc01d8db6cf93c5d1f9d0a146c9967c0c4b339b 127.0.0.1 26382 @ mymaster 127.0.0.1 6381
94744:X 01 Feb 18:34:08.801 * +sentinel sentinel 574de03c2a3e5ace4798af0df4945961398efdf1 127.0.0.1 26383 @ mymaster 127.0.0.1 6381

26382哨兵的监控信息,如下:

[root@localhost src]# ./redis-sentinel ../sentinel26382.conf
95009:X 01 Feb 18:33:33.626 * Increased maximum number of open files to 10032 (it was originally set to 1024).
                _._                                                  
           _.-``__ ''-._                                             
      _.-``    `.  `_.  ''-._           Redis 3.2.9 (00000000/0) 64 bit
  .-`` .-```.  ```\/    _.,_ ''-._                                   
 (    '      ,       .-`  | `,    )     Running in sentinel mode
 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 26382
 |    `-._   `._    /     _.-'    |     PID: 95009
  `-._    `-._  `-./  _.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |           http://redis.io        
  `-._    `-._`-.__.-'_.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |                                  
  `-._    `-._`-.__.-'_.-'    _.-'                                   
      `-._    `-.__.-'    _.-'                                       
          `-._        _.-'                                           
              `-.__.-'

95009:X 01 Feb 18:33:33.627 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
95009:X 01 Feb 18:33:33.648 # Sentinel ID is 7bc01d8db6cf93c5d1f9d0a146c9967c0c4b339b
95009:X 01 Feb 18:33:33.648 # +monitor master mymaster 127.0.0.1 6381 quorum 2
95009:X 01 Feb 18:33:33.649 * +slave slave 127.0.0.1:6382 127.0.0.1 6382 @ mymaster 127.0.0.1 6381
95009:X 01 Feb 18:33:33.651 * +slave slave 127.0.0.1:6383 127.0.0.1 6383 @ mymaster 127.0.0.1 6381
95009:X 01 Feb 18:33:34.651 * +sentinel sentinel 9044885c3cd355b168a93bc68ed4c2b7c78ebca6 127.0.0.1 26381 @ mymaster 127.0.0.1 6381
95009:X 01 Feb 18:34:08.801 * +sentinel sentinel 574de03c2a3e5ace4798af0df4945961398efdf1 127.0.0.1 26383 @ mymaster 127.0.0.1 6381

26383哨兵的监控信息,如下:

[root@localhost src]# ./redis-sentinel ../sentinel26383.conf
95097:X 01 Feb 18:34:06.716 * Increased maximum number of open files to 10032 (it was originally set to 1024).
                _._                                                  
           _.-``__ ''-._                                             
      _.-``    `.  `_.  ''-._           Redis 3.2.9 (00000000/0) 64 bit
  .-`` .-```.  ```\/    _.,_ ''-._                                   
 (    '      ,       .-`  | `,    )     Running in sentinel mode
 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 26383
 |    `-._   `._    /     _.-'    |     PID: 95097
  `-._    `-._  `-./  _.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |           http://redis.io        
  `-._    `-._`-.__.-'_.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |                                  
  `-._    `-._`-.__.-'_.-'    _.-'                                   
      `-._    `-.__.-'    _.-'                                       
          `-._        _.-'                                           
              `-.__.-'

95097:X 01 Feb 18:34:06.717 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
95097:X 01 Feb 18:34:06.719 # Sentinel ID is 574de03c2a3e5ace4798af0df4945961398efdf1
95097:X 01 Feb 18:34:06.719 # +monitor master mymaster 127.0.0.1 6381 quorum 2
95097:X 01 Feb 18:34:06.719 * +slave slave 127.0.0.1:6382 127.0.0.1 6382 @ mymaster 127.0.0.1 6381
95097:X 01 Feb 18:34:06.721 * +slave slave 127.0.0.1:6383 127.0.0.1 6383 @ mymaster 127.0.0.1 6381
95097:X 01 Feb 18:34:07.784 * +sentinel sentinel 9044885c3cd355b168a93bc68ed4c2b7c78ebca6 127.0.0.1 26381 @ mymaster 127.0.0.1 6381
95097:X 01 Feb 18:34:08.425 * +sentinel sentinel 7bc01d8db6cf93c5d1f9d0a146c9967c0c4b339b 127.0.0.1 26382 @ mymaster 127.0.0.1 6381

 模拟故障,让主从自动切换

主动让redis的主服务器6381关掉,模拟主机挂机的状况

127.0.0.1:6381> shutdown

观看哨兵服务器,会发现以下信息

[root@localhost src]# ./redis-sentinel ../sentinel26382.conf
95009:X 01 Feb 18:33:33.626 * Increased maximum number of open files to 10032 (it was originally set to 1024).
                _._                                                  
           _.-``__ ''-._                                             
      _.-``    `.  `_.  ''-._           Redis 3.2.9 (00000000/0) 64 bit
  .-`` .-```.  ```\/    _.,_ ''-._                                   
 (    '      ,       .-`  | `,    )     Running in sentinel mode
 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 26382
 |    `-._   `._    /     _.-'    |     PID: 95009
  `-._    `-._  `-./  _.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |           http://redis.io        
  `-._    `-._`-.__.-'_.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |                                  
  `-._    `-._`-.__.-'_.-'    _.-'                                   
      `-._    `-.__.-'    _.-'                                       
          `-._        _.-'                                           
              `-.__.-'

95009:X 01 Feb 18:33:33.627 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
95009:X 01 Feb 18:33:33.648 # Sentinel ID is 7bc01d8db6cf93c5d1f9d0a146c9967c0c4b339b
95009:X 01 Feb 18:33:33.648 # +monitor master mymaster 127.0.0.1 6381 quorum 2
95009:X 01 Feb 18:33:33.649 * +slave slave 127.0.0.1:6382 127.0.0.1 6382 @ mymaster 127.0.0.1 6381
95009:X 01 Feb 18:33:33.651 * +slave slave 127.0.0.1:6383 127.0.0.1 6383 @ mymaster 127.0.0.1 6381
95009:X 01 Feb 18:33:34.651 * +sentinel sentinel 9044885c3cd355b168a93bc68ed4c2b7c78ebca6 127.0.0.1 26381 @ mymaster 127.0.0.1 6381
95009:X 01 Feb 18:34:08.801 * +sentinel sentinel 574de03c2a3e5ace4798af0df4945961398efdf1 127.0.0.1 26383 @ mymaster 127.0.0.1 6381
95009:X 01 Feb 18:59:42.232 # +sdown master mymaster 127.0.0.1 6381
95009:X 01 Feb 18:59:42.316 # +odown master mymaster 127.0.0.1 6381 #quorum 2/2
95009:X 01 Feb 18:59:42.316 # +new-epoch 1
95009:X 01 Feb 18:59:42.316 # +try-failover master mymaster 127.0.0.1 6381
95009:X 01 Feb 18:59:42.325 # +vote-for-leader 7bc01d8db6cf93c5d1f9d0a146c9967c0c4b339b 1
95009:X 01 Feb 18:59:42.363 # 9044885c3cd355b168a93bc68ed4c2b7c78ebca6 voted for 7bc01d8db6cf93c5d1f9d0a146c9967c0c4b339b 1
95009:X 01 Feb 18:59:42.363 # 574de03c2a3e5ace4798af0df4945961398efdf1 voted for 7bc01d8db6cf93c5d1f9d0a146c9967c0c4b339b 1
95009:X 01 Feb 18:59:42.379 # +elected-leader master mymaster 127.0.0.1 6381
95009:X 01 Feb 18:59:42.379 # +failover-state-select-slave master mymaster 127.0.0.1 6381
95009:X 01 Feb 18:59:42.470 # +selected-slave slave 127.0.0.1:6383 127.0.0.1 6383 @ mymaster 127.0.0.1 6381
95009:X 01 Feb 18:59:42.470 * +failover-state-send-slaveof-noone slave 127.0.0.1:6383 127.0.0.1 6383 @ mymaster 127.0.0.1 6381
95009:X 01 Feb 18:59:42.522 * +failover-state-wait-promotion slave 127.0.0.1:6383 127.0.0.1 6383 @ mymaster 127.0.0.1 6381
95009:X 01 Feb 18:59:43.315 # +promoted-slave slave 127.0.0.1:6383 127.0.0.1 6383 @ mymaster 127.0.0.1 6381
95009:X 01 Feb 18:59:43.315 # +failover-state-reconf-slaves master mymaster 127.0.0.1 6381
95009:X 01 Feb 18:59:43.376 * +slave-reconf-sent slave 127.0.0.1:6382 127.0.0.1 6382 @ mymaster 127.0.0.1 6381
95009:X 01 Feb 18:59:44.363 * +slave-reconf-inprog slave 127.0.0.1:6382 127.0.0.1 6382 @ mymaster 127.0.0.1 6381
95009:X 01 Feb 18:59:44.363 * +slave-reconf-done slave 127.0.0.1:6382 127.0.0.1 6382 @ mymaster 127.0.0.1 6381
95009:X 01 Feb 18:59:44.422 # +failover-end master mymaster 127.0.0.1 6381
95009:X 01 Feb 18:59:44.422 # +switch-master mymaster 127.0.0.1 6381 127.0.0.1 6383
95009:X 01 Feb 18:59:44.422 * +slave slave 127.0.0.1:6382 127.0.0.1 6382 @ mymaster 127.0.0.1 6383
95009:X 01 Feb 18:59:44.422 * +slave slave 127.0.0.1:6381 127.0.0.1 6381 @ mymaster 127.0.0.1 6383
95009:X 01 Feb 19:00:14.465 # +sdown slave 127.0.0.1:6381 127.0.0.1 6381 @ mymaster 127.0.0.1 6383

说明集群的主服务器已经切换到了6383上,即原来的从机6383变为了主机

我们去看一下6383的信息

127.0.0.1:6383>  info replication
# Replication
role:master
connected_slaves:1
slave0:ip=127.0.0.1,port=6382,state=online,offset=19848,lag=1
master_repl_offset:19981
repl_backlog_active:1
repl_backlog_size:1048576
repl_backlog_first_byte_offset:2
repl_backlog_histlen:19980

确实角色为master,它下面挂载一台从机6382

它现在升级为主机,所以可以读写,验证如下:

127.0.0.1:6383> set key5 v5
OK
127.0.0.1:6383> get key5
"v5"

再去看下一6382从机的信息

127.0.0.1:6382> info replication
# Replication
role:slave
master_host:127.0.0.1
master_port:6383
master_link_status:up
master_last_io_seconds_ago:0
master_sync_in_progress:0
slave_repl_offset:17440
slave_priority:100
slave_read_only:1
connected_slaves:0
master_repl_offset:0
repl_backlog_active:0
repl_backlog_size:1048576
repl_backlog_first_byte_offset:0
repl_backlog_histlen:0

说明它确实从属的主机为6383

它还是只能读,数据只能从主机同步

127.0.0.1:6382> set key6 v6
(error) READONLY You can't write against a read only slave.
127.0.0.1:6382> get key5
"v5"

假设原来的6381服务器已经恢复正常了,我们来启动它

可以看到,6381启动后,自动变为了从机,主机还是后来的6383,说明原来的主机恢复后,不会恢复它原来的地位。

因为它已经是从机,所以只能读,不能写

再看主服务器6383的信息,它已经有两个从机了,6381是后来恢复后自动挂载上的

哨兵服务器26381上看到对应的自动挂载信息

哨兵服务器26382上看到对应的自动挂载信息

哨兵服务器26383上看到对应的自动挂载信息

Redis主从集群及哨兵模式的更多相关文章

  1. 一、全新安装搭建redis主从集群

    前言· 这里分为三篇文章来写我是如何重新搭建redis主从集群和哨兵集群的及原本服务器上有单redis如何通过升级脚本来实现redis集群.(redis结构:主-从(备)-从(备)) 至于为什么要搭建 ...

  2. Redis 主从集群搭建及哨兵模式配置

    最近搭建了redis集群及哨兵模式,为方便以后查看特此记录下来: 1.Redis安装 2.主从架构 2.1 Redis主从架构图 2.2Redis主从结构搭建 Redis集群不用安装多个Redis,只 ...

  3. (六) Docker 部署 Redis 高可用集群 (sentinel 哨兵模式)

    参考并感谢 官方文档 https://hub.docker.com/_/redis GitHub https://github.com/antirez/redis happyJared https:/ ...

  4. docker搭建redis主从集群和sentinel哨兵集群,springboot客户端连接

    花了两天搭建redis主从集群和sentinel哨兵集群,讲一下springboot客户端连接测试情况 redis主从集群 从网上查看说是有两种方式:一种是指定配置文件,一种是不指定配置文件 引用地址 ...

  5. Redis主从架构搭建和哨兵模式(四)

    一主一从,往主节点去写,在从节点去读,可以读到,主从架构就搭建成功了 1.启用复制,部署slave node wget http://downloads.sourceforge.net/tcl/tcl ...

  6. 02.Redis主从集群的Sentinel配置

    1.集群环境 1.Linux服务器列表 使用4台CentOS Linux服务器搭建环境,其IP地址如下: 192.168.110.100 192.168.110.101 192.168.110.102 ...

  7. redis集群之哨兵模式【原】

    redis集群之哨兵(sentinel)模式 哨兵模式理想状态 需要>=3个redis服务,>=3个redis哨兵,每个redis服务搭配一个哨兵. 本例以3个redis服务为例: 一开始 ...

  8. redis集群sentinel哨兵模式的搭建与实际应用

    参考资料:https://blog.csdn.net/men_wen/article/details/72724406 之前环境使用的keepalived+redis vip集群模式,现在我们服务切换 ...

  9. Redis 3.2.3: 集群3哨兵模式

    简介 Redis是一个使用ANSI C编写的开源.支持网络.基于内存.可选持久性的键值对存储数据库.从2015年6月开始,Redis的开发由Redis Labs赞助,而2013年5月至2015年6月期 ...

随机推荐

  1. FreeRadius+GoogleAuthenticator实现linux动态口令认证

    简介 在运维管理中,服务器的密码管理十分重要.服务器数量少的时候还好说,可以定时来改密码.一旦数量多了,再来改密码就不现实了. 前提 我们假定运维访问服务器是这样的: 创建一个普通用户用于登录服务器, ...

  2. 我的第二本译作《精通OpenStack》上架啦:前言、目录和样章

    1. 前言 今天,随着新功能和子项目的增加,OpenStack已成为一个不断扩展的大型开源项目.随着数以百计大型企业采用并不断为OpenStack生态系统做出贡献,OpenStack必将成为下一代私有 ...

  3. python之路——21

    复习 1.序列化:数据类型转换成字符串的过程 为了方便存储和网络传输2.序列化模块: 1.json 1.dumps 2.loads 3.dump 和文件相关 4.load 不能load多次 2.pic ...

  4. mybatis关于ORM的使用以及设计(一)[ORM的初始化]

    ORM WIKI中的解释.画重点 Object-relational mapping (ORM, O/RM, and O/R mapping tool) in computer science is ...

  5. EXT 获取gird各值

    var cellclick = function (item, td, cellIndex, record, tr, rowIndex, e) { //[ListenerArgument(0, &qu ...

  6. 使用 ping++做支付的流程

    获取支付凭据 /// <summary> /// 获取支付凭据 /// </summary> /// <param name="model">& ...

  7. 巨坑– 膜BWV543

    我不是一个喜欢膜别人的人,我从来都不擅长去夸奖.当面对巴赫的作品时,我发现我的敬佩难以用语言表达.我决定用另一种方式来表达我的欣赏,那就是分析并背下这个谱子. http://music.163.com ...

  8. WPF常用TriggerAction用法 (一)

    Microsoft.Expression.Interactivity 常用TriggerAction-> CallMethodAction ChangePropertyAction Contro ...

  9. sqlserver 使用脚本创建作业

    --[作业常用的几个步骤] EXEC msdb.dbo.sp_delete_job EXEC msdb.dbo.sp_add_job EXEC msdb.dbo.sp_add_jobstep EXEC ...

  10. Postman 设置全局变量和环境变量设置(之 图形界面设置变量)

    在Postman中有两种方法添加变量:1.图形界面操作添加   2.执行代码添加 1.图形界面操作添加,点击右上角齿轮按钮手动添加所需测试环境:   2.点击右上角的小眼睛可以编辑.添加“全局变量”和 ...