Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Redis usage

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

Prepare knowledge

Redis is an open source in-memory data structure repository used for databases, caching, and message queues. Supported data types save strings, hashes, lists, collections. Redis is an open source (BSD licensed), in-memory data structure store, used as a database, cache and message broker. It supports data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs, geospatial indexes with radius queries and streams. Redis has built-in replication, Lua scripting, LRU eviction, transactions and different levels of on-disk persistence, and provides high availability via Redis Sentinel and automatic partitioning with Redis Cluster.

Instruction use

1) login instruction $redis-cli-h 192.168.58.138-p 6379-a "fengyuzaitu"

2) View the running status of the service: 127.0.0.1purl 6379 > ping

3) (error) NOAUTH Authentication required. 127.0.0.1 6379 > auth 'fengyuzaitu'

Subscription instruction use

1) the Psubscribe command subscribes to one or more channels that match a given pattern. Each pattern uses * as a match, such as it* matches all channels that start with it (it.news, it.blog, it.tweets, and so on). News.* matches all news. The opening channel (news.it news.global.today, etc.), and so on.

Redis 127.0.0.1 6379 > PSUBSCRIBE USER_POSITION_INFO*

2) the Subscribe command is used to subscribe to information for a given channel or channels.

Redis 127.0.0.1 6379 > SUBSCRIBEUSER_POSITION_INFO

Note: topics subscribed to by Psubscribe must have *, which is completely different from Subscribe

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report