当前位置:网站首页>Redis installation and setting up SSDB master-slave environment under Ubuntu 14.04
Redis installation and setting up SSDB master-slave environment under Ubuntu 14.04
2022-07-01 14:49:00 【Brother Xing plays with the clouds】
Come into contact with in the work redis,Redis It's a very efficient key-value The database of , Widely used in projects , however redis The obvious disadvantage is the processing of memory , At the beginning of the project launch , The memory must be reasonably planned , Otherwise, it is easy to cause memory explosion , Generally, the reasonable memory size is... Of the physical memory of the computer 3/5.
redis Multiple data types are available , What I often use is string 、hash、list、set、sorted set, It can basically meet the requirements of the project for data types . We use redis Of Java client , Provides a series of solutions for redis The command corresponds to api.redis Persistence of provides a variety of strategies , But we didn't do persistence , I studied it myself ,AOF The way I feel is the most reliable , The principle and mysql The binary log of is very similar , It also records the operation information and writes it to the file , from The server Read the log and perform the operation .
In ordinary Intranet development, you may often need to adjust the details of data storage , So if the previous data still resides in memory , Many functions will not work properly , So after adjusting the details , Need to be right redis database flushdb operation .
redis And ssdb It is suitable for use in some scenes , For example, some data can only remain in the database 2 minute , similar YY channel T people , Fix it for a few minutes before you come in , You can use setex key seconds value command , Then judge whether it is expired and pass exists key command .
redis Common command website :http://redis.readthedocs.org/en/latest/ covers redis Orders and demo.
On the road ssdb Say before redis, because ssdb Very compatible redis Of api. yes redis A good substitute for .
ssdb be relative to redis It has many advantages : yes redis Database 100 Times the capacity , It can store billions of data . relative redis Come on , It takes up very little memory . So I downloaded it myself ssdb, Here are ssdb The process of building .
Ubuntu 14.04 Next Redis install And simple tests http://www.linuxidc.com/Linux/2014-05/101544.htm
Redis colony Detailed documents http://www.linuxidc.com/Linux/2013-09/90118.htm
Ubuntu 12.10 Lower installation Redis( Graphic, )+ Jedis Connect Redis http://www.linuxidc.com/Linux/2013-06/85816.htm
Redis series - Installation, deployment and maintenance http://www.linuxidc.com/Linux/2012-12/75627.htm
CentOS 6.3 install Redis http://www.linuxidc.com/Linux/2012-12/75314.htm
Redis The configuration file redis.conf Detailed explanation http://www.linuxidc.com/Linux/2013-11/92524.htm
Environmental Science :Ubuntu 14.04
virtual machine A: 192.168.1.251
virtual machine B: 192.168.1.252
gateway : 192.168.1.1
My two virtual machines are installed on different physical machines , But they all use bridging ,ip The addresses are all in the same ip paragraph .
Both virtual machines are installed online ssdb.
wget --no-check-certificate https://github.com/ideawu/ssdb/archive/master.zip
unzip master
cd ssdb-master
make
sudo make install
These in ssdb You can find it on the official website ,http://www.ideawu.com/ssdb/zh_cn/.
ssdb Master slave construction is actually very simple , You only need two virtual machines ssdb Found under installation directory ssdb.conf.
sudo vi ssdb.conf
modify server Under the ip Default for virtual machine IP Address .
virtual machine A:
server:
ip:192.168.1.251
port:8888 // I haven't changed my port , Use default
virtual machine B:
server:
ip:192.168.1.252
port:8888
This is the basic configuration .
Now as long as A For ssdb.conf The configuration :
replication:
slaveof:
# to identify a master even if it moved(ip, port changed)
# if set to empty or not defined, ip:port will be used.
id: svc_2
# sync|mirror, default is sync
type: sync
ip: 192.168.1.252
port: 8888
Be careful : In the above configuration process , Never use the space bar , Use tab.
Now you can start ssdb 了 .
./ssdb-server ssdb.conf
It can be used later ssdb The command-line tools provided to operate .
virtual machine A: ./ssdb-cli -h 192.168.1.251 -p 8888
virtual machine B: ./ssdb-cli -h 192.168.1.252 -p 8888
边栏推荐
- tensorflow2-savedmodel convert to pb(frozen_graph)
- Details of appium key knowledge
- Rearrangement of overloaded operators
- qt捕获界面为图片或label显示
- [leetcode 324] swing sorting II thinking + sorting
- Microservice development steps (Nacos)
- 微服务开发步骤(nacos)
- 博文推荐 | 深入研究 Pulsar 中的消息分块
- 【牛客网刷题系列 之 Verilog快速入门】~ 多功能数据处理器、求两个数的差值、使用generate…for语句简化代码、使用子模块实现三输入数的大小比较
- What value can NPDP bring to product managers? Do you know everything?
猜你喜欢

Websocket (simple experience version)

Rearrangement of overloaded operators

博文推荐 | 深入研究 Pulsar 中的消息分块

Semiconductor foundation of binary realization principle

One of the data Lake series | you must love to read the history of minimalist data platforms, from data warehouse, data lake to Lake warehouse

Today, with the popularity of micro services, how does service mesh exist?

What problems should be considered for outdoor LED display?

sqlilabs less9

2022-2-15 learning the imitation Niuke project - Section 3 post details

Salesforce, Johns Hopkins, Columbia | progen2: exploring the boundaries of protein language models
随机推荐
[zero basic IOT pwn] reproduce Netgear wnap320 rce
从零开发小程序和公众号【第三期】
关于重载运算符的再整理
Reorganize the trivial knowledge points at the end of the term
241. Design priorities for operational expressions
Leetcode (69) -- square root of X
[零基础学IoT Pwn] 复现Netgear WNAP320 RCE
Word2vec yyds dry goods inventory
定了!2022海南二级造价工程师考试时间确定!报名通道已开启!
qt捕获界面为图片或label显示
【牛客网刷题系列 之 Verilog快速入门】~ 使用函数实现数据大小端转换
Problem note - Oracle 11g uninstall
Research Report on the development trend and competitive strategy of the global aviation leasing service industry
Provincial election + noi Part 10 probability statistics and polynomials
期末琐碎知识点再整理
Ubuntu 14.04下搭建MySQL主从服务器
What problems should be considered for outdoor LED display?
tensorflow2-savedmodel convert to pb(frozen_graph)
Details of appium key knowledge
Don't want to knock the code? Here comes the chance