当前位置:网站首页>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
边栏推荐
- Research Report on development trend and competitive strategy of global vibration polishing machine industry
- Opencv interpolation mode
- APK签名原理
- Research Report on the development trend and competitive strategy of the global facial wrinkle removal and beauty instrument industry
- What value can NPDP bring to product managers? Do you know everything?
- 手把手带你入门 API 开发
- Is it reasonable and safe for securities companies to open accounts for 10000 free securities? How to say
- 券商万1免5证券开户是合理安全的吗,怎么讲
- [zero basic IOT pwn] reproduce Netgear wnap320 rce
- Solidty智能合约开发-简易入门
猜你喜欢

Details of appium key knowledge

Don't want to knock the code? Here comes the chance

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

首届技术播客月开播在即

Cannot link redis when redis is enabled
![[getting started with Django] 13 page Association MySQL](/img/78/cbf88ae3c3d311edd7d9af8c985749.jpg)
[getting started with Django] 13 page Association MySQL "multi" field table (check)

如何看待国企纷纷卸载微软Office改用金山WPS?

Sqlachemy common operations

【牛客网刷题系列 之 Verilog快速入门】~ 使用函数实现数据大小端转换

JVM第一话 -- JVM入门详解以及运行时数据区分析
随机推荐
微服务开发步骤(nacos)
Opencv mat class
Leetcode (69) -- square root of X
手把手带你入门 API 开发
炎炎夏日,这份安全用气指南请街坊们收好!
One of the first steps to redis
MongoDB第二话 -- MongoDB高可用集群实现
Word2vec yyds dry goods inventory
What problems should be considered for outdoor LED display?
保证生产安全!广州要求危化品企业“不安全不生产、不变通”
Research Report on the development trend and competitive strategy of the global display filter industry
[leetcode 324] swing sorting II thinking + sorting
[getting started with Django] 13 page Association MySQL "multi" field table (check)
ArrayList 扩容详解,扩容原理[通俗易懂]
Ubuntu 14.04下搭建MySQL主从服务器
Research Report on the development trend and competitive strategy of the global electromagnetic flowmeter industry
Salesforce, Johns Hopkins, Columbia | progen2: exploring the boundaries of protein language models
建立自己的网站(14)
solidty-基础篇-结构体和数组,私有 / 公共函数,函数的返回值和修饰符,事件
【14. 区间和(离散化)】