Redis服务器是当下比较流行的缓存服务器,Redis通常被人拿来和Memcached进行对比。在我看来,应当是各具优势吧,虽然应用场景基本类似,但总会根据项目的不同来进行不通的选用。

我们今天主要讲Redis在windows平台下的安装和部署。进入正题->

一、单机部署使用Redis

1、下载Redis,我选用的是当下的最新版本3.2.0 地址在这里https://github.com/MSOpenTech/redis/releases

下载好之后,直接解压到任意位置,我存放在了 D:\Program Files\Redis-x64-3.2.100

2、运行cmd命令启动Redis服务。

redis-server.exe redis.windows.conf

这里需要注意的是一定要带后面的启动参数,如果对配置文件修改完没有带启动参数并不会生效的,所以一定记得带参数。

这样服务就算启动成功了,这个窗口是服务终端,如果窗口被关闭,对应的服务也会停止。

3、继续cmd命令启动客户端。

客户端连接服务成功。

4、设置和获取数据操作。

使用Set命令存入一个数据。

用Get命令获取数据。

至此,我们简单地redis安装部署并存入数据命令操作已经概括完毕。

二、分布式部署Redis

windows下我们如果想让其他ip地址的用户也能访问到我们的Redis服务,那么就需要对Redis文件夹下的redis.windows.conf进行配置。

  1. # Redis configuration file example
  2.  
  3. # Note on units: when memory size is needed, it is possible to specify
  4. # it in the usual form of 1k 5GB 4M and so forth:
  5. #
  6. # 1k => 1000 bytes
  7. # 1kb => 1024 bytes
  8. # 1m => 1000000 bytes
  9. # 1mb => 1024*1024 bytes
  10. # 1g => 1000000000 bytes
  11. # 1gb => 1024*1024*1024 bytes
  12. #
  13. # units are case insensitive so 1GB 1Gb 1gB are all the same.
  14.  
  15. ################################## INCLUDES ###################################
  16.  
  17. # Include one or more other config files here. This is useful if you
  18. # have a standard template that goes to all Redis servers but also need
  19. # to customize a few per-server settings. Include files can include
  20. # other files, so use this wisely.
  21. #
  22. # Notice option "include" won't be rewritten by command "CONFIG REWRITE"
  23. # from admin or Redis Sentinel. Since Redis always uses the last processed
  24. # line as value of a configuration directive, you'd better put includes
  25. # at the beginning of this file to avoid overwriting config change at runtime.
  26. #
  27. # If instead you are interested in using includes to override configuration
  28. # options, it is better to use include as the last line.
  29. #
  30. # include .\path\to\local.conf
  31. # include c:\path\to\other.conf
  32.  
  33. ################################## NETWORK #####################################
  34.  
  35. # By default, if no "bind" configuration directive is specified, Redis listens
  36. # for connections from all the network interfaces available on the server.
  37. # It is possible to listen to just one or multiple selected interfaces using
  38. # the "bind" configuration directive, followed by one or more IP addresses.
  39. #
  40. # Examples:
  41. #
  42. # bind 192.168.1.100 10.0.0.1
  43. # bind 127.0.0.1 ::1
  44. #
  45. # ~~~ WARNING ~~~ If the computer running Redis is directly exposed to the
  46. # internet, binding to all the interfaces is dangerous and will expose the
  47. # instance to everybody on the internet. So by default we uncomment the
  48. # following bind directive, that will force Redis to listen only into
  49. # the IPv4 lookback interface address (this means Redis will be able to
  50. # accept connections only from clients running into the same computer it
  51. # is running).
  52. #
  53. # IF YOU ARE SURE YOU WANT YOUR INSTANCE TO LISTEN TO ALL THE INTERFACES
  54. # JUST COMMENT THE FOLLOWING LINE.
  55. # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  56. #bind 127.0.0.1 #qixiao annotation
  57. #qixiao add
  58. bind 0.0.0.0
  59.  
  60. # Protected mode is a layer of security protection, in order to avoid that
  61. # Redis instances left open on the internet are accessed and exploited.
  62. #
  63. # When protected mode is on and if:
  64. #
  65. # 1) The server is not binding explicitly to a set of addresses using the
  66. # "bind" directive.
  67. # 2) No password is configured.
  68. #
  69. # The server only accepts connections from clients connecting from the
  70. # IPv4 and IPv6 loopback addresses 127.0.0.1 and ::1, and from Unix domain
  71. # sockets.
  72. #
  73. # By default protected mode is enabled. You should disable it only if
  74. # you are sure you want clients from other hosts to connect to Redis
  75. # even if no authentication is configured, nor a specific set of interfaces
  76. # are explicitly listed using the "bind" directive.
  77. #protected-mode yes #qixiao annotation
  78. #qixiao add
  79. protected-mode no
  80.  
  81. # Accept connections on the specified port, default is 6379 (IANA #815344).
  82. # If port 0 is specified Redis will not listen on a TCP socket.
  83. port 6379
  84.  
  85. # TCP listen() backlog.
  86. #
  87. # In high requests-per-second environments you need an high backlog in order
  88. # to avoid slow clients connections issues. Note that the Linux kernel
  89. # will silently truncate it to the value of /proc/sys/net/core/somaxconn so
  90. # make sure to raise both the value of somaxconn and tcp_max_syn_backlog
  91. # in order to get the desired effect.
  92. tcp-backlog 511
  93.  
  94. # Unix socket.
  95. #
  96. # Specify the path for the Unix socket that will be used to listen for
  97. # incoming connections. There is no default, so Redis will not listen
  98. # on a unix socket when not specified.
  99. #
  100. # unixsocket /tmp/redis.sock
  101. # unixsocketperm 700
  102.  
  103. # Close the connection after a client is idle for N seconds (0 to disable)
  104. timeout 0
  105.  
  106. # TCP keepalive.
  107. #
  108. # If non-zero, use SO_KEEPALIVE to send TCP ACKs to clients in absence
  109. # of communication. This is useful for two reasons:
  110. #
  111. # 1) Detect dead peers.
  112. # 2) Take the connection alive from the point of view of network
  113. # equipment in the middle.
  114. #
  115. # On Linux, the specified value (in seconds) is the period used to send ACKs.
  116. # Note that to close the connection the double of the time is needed.
  117. # On other kernels the period depends on the kernel configuration.
  118. #
  119. # A reasonable value for this option is 60 seconds.
  120. tcp-keepalive 0
  121.  
  122. ################################# GENERAL #####################################
  123.  
  124. # By default Redis does not run as a daemon. Use 'yes' if you need it.
  125. # Note that Redis will write a pid file in /var/run/redis.pid when daemonized.
  126. # NOT SUPPORTED ON WINDOWS daemonize no
  127.  
  128. # If you run Redis from upstart or systemd, Redis can interact with your
  129. # supervision tree. Options:
  130. # supervised no - no supervision interaction
  131. # supervised upstart - signal upstart by putting Redis into SIGSTOP mode
  132. # supervised systemd - signal systemd by writing READY=1 to $NOTIFY_SOCKET
  133. # supervised auto - detect upstart or systemd method based on
  134. # UPSTART_JOB or NOTIFY_SOCKET environment variables
  135. # Note: these supervision methods only signal "process is ready."
  136. # They do not enable continuous liveness pings back to your supervisor.
  137. # NOT SUPPORTED ON WINDOWS supervised no
  138.  
  139. # If a pid file is specified, Redis writes it where specified at startup
  140. # and removes it at exit.
  141. #
  142. # When the server runs non daemonized, no pid file is created if none is
  143. # specified in the configuration. When the server is daemonized, the pid file
  144. # is used even if not specified, defaulting to "/var/run/redis.pid".
  145. #
  146. # Creating a pid file is best effort: if Redis is not able to create it
  147. # nothing bad happens, the server will start and run normally.
  148. # NOT SUPPORTED ON WINDOWS pidfile /var/run/redis.pid
  149.  
  150. # Specify the server verbosity level.
  151. # This can be one of:
  152. # debug (a lot of information, useful for development/testing)
  153. # verbose (many rarely useful info, but not a mess like the debug level)
  154. # notice (moderately verbose, what you want in production probably)
  155. # warning (only very important / critical messages are logged)
  156. loglevel notice
  157.  
  158. # Specify the log file name. Also 'stdout' can be used to force
  159. # Redis to log on the standard output.
  160. logfile ""
  161.  
  162. # To enable logging to the Windows EventLog, just set 'syslog-enabled' to
  163. # yes, and optionally update the other syslog parameters to suit your needs.
  164. # If Redis is installed and launched as a Windows Service, this will
  165. # automatically be enabled.
  166. # syslog-enabled no
  167.  
  168. # Specify the source name of the events in the Windows Application log.
  169. # syslog-ident redis
  170.  
  171. # Set the number of databases. The default database is DB 0, you can select
  172. # a different one on a per-connection basis using SELECT <dbid> where
  173. # dbid is a number between 0 and 'databases'-1
  174. databases 16
  175.  
  176. ################################ SNAPSHOTTING ################################
  177. #
  178. # Save the DB on disk:
  179. #
  180. # save <seconds> <changes>
  181. #
  182. # Will save the DB if both the given number of seconds and the given
  183. # number of write operations against the DB occurred.
  184. #
  185. # In the example below the behaviour will be to save:
  186. # after 900 sec (15 min) if at least 1 key changed
  187. # after 300 sec (5 min) if at least 10 keys changed
  188. # after 60 sec if at least 10000 keys changed
  189. #
  190. # Note: you can disable saving completely by commenting out all "save" lines.
  191. #
  192. # It is also possible to remove all the previously configured save
  193. # points by adding a save directive with a single empty string argument
  194. # like in the following example:
  195. #
  196. # save ""
  197.  
  198. save 900 1
  199. save 300 10
  200. save 60 10000
  201.  
  202. # By default Redis will stop accepting writes if RDB snapshots are enabled
  203. # (at least one save point) and the latest background save failed.
  204. # This will make the user aware (in a hard way) that data is not persisting
  205. # on disk properly, otherwise chances are that no one will notice and some
  206. # disaster will happen.
  207. #
  208. # If the background saving process will start working again Redis will
  209. # automatically allow writes again.
  210. #
  211. # However if you have setup your proper monitoring of the Redis server
  212. # and persistence, you may want to disable this feature so that Redis will
  213. # continue to work as usual even if there are problems with disk,
  214. # permissions, and so forth.
  215. stop-writes-on-bgsave-error yes
  216.  
  217. # Compress string objects using LZF when dump .rdb databases?
  218. # For default that's set to 'yes' as it's almost always a win.
  219. # If you want to save some CPU in the saving child set it to 'no' but
  220. # the dataset will likely be bigger if you have compressible values or keys.
  221. rdbcompression yes
  222.  
  223. # Since version 5 of RDB a CRC64 checksum is placed at the end of the file.
  224. # This makes the format more resistant to corruption but there is a performance
  225. # hit to pay (around 10%) when saving and loading RDB files, so you can disable it
  226. # for maximum performances.
  227. #
  228. # RDB files created with checksum disabled have a checksum of zero that will
  229. # tell the loading code to skip the check.
  230. rdbchecksum yes
  231.  
  232. # The filename where to dump the DB
  233. dbfilename dump.rdb
  234.  
  235. # The working directory.
  236. #
  237. # The DB will be written inside this directory, with the filename specified
  238. # above using the 'dbfilename' configuration directive.
  239. #
  240. # The Append Only File will also be created inside this directory.
  241. #
  242. # Note that you must specify a directory here, not a file name.
  243. dir ./
  244.  
  245. ################################# REPLICATION #################################
  246.  
  247. # Master-Slave replication. Use slaveof to make a Redis instance a copy of
  248. # another Redis server. A few things to understand ASAP about Redis replication.
  249. #
  250. # 1) Redis replication is asynchronous, but you can configure a master to
  251. # stop accepting writes if it appears to be not connected with at least
  252. # a given number of slaves.
  253. # 2) Redis slaves are able to perform a partial resynchronization with the
  254. # master if the replication link is lost for a relatively small amount of
  255. # time. You may want to configure the replication backlog size (see the next
  256. # sections of this file) with a sensible value depending on your needs.
  257. # 3) Replication is automatic and does not need user intervention. After a
  258. # network partition slaves automatically try to reconnect to masters
  259. # and resynchronize with them.
  260. #
  261. # slaveof <masterip> <masterport>
  262.  
  263. # If the master is password protected (using the "requirepass" configuration
  264. # directive below) it is possible to tell the slave to authenticate before
  265. # starting the replication synchronization process, otherwise the master will
  266. # refuse the slave request.
  267. #
  268. # masterauth <master-password>
  269.  
  270. # When a slave loses its connection with the master, or when the replication
  271. # is still in progress, the slave can act in two different ways:
  272. #
  273. # 1) if slave-serve-stale-data is set to 'yes' (the default) the slave will
  274. # still reply to client requests, possibly with out of date data, or the
  275. # data set may just be empty if this is the first synchronization.
  276. #
  277. # 2) if slave-serve-stale-data is set to 'no' the slave will reply with
  278. # an error "SYNC with master in progress" to all the kind of commands
  279. # but to INFO and SLAVEOF.
  280. #
  281. slave-serve-stale-data yes
  282.  
  283. # You can configure a slave instance to accept writes or not. Writing against
  284. # a slave instance may be useful to store some ephemeral data (because data
  285. # written on a slave will be easily deleted after resync with the master) but
  286. # may also cause problems if clients are writing to it because of a
  287. # misconfiguration.
  288. #
  289. # Since Redis 2.6 by default slaves are read-only.
  290. #
  291. # Note: read only slaves are not designed to be exposed to untrusted clients
  292. # on the internet. It's just a protection layer against misuse of the instance.
  293. # Still a read only slave exports by default all the administrative commands
  294. # such as CONFIG, DEBUG, and so forth. To a limited extent you can improve
  295. # security of read only slaves using 'rename-command' to shadow all the
  296. # administrative / dangerous commands.
  297. slave-read-only yes
  298.  
  299. # Replication SYNC strategy: disk or socket.
  300. #
  301. # -------------------------------------------------------
  302. # WARNING: DISKLESS REPLICATION IS EXPERIMENTAL CURRENTLY
  303. # -------------------------------------------------------
  304. #
  305. # New slaves and reconnecting slaves that are not able to continue the replication
  306. # process just receiving differences, need to do what is called a "full
  307. # synchronization". An RDB file is transmitted from the master to the slaves.
  308. # The transmission can happen in two different ways:
  309. #
  310. # 1) Disk-backed: The Redis master creates a new process that writes the RDB
  311. # file on disk. Later the file is transferred by the parent
  312. # process to the slaves incrementally.
  313. # 2) Diskless: The Redis master creates a new process that directly writes the
  314. # RDB file to slave sockets, without touching the disk at all.
  315. #
  316. # With disk-backed replication, while the RDB file is generated, more slaves
  317. # can be queued and served with the RDB file as soon as the current child producing
  318. # the RDB file finishes its work. With diskless replication instead once
  319. # the transfer starts, new slaves arriving will be queued and a new transfer
  320. # will start when the current one terminates.
  321. #
  322. # When diskless replication is used, the master waits a configurable amount of
  323. # time (in seconds) before starting the transfer in the hope that multiple slaves
  324. # will arrive and the transfer can be parallelized.
  325. #
  326. # With slow disks and fast (large bandwidth) networks, diskless replication
  327. # works better.
  328. repl-diskless-sync no
  329.  
  330. # When diskless replication is enabled, it is possible to configure the delay
  331. # the server waits in order to spawn the child that transfers the RDB via socket
  332. # to the slaves.
  333. #
  334. # This is important since once the transfer starts, it is not possible to serve
  335. # new slaves arriving, that will be queued for the next RDB transfer, so the server
  336. # waits a delay in order to let more slaves arrive.
  337. #
  338. # The delay is specified in seconds, and by default is 5 seconds. To disable
  339. # it entirely just set it to 0 seconds and the transfer will start ASAP.
  340. repl-diskless-sync-delay 5
  341.  
  342. # Slaves send PINGs to server in a predefined interval. It's possible to change
  343. # this interval with the repl_ping_slave_period option. The default value is 10
  344. # seconds.
  345. #
  346. # repl-ping-slave-period 10
  347.  
  348. # The following option sets the replication timeout for:
  349. #
  350. # 1) Bulk transfer I/O during SYNC, from the point of view of slave.
  351. # 2) Master timeout from the point of view of slaves (data, pings).
  352. # 3) Slave timeout from the point of view of masters (REPLCONF ACK pings).
  353. #
  354. # It is important to make sure that this value is greater than the value
  355. # specified for repl-ping-slave-period otherwise a timeout will be detected
  356. # every time there is low traffic between the master and the slave.
  357. #
  358. # repl-timeout 60
  359.  
  360. # Disable TCP_NODELAY on the slave socket after SYNC?
  361. #
  362. # If you select "yes" Redis will use a smaller number of TCP packets and
  363. # less bandwidth to send data to slaves. But this can add a delay for
  364. # the data to appear on the slave side, up to 40 milliseconds with
  365. # Linux kernels using a default configuration.
  366. #
  367. # If you select "no" the delay for data to appear on the slave side will
  368. # be reduced but more bandwidth will be used for replication.
  369. #
  370. # By default we optimize for low latency, but in very high traffic conditions
  371. # or when the master and slaves are many hops away, turning this to "yes" may
  372. # be a good idea.
  373. repl-disable-tcp-nodelay no
  374.  
  375. # Set the replication backlog size. The backlog is a buffer that accumulates
  376. # slave data when slaves are disconnected for some time, so that when a slave
  377. # wants to reconnect again, often a full resync is not needed, but a partial
  378. # resync is enough, just passing the portion of data the slave missed while
  379. # disconnected.
  380. #
  381. # The bigger the replication backlog, the longer the time the slave can be
  382. # disconnected and later be able to perform a partial resynchronization.
  383. #
  384. # The backlog is only allocated once there is at least a slave connected.
  385. #
  386. # repl-backlog-size 1mb
  387.  
  388. # After a master has no longer connected slaves for some time, the backlog
  389. # will be freed. The following option configures the amount of seconds that
  390. # need to elapse, starting from the time the last slave disconnected, for
  391. # the backlog buffer to be freed.
  392. #
  393. # A value of 0 means to never release the backlog.
  394. #
  395. # repl-backlog-ttl 3600
  396.  
  397. # The slave priority is an integer number published by Redis in the INFO output.
  398. # It is used by Redis Sentinel in order to select a slave to promote into a
  399. # master if the master is no longer working correctly.
  400. #
  401. # A slave with a low priority number is considered better for promotion, so
  402. # for instance if there are three slaves with priority 10, 100, 25 Sentinel will
  403. # pick the one with priority 10, that is the lowest.
  404. #
  405. # However a special priority of 0 marks the slave as not able to perform the
  406. # role of master, so a slave with priority of 0 will never be selected by
  407. # Redis Sentinel for promotion.
  408. #
  409. # By default the priority is 100.
  410. slave-priority 100
  411.  
  412. # It is possible for a master to stop accepting writes if there are less than
  413. # N slaves connected, having a lag less or equal than M seconds.
  414. #
  415. # The N slaves need to be in "online" state.
  416. #
  417. # The lag in seconds, that must be <= the specified value, is calculated from
  418. # the last ping received from the slave, that is usually sent every second.
  419. #
  420. # This option does not GUARANTEE that N replicas will accept the write, but
  421. # will limit the window of exposure for lost writes in case not enough slaves
  422. # are available, to the specified number of seconds.
  423. #
  424. # For example to require at least 3 slaves with a lag <= 10 seconds use:
  425. #
  426. # min-slaves-to-write 3
  427. # min-slaves-max-lag 10
  428. #
  429. # Setting one or the other to 0 disables the feature.
  430. #
  431. # By default min-slaves-to-write is set to 0 (feature disabled) and
  432. # min-slaves-max-lag is set to 10.
  433.  
  434. ################################## SECURITY ###################################
  435.  
  436. # Require clients to issue AUTH <PASSWORD> before processing any other
  437. # commands. This might be useful in environments in which you do not trust
  438. # others with access to the host running redis-server.
  439. #
  440. # This should stay commented out for backward compatibility and because most
  441. # people do not need auth (e.g. they run their own servers).
  442. #
  443. # Warning: since Redis is pretty fast an outside user can try up to
  444. # 150k passwords per second against a good box. This means that you should
  445. # use a very strong password otherwise it will be very easy to break.
  446. #
  447. # requirepass foobared
  448.  
  449. # Command renaming.
  450. #
  451. # It is possible to change the name of dangerous commands in a shared
  452. # environment. For instance the CONFIG command may be renamed into something
  453. # hard to guess so that it will still be available for internal-use tools
  454. # but not available for general clients.
  455. #
  456. # Example:
  457. #
  458. # rename-command CONFIG b840fc02d524045429941cc15f59e41cb7be6c52
  459. #
  460. # It is also possible to completely kill a command by renaming it into
  461. # an empty string:
  462. #
  463. # rename-command CONFIG ""
  464. #
  465. # Please note that changing the name of commands that are logged into the
  466. # AOF file or transmitted to slaves may cause problems.
  467.  
  468. ################################### LIMITS ####################################
  469.  
  470. # Set the max number of connected clients at the same time. By default
  471. # this limit is set to 10000 clients, however if the Redis server is not
  472. # able to configure the process file limit to allow for the specified limit
  473. # the max number of allowed clients is set to the current file limit
  474. # minus 32 (as Redis reserves a few file descriptors for internal uses).
  475. #
  476. # Once the limit is reached Redis will close all the new connections sending
  477. # an error 'max number of clients reached'.
  478. #
  479. # maxclients 10000
  480.  
  481. # If Redis is to be used as an in-memory-only cache without any kind of
  482. # persistence, then the fork() mechanism used by the background AOF/RDB
  483. # persistence is unnecessary. As an optimization, all persistence can be
  484. # turned off in the Windows version of Redis. This will redirect heap
  485. # allocations to the system heap allocator, and disable commands that would
  486. # otherwise cause fork() operations: BGSAVE and BGREWRITEAOF.
  487. # This flag may not be combined with any of the other flags that configure
  488. # AOF and RDB operations.
  489. # persistence-available [(yes)|no]
  490.  
  491. # Don't use more memory than the specified amount of bytes.
  492. # When the memory limit is reached Redis will try to remove keys
  493. # according to the eviction policy selected (see maxmemory-policy).
  494. #
  495. # If Redis can't remove keys according to the policy, or if the policy is
  496. # set to 'noeviction', Redis will start to reply with errors to commands
  497. # that would use more memory, like SET, LPUSH, and so on, and will continue
  498. # to reply to read-only commands like GET.
  499. #
  500. # This option is usually useful when using Redis as an LRU cache, or to set
  501. # a hard memory limit for an instance (using the 'noeviction' policy).
  502. #
  503. # WARNING: If you have slaves attached to an instance with maxmemory on,
  504. # the size of the output buffers needed to feed the slaves are subtracted
  505. # from the used memory count, so that network problems / resyncs will
  506. # not trigger a loop where keys are evicted, and in turn the output
  507. # buffer of slaves is full with DELs of keys evicted triggering the deletion
  508. # of more keys, and so forth until the database is completely emptied.
  509. #
  510. # In short... if you have slaves attached it is suggested that you set a lower
  511. # limit for maxmemory so that there is some free RAM on the system for slave
  512. # output buffers (but this is not needed if the policy is 'noeviction').
  513. #
  514. # WARNING: not setting maxmemory will cause Redis to terminate with an
  515. # out-of-memory exception if the heap limit is reached.
  516. #
  517. # NOTE: since Redis uses the system paging file to allocate the heap memory,
  518. # the Working Set memory usage showed by the Windows Task Manager or by other
  519. # tools such as ProcessExplorer will not always be accurate. For example, right
  520. # after a background save of the RDB or the AOF files, the working set value
  521. # may drop significantly. In order to check the correct amount of memory used
  522. # by the redis-server to store the data, use the INFO client command. The INFO
  523. # command shows only the memory used to store the redis data, not the extra
  524. # memory used by the Windows process for its own requirements. Th3 extra amount
  525. # of memory not reported by the INFO command can be calculated subtracting the
  526. # Peak Working Set reported by the Windows Task Manager and the used_memory_peak
  527. # reported by the INFO command.
  528. #
  529. # maxmemory <bytes>
  530.  
  531. # MAXMEMORY POLICY: how Redis will select what to remove when maxmemory
  532. # is reached. You can select among five behaviors:
  533. #
  534. # volatile-lru -> remove the key with an expire set using an LRU algorithm
  535. # allkeys-lru -> remove any key according to the LRU algorithm
  536. # volatile-random -> remove a random key with an expire set
  537. # allkeys-random -> remove a random key, any key
  538. # volatile-ttl -> remove the key with the nearest expire time (minor TTL)
  539. # noeviction -> don't expire at all, just return an error on write operations
  540. #
  541. # Note: with any of the above policies, Redis will return an error on write
  542. # operations, when there are no suitable keys for eviction.
  543. #
  544. # At the date of writing these commands are: set setnx setex append
  545. # incr decr rpush lpush rpushx lpushx linsert lset rpoplpush sadd
  546. # sinter sinterstore sunion sunionstore sdiff sdiffstore zadd zincrby
  547. # zunionstore zinterstore hset hsetnx hmset hincrby incrby decrby
  548. # getset mset msetnx exec sort
  549. #
  550. # The default is:
  551. #
  552. # maxmemory-policy noeviction
  553.  
  554. # LRU and minimal TTL algorithms are not precise algorithms but approximated
  555. # algorithms (in order to save memory), so you can tune it for speed or
  556. # accuracy. For default Redis will check five keys and pick the one that was
  557. # used less recently, you can change the sample size using the following
  558. # configuration directive.
  559. #
  560. # The default of 5 produces good enough results. 10 Approximates very closely
  561. # true LRU but costs a bit more CPU. 3 is very fast but not very accurate.
  562. #
  563. # maxmemory-samples 5
  564.  
  565. ############################## APPEND ONLY MODE ###############################
  566.  
  567. # By default Redis asynchronously dumps the dataset on disk. This mode is
  568. # good enough in many applications, but an issue with the Redis process or
  569. # a power outage may result into a few minutes of writes lost (depending on
  570. # the configured save points).
  571. #
  572. # The Append Only File is an alternative persistence mode that provides
  573. # much better durability. For instance using the default data fsync policy
  574. # (see later in the config file) Redis can lose just one second of writes in a
  575. # dramatic event like a server power outage, or a single write if something
  576. # wrong with the Redis process itself happens, but the operating system is
  577. # still running correctly.
  578. #
  579. # AOF and RDB persistence can be enabled at the same time without problems.
  580. # If the AOF is enabled on startup Redis will load the AOF, that is the file
  581. # with the better durability guarantees.
  582. #
  583. # Please check http://redis.io/topics/persistence for more information.
  584.  
  585. appendonly no
  586.  
  587. # The name of the append only file (default: "appendonly.aof")
  588. appendfilename "appendonly.aof"
  589.  
  590. # The fsync() call tells the Operating System to actually write data on disk
  591. # instead of waiting for more data in the output buffer. Some OS will really flush
  592. # data on disk, some other OS will just try to do it ASAP.
  593. #
  594. # Redis supports three different modes:
  595. #
  596. # no: don't fsync, just let the OS flush the data when it wants. Faster.
  597. # always: fsync after every write to the append only log. Slow, Safest.
  598. # everysec: fsync only one time every second. Compromise.
  599. #
  600. # The default is "everysec", as that's usually the right compromise between
  601. # speed and data safety. It's up to you to understand if you can relax this to
  602. # "no" that will let the operating system flush the output buffer when
  603. # it wants, for better performances (but if you can live with the idea of
  604. # some data loss consider the default persistence mode that's snapshotting),
  605. # or on the contrary, use "always" that's very slow but a bit safer than
  606. # everysec.
  607. #
  608. # More details please check the following article:
  609. # http://antirez.com/post/redis-persistence-demystified.html
  610. #
  611. # If unsure, use "everysec".
  612.  
  613. # appendfsync always
  614. appendfsync everysec
  615. # appendfsync no
  616.  
  617. # When the AOF fsync policy is set to always or everysec, and a background
  618. # saving process (a background save or AOF log background rewriting) is
  619. # performing a lot of I/O against the disk, in some Linux configurations
  620. # Redis may block too long on the fsync() call. Note that there is no fix for
  621. # this currently, as even performing fsync in a different thread will block
  622. # our synchronous write(2) call.
  623. #
  624. # In order to mitigate this problem it's possible to use the following option
  625. # that will prevent fsync() from being called in the main process while a
  626. # BGSAVE or BGREWRITEAOF is in progress.
  627. #
  628. # This means that while another child is saving, the durability of Redis is
  629. # the same as "appendfsync none". In practical terms, this means that it is
  630. # possible to lose up to 30 seconds of log in the worst scenario (with the
  631. # default Linux settings).
  632. #
  633. # If you have latency problems turn this to "yes". Otherwise leave it as
  634. # "no" that is the safest pick from the point of view of durability.
  635. no-appendfsync-on-rewrite no
  636.  
  637. # Automatic rewrite of the append only file.
  638. # Redis is able to automatically rewrite the log file implicitly calling
  639. # BGREWRITEAOF when the AOF log size grows by the specified percentage.
  640. #
  641. # This is how it works: Redis remembers the size of the AOF file after the
  642. # latest rewrite (if no rewrite has happened since the restart, the size of
  643. # the AOF at startup is used).
  644. #
  645. # This base size is compared to the current size. If the current size is
  646. # bigger than the specified percentage, the rewrite is triggered. Also
  647. # you need to specify a minimal size for the AOF file to be rewritten, this
  648. # is useful to avoid rewriting the AOF file even if the percentage increase
  649. # is reached but it is still pretty small.
  650. #
  651. # Specify a percentage of zero in order to disable the automatic AOF
  652. # rewrite feature.
  653.  
  654. auto-aof-rewrite-percentage 100
  655. auto-aof-rewrite-min-size 64mb
  656.  
  657. # An AOF file may be found to be truncated at the end during the Redis
  658. # startup process, when the AOF data gets loaded back into memory.
  659. # This may happen when the system where Redis is running
  660. # crashes, especially when an ext4 filesystem is mounted without the
  661. # data=ordered option (however this can't happen when Redis itself
  662. # crashes or aborts but the operating system still works correctly).
  663. #
  664. # Redis can either exit with an error when this happens, or load as much
  665. # data as possible (the default now) and start if the AOF file is found
  666. # to be truncated at the end. The following option controls this behavior.
  667. #
  668. # If aof-load-truncated is set to yes, a truncated AOF file is loaded and
  669. # the Redis server starts emitting a log to inform the user of the event.
  670. # Otherwise if the option is set to no, the server aborts with an error
  671. # and refuses to start. When the option is set to no, the user requires
  672. # to fix the AOF file using the "redis-check-aof" utility before to restart
  673. # the server.
  674. #
  675. # Note that if the AOF file will be found to be corrupted in the middle
  676. # the server will still exit with an error. This option only applies when
  677. # Redis will try to read more data from the AOF file but not enough bytes
  678. # will be found.
  679. aof-load-truncated yes
  680.  
  681. ################################ LUA SCRIPTING ###############################
  682.  
  683. # Max execution time of a Lua script in milliseconds.
  684. #
  685. # If the maximum execution time is reached Redis will log that a script is
  686. # still in execution after the maximum allowed time and will start to
  687. # reply to queries with an error.
  688. #
  689. # When a long running script exceeds the maximum execution time only the
  690. # SCRIPT KILL and SHUTDOWN NOSAVE commands are available. The first can be
  691. # used to stop a script that did not yet called write commands. The second
  692. # is the only way to shut down the server in the case a write command was
  693. # already issued by the script but the user doesn't want to wait for the natural
  694. # termination of the script.
  695. #
  696. # Set it to 0 or a negative value for unlimited execution without warnings.
  697. lua-time-limit 5000
  698.  
  699. ################################ REDIS CLUSTER ###############################
  700. #
  701. # ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  702. # WARNING EXPERIMENTAL: Redis Cluster is considered to be stable code, however
  703. # in order to mark it as "mature" we need to wait for a non trivial percentage
  704. # of users to deploy it in production.
  705. # ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  706. #
  707. # Normal Redis instances can't be part of a Redis Cluster; only nodes that are
  708. # started as cluster nodes can. In order to start a Redis instance as a
  709. # cluster node enable the cluster support uncommenting the following:
  710. #
  711. # cluster-enabled yes
  712.  
  713. # Every cluster node has a cluster configuration file. This file is not
  714. # intended to be edited by hand. It is created and updated by Redis nodes.
  715. # Every Redis Cluster node requires a different cluster configuration file.
  716. # Make sure that instances running in the same system do not have
  717. # overlapping cluster configuration file names.
  718. #
  719. # cluster-config-file nodes-6379.conf
  720.  
  721. # Cluster node timeout is the amount of milliseconds a node must be unreachable
  722. # for it to be considered in failure state.
  723. # Most other internal time limits are multiple of the node timeout.
  724. #
  725. # cluster-node-timeout 15000
  726.  
  727. # A slave of a failing master will avoid to start a failover if its data
  728. # looks too old.
  729. #
  730. # There is no simple way for a slave to actually have a exact measure of
  731. # its "data age", so the following two checks are performed:
  732. #
  733. # 1) If there are multiple slaves able to failover, they exchange messages
  734. # in order to try to give an advantage to the slave with the best
  735. # replication offset (more data from the master processed).
  736. # Slaves will try to get their rank by offset, and apply to the start
  737. # of the failover a delay proportional to their rank.
  738. #
  739. # 2) Every single slave computes the time of the last interaction with
  740. # its master. This can be the last ping or command received (if the master
  741. # is still in the "connected" state), or the time that elapsed since the
  742. # disconnection with the master (if the replication link is currently down).
  743. # If the last interaction is too old, the slave will not try to failover
  744. # at all.
  745. #
  746. # The point "2" can be tuned by user. Specifically a slave will not perform
  747. # the failover if, since the last interaction with the master, the time
  748. # elapsed is greater than:
  749. #
  750. # (node-timeout * slave-validity-factor) + repl-ping-slave-period
  751. #
  752. # So for example if node-timeout is 30 seconds, and the slave-validity-factor
  753. # is 10, and assuming a default repl-ping-slave-period of 10 seconds, the
  754. # slave will not try to failover if it was not able to talk with the master
  755. # for longer than 310 seconds.
  756. #
  757. # A large slave-validity-factor may allow slaves with too old data to failover
  758. # a master, while a too small value may prevent the cluster from being able to
  759. # elect a slave at all.
  760. #
  761. # For maximum availability, it is possible to set the slave-validity-factor
  762. # to a value of 0, which means, that slaves will always try to failover the
  763. # master regardless of the last time they interacted with the master.
  764. # (However they'll always try to apply a delay proportional to their
  765. # offset rank).
  766. #
  767. # Zero is the only value able to guarantee that when all the partitions heal
  768. # the cluster will always be able to continue.
  769. #
  770. # cluster-slave-validity-factor 10
  771.  
  772. # Cluster slaves are able to migrate to orphaned masters, that are masters
  773. # that are left without working slaves. This improves the cluster ability
  774. # to resist to failures as otherwise an orphaned master can't be failed over
  775. # in case of failure if it has no working slaves.
  776. #
  777. # Slaves migrate to orphaned masters only if there are still at least a
  778. # given number of other working slaves for their old master. This number
  779. # is the "migration barrier". A migration barrier of 1 means that a slave
  780. # will migrate only if there is at least 1 other working slave for its master
  781. # and so forth. It usually reflects the number of slaves you want for every
  782. # master in your cluster.
  783. #
  784. # Default is 1 (slaves migrate only if their masters remain with at least
  785. # one slave). To disable migration just set it to a very large value.
  786. # A value of 0 can be set but is useful only for debugging and dangerous
  787. # in production.
  788. #
  789. # cluster-migration-barrier 1
  790.  
  791. # By default Redis Cluster nodes stop accepting queries if they detect there
  792. # is at least an hash slot uncovered (no available node is serving it).
  793. # This way if the cluster is partially down (for example a range of hash slots
  794. # are no longer covered) all the cluster becomes, eventually, unavailable.
  795. # It automatically returns available as soon as all the slots are covered again.
  796. #
  797. # However sometimes you want the subset of the cluster which is working,
  798. # to continue to accept queries for the part of the key space that is still
  799. # covered. In order to do so, just set the cluster-require-full-coverage
  800. # option to no.
  801. #
  802. # cluster-require-full-coverage yes
  803.  
  804. # In order to setup your cluster make sure to read the documentation
  805. # available at http://redis.io web site.
  806.  
  807. ################################## SLOW LOG ###################################
  808.  
  809. # The Redis Slow Log is a system to log queries that exceeded a specified
  810. # execution time. The execution time does not include the I/O operations
  811. # like talking with the client, sending the reply and so forth,
  812. # but just the time needed to actually execute the command (this is the only
  813. # stage of command execution where the thread is blocked and can not serve
  814. # other requests in the meantime).
  815. #
  816. # You can configure the slow log with two parameters: one tells Redis
  817. # what is the execution time, in microseconds, to exceed in order for the
  818. # command to get logged, and the other parameter is the length of the
  819. # slow log. When a new command is logged the oldest one is removed from the
  820. # queue of logged commands.
  821.  
  822. # The following time is expressed in microseconds, so 1000000 is equivalent
  823. # to one second. Note that a negative number disables the slow log, while
  824. # a value of zero forces the logging of every command.
  825. slowlog-log-slower-than 10000
  826.  
  827. # There is no limit to this length. Just be aware that it will consume memory.
  828. # You can reclaim memory used by the slow log with SLOWLOG RESET.
  829. slowlog-max-len 128
  830.  
  831. ################################ LATENCY MONITOR ##############################
  832.  
  833. # The Redis latency monitoring subsystem samples different operations
  834. # at runtime in order to collect data related to possible sources of
  835. # latency of a Redis instance.
  836. #
  837. # Via the LATENCY command this information is available to the user that can
  838. # print graphs and obtain reports.
  839. #
  840. # The system only logs operations that were performed in a time equal or
  841. # greater than the amount of milliseconds specified via the
  842. # latency-monitor-threshold configuration directive. When its value is set
  843. # to zero, the latency monitor is turned off.
  844. #
  845. # By default latency monitoring is disabled since it is mostly not needed
  846. # if you don't have latency issues, and collecting data has a performance
  847. # impact, that while very small, can be measured under big load. Latency
  848. # monitoring can easily be enabled at runtime using the command
  849. # "CONFIG SET latency-monitor-threshold <milliseconds>" if needed.
  850. latency-monitor-threshold 0
  851.  
  852. ############################# EVENT NOTIFICATION ##############################
  853.  
  854. # Redis can notify Pub/Sub clients about events happening in the key space.
  855. # This feature is documented at http://redis.io/topics/notifications
  856. #
  857. # For instance if keyspace events notification is enabled, and a client
  858. # performs a DEL operation on key "foo" stored in the Database 0, two
  859. # messages will be published via Pub/Sub:
  860. #
  861. # PUBLISH __keyspace@0__:foo del
  862. # PUBLISH __keyevent@0__:del foo
  863. #
  864. # It is possible to select the events that Redis will notify among a set
  865. # of classes. Every class is identified by a single character:
  866. #
  867. # K Keyspace events, published with __keyspace@<db>__ prefix.
  868. # E Keyevent events, published with __keyevent@<db>__ prefix.
  869. # g Generic commands (non-type specific) like DEL, EXPIRE, RENAME, ...
  870. # $ String commands
  871. # l List commands
  872. # s Set commands
  873. # h Hash commands
  874. # z Sorted set commands
  875. # x Expired events (events generated every time a key expires)
  876. # e Evicted events (events generated when a key is evicted for maxmemory)
  877. # A Alias for g$lshzxe, so that the "AKE" string means all the events.
  878. #
  879. # The "notify-keyspace-events" takes as argument a string that is composed
  880. # of zero or multiple characters. The empty string means that notifications
  881. # are disabled.
  882. #
  883. # Example: to enable list and generic events, from the point of view of the
  884. # event name, use:
  885. #
  886. # notify-keyspace-events Elg
  887. #
  888. # Example 2: to get the stream of the expired keys subscribing to channel
  889. # name __keyevent@0__:expired use:
  890. #
  891. # notify-keyspace-events Ex
  892. #
  893. # By default all notifications are disabled because most users don't need
  894. # this feature and the feature has some overhead. Note that if you don't
  895. # specify at least one of K or E, no events will be delivered.
  896. notify-keyspace-events ""
  897.  
  898. ############################### ADVANCED CONFIG ###############################
  899.  
  900. # Hashes are encoded using a memory efficient data structure when they have a
  901. # small number of entries, and the biggest entry does not exceed a given
  902. # threshold. These thresholds can be configured using the following directives.
  903. hash-max-ziplist-entries 512
  904. hash-max-ziplist-value 64
  905.  
  906. # Lists are also encoded in a special way to save a lot of space.
  907. # The number of entries allowed per internal list node can be specified
  908. # as a fixed maximum size or a maximum number of elements.
  909. # For a fixed maximum size, use -5 through -1, meaning:
  910. # -5: max size: 64 Kb <-- not recommended for normal workloads
  911. # -4: max size: 32 Kb <-- not recommended
  912. # -3: max size: 16 Kb <-- probably not recommended
  913. # -2: max size: 8 Kb <-- good
  914. # -1: max size: 4 Kb <-- good
  915. # Positive numbers mean store up to _exactly_ that number of elements
  916. # per list node.
  917. # The highest performing option is usually -2 (8 Kb size) or -1 (4 Kb size),
  918. # but if your use case is unique, adjust the settings as necessary.
  919. list-max-ziplist-size -2
  920.  
  921. # Lists may also be compressed.
  922. # Compress depth is the number of quicklist ziplist nodes from *each* side of
  923. # the list to *exclude* from compression. The head and tail of the list
  924. # are always uncompressed for fast push/pop operations. Settings are:
  925. # 0: disable all list compression
  926. # 1: depth 1 means "don't start compressing until after 1 node into the list,
  927. # going from either the head or tail"
  928. # So: [head]->node->node->...->node->[tail]
  929. # [head], [tail] will always be uncompressed; inner nodes will compress.
  930. # 2: [head]->[next]->node->node->...->node->[prev]->[tail]
  931. # 2 here means: don't compress head or head->next or tail->prev or tail,
  932. # but compress all nodes between them.
  933. # 3: [head]->[next]->[next]->node->node->...->node->[prev]->[prev]->[tail]
  934. # etc.
  935. list-compress-depth 0
  936.  
  937. # Sets have a special encoding in just one case: when a set is composed
  938. # of just strings that happen to be integers in radix 10 in the range
  939. # of 64 bit signed integers.
  940. # The following configuration setting sets the limit in the size of the
  941. # set in order to use this special memory saving encoding.
  942. set-max-intset-entries 512
  943.  
  944. # Similarly to hashes and lists, sorted sets are also specially encoded in
  945. # order to save a lot of space. This encoding is only used when the length and
  946. # elements of a sorted set are below the following limits:
  947. zset-max-ziplist-entries 128
  948. zset-max-ziplist-value 64
  949.  
  950. # HyperLogLog sparse representation bytes limit. The limit includes the
  951. # 16 bytes header. When an HyperLogLog using the sparse representation crosses
  952. # this limit, it is converted into the dense representation.
  953. #
  954. # A value greater than 16000 is totally useless, since at that point the
  955. # dense representation is more memory efficient.
  956. #
  957. # The suggested value is ~ 3000 in order to have the benefits of
  958. # the space efficient encoding without slowing down too much PFADD,
  959. # which is O(N) with the sparse encoding. The value can be raised to
  960. # ~ 10000 when CPU is not a concern, but space is, and the data set is
  961. # composed of many HyperLogLogs with cardinality in the 0 - 15000 range.
  962. hll-sparse-max-bytes 3000
  963.  
  964. # Active rehashing uses 1 millisecond every 100 milliseconds of CPU time in
  965. # order to help rehashing the main Redis hash table (the one mapping top-level
  966. # keys to values). The hash table implementation Redis uses (see dict.c)
  967. # performs a lazy rehashing: the more operation you run into a hash table
  968. # that is rehashing, the more rehashing "steps" are performed, so if the
  969. # server is idle the rehashing is never complete and some more memory is used
  970. # by the hash table.
  971. #
  972. # The default is to use this millisecond 10 times every second in order to
  973. # actively rehash the main dictionaries, freeing memory when possible.
  974. #
  975. # If unsure:
  976. # use "activerehashing no" if you have hard latency requirements and it is
  977. # not a good thing in your environment that Redis can reply from time to time
  978. # to queries with 2 milliseconds delay.
  979. #
  980. # use "activerehashing yes" if you don't have such hard requirements but
  981. # want to free memory asap when possible.
  982. activerehashing yes
  983.  
  984. # The client output buffer limits can be used to force disconnection of clients
  985. # that are not reading data from the server fast enough for some reason (a
  986. # common reason is that a Pub/Sub client can't consume messages as fast as the
  987. # publisher can produce them).
  988. #
  989. # The limit can be set differently for the three different classes of clients:
  990. #
  991. # normal -> normal clients including MONITOR clients
  992. # slave -> slave clients
  993. # pubsub -> clients subscribed to at least one pubsub channel or pattern
  994. #
  995. # The syntax of every client-output-buffer-limit directive is the following:
  996. #
  997. # client-output-buffer-limit <class> <hard limit> <soft limit> <soft seconds>
  998. #
  999. # A client is immediately disconnected once the hard limit is reached, or if
  1000. # the soft limit is reached and remains reached for the specified number of
  1001. # seconds (continuously).
  1002. # So for instance if the hard limit is 32 megabytes and the soft limit is
  1003. # 16 megabytes / 10 seconds, the client will get disconnected immediately
  1004. # if the size of the output buffers reach 32 megabytes, but will also get
  1005. # disconnected if the client reaches 16 megabytes and continuously overcomes
  1006. # the limit for 10 seconds.
  1007. #
  1008. # By default normal clients are not limited because they don't receive data
  1009. # without asking (in a push way), but just after a request, so only
  1010. # asynchronous clients may create a scenario where data is requested faster
  1011. # than it can read.
  1012. #
  1013. # Instead there is a default limit for pubsub and slave clients, since
  1014. # subscribers and slaves receive data in a push fashion.
  1015. #
  1016. # Both the hard or the soft limit can be disabled by setting them to zero.
  1017. client-output-buffer-limit normal 0 0 0
  1018. client-output-buffer-limit slave 256mb 64mb 60
  1019. client-output-buffer-limit pubsub 32mb 8mb 60
  1020.  
  1021. # Redis calls an internal function to perform many background tasks, like
  1022. # closing connections of clients in timeot, purging expired keys that are
  1023. # never requested, and so forth.
  1024. #
  1025. # Not all tasks are perforemd with the same frequency, but Redis checks for
  1026. # tasks to perform according to the specified "hz" value.
  1027. #
  1028. # By default "hz" is set to 10. Raising the value will use more CPU when
  1029. # Redis is idle, but at the same time will make Redis more responsive when
  1030. # there are many keys expiring at the same time, and timeouts may be
  1031. # handled with more precision.
  1032. #
  1033. # The range is between 1 and 500, however a value over 100 is usually not
  1034. # a good idea. Most users should use the default of 10 and raise this up to
  1035. # 100 only in environments where very low latency is required.
  1036. hz 10
  1037.  
  1038. # When a child rewrites the AOF file, if the following option is enabled
  1039. # the file will be fsync-ed every 32 MB of data generated. This is useful
  1040. # in order to commit the file to the disk more incrementally and avoid
  1041. # big latency spikes.
  1042. aof-rewrite-incremental-fsync yes
  1043.  
  1044. ################################## INCLUDES ###################################
  1045.  
  1046. # Include one or more other config files here. This is useful if you
  1047. # have a standard template that goes to all Redis server but also need
  1048. # to customize a few per-server settings. Include files can include
  1049. # other files, so use this wisely.
  1050. #
  1051. # include /path/to/local.conf
  1052. # include /path/to/other.conf

将绑定设置成 bind 0.0.0.0 然后将保护模式关闭,重新启动服务器。

远程用客户端尝试登录redis客户端, 正常情况是可以访问的。当然了,我们这样配置的redis存在很大的安全漏洞,留作Redis的后续研究。

至此,我们的windows平台下的Redis安装部署及分布式配置已经进行完毕。

Windows下搭建Redis服务器的更多相关文章

  1. Windows下 搭建redis集群

    Windows下搭建redis集群教程 一,redis集群介绍 Redis cluster(redis集群)是在版本3.0后才支持的架构,和其他集群一样,都是为了解决单台服务器不够用的情况,也防止了主 ...

  2. windows 下搭建git服务器,及问题处理。

    最近要做一个源码管理服务器,权衡了一下还是git最适合,搭建服务器前看了网上一些windows下搭建git服务器的帖子,感觉还比较简单,没有太多需要配置的地方,于是开始动手. 我选择的是 gitfor ...

  3. windows下搭建nginx-rtmp服务器

    windows下搭建nginx-rtmp服务器 windows下搭建nginx-rtmp服务器 准备工作 安装MinGW 安装Mercurial 安装strawberryperl 安装nasm 下载n ...

  4. 怎样在Windows本地搭建redis服务器

    1.下载最新redis       https://github.com/MicrosoftArchive/redis/releases 2.解压如果是mis 版本直接下一步下一步即可 3.接下来我们 ...

  5. Windows下搭建Git 服务器: BONOBO GIT SERVER + TortoiseGit

    本文将介绍如何在Windows操作系统下搭建Git服务器和客户端.服务器端采用的是Bonobo Git Server,一款用ASP.NET MVC开发的Git源代码管理工具,界面简洁,基于Web方式配 ...

  6. Windows下搭建Redis集群

    Redis集群: 如果部署到多台电脑,就跟普通的集群一样:因为Redis是单线程处理的,多核CPU也只能使用一个核, 所以部署在同一台电脑上,通过运行多个Redis实例组成集群,然后能提高CPU的利用 ...

  7. Redis集群搭建(转自一菲聪天的“Windows下搭建Redis集群”)

    配置Redis参考:http://blog.csdn.net/zsg88/article/details/73715947 使用Ruby配置集群参考:https://www.cnblogs.com/t ...

  8. Redis → Windows下搭建redis集群

    一,redis集群介绍 Redis cluster(redis集群)是在版本3.0后才支持的架构,和其他集群一样,都是为了解决单台服务器不够用的情况,也防止了主服务器宕机无备用服务器,多个节点网络互联 ...

  9. Windows下搭建FTP服务器

    一.什么是ftp? FTP 是File Transfer Protocol(文件传输协议)的英文简称,而中文简称为“文传协议”.用于Internet上的控制文件的双向传输.同时,它也是一个应用程序(A ...

随机推荐

  1. OS X Yosemite升级提示升级OS10.11或更高版本问题解决方法

    如图,楼主的pro久未升级,版本号已经很低.某天一时兴起,想体验最新版本的OS X.就很开心的进行软件更新: 依据iOS上的APP.系统升级经验,这是一个非常自然.毫无难度的过程,哪知道,今天一直卡在 ...

  2. 腾讯云开放云压测“黑科技“,产品上线从此不再“压力山大"

    商业转载请联系腾讯WeTest获得授权,非商业转载请注明出处. 能否解决"高并发"问题一直是检验一个产品后台是否稳定,架构是否合理,性能是否强大的核心标准.对于产品而言,多高的并发 ...

  3. 【python】函数filter、map

  4. wordpress登录、修改、删除、查看代码记录

    wordpress 登录,新增.修改.删除.查看,页面代码如下 package info.itest.www; import static org.junit.Assert.*; import org ...

  5. Mybatis-----优化配置文件,基于注解CR

    这篇主要写配置文件的优化,例如  jdbc.properties 配置文件  ,引入数据库的文件,例如driver,url,username,password 等,然后在 SqlMapConfig.x ...

  6. 简单介绍什么是协程及其在ES6中的实现方式

    协程,英文名coroutine,是一种执行过程可以被暂停和恢复的方法.各个协程之间相互协作完成一个任务. 让我们来看一个关于发挥协程作用的例子.假定我们有一个生产者和消费者的关系,生产者创建物品并将物 ...

  7. geoserver发布地图服务WMS

    wms服务发布: 1.打开geoserver管理首页(网址为http://localhost:8080/geoserver/web/),并使用安装时设置的帐户名和密码登录(这里是admin/geose ...

  8. bzoj 2337: [HNOI2011]XOR和路径

    Description Input Output Sample Input Sample Output HINT Source Day2 终于把这个史前遗留的坑给填了... 首先异或的话由位无关性,可 ...

  9. Angularjs 2 绝对零基础的教程(1):从安装配置开始

    写在前面 适合人群: 1. 愿意未来从事前端工作,并以此开拓自己未来职业 2. 有任何一种编程语言基础 3. 喜欢简单粗暴学一门实用的技术,而不是做科研. Angular 2 比 Angular 1 ...

  10. Mysql5.7.20使用group by查询(select *)时出现错误--修改sql mode

    使用select * from 表 group by 字段 时报错 错误信息说明: 1055 - Expression #1 of SELECT list is not in GROUP BY cla ...