当前位置:网站首页>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
边栏推荐
- APK签名原理
- JVM performance tuning and practical basic theory part II
- Is the futures company found on Baidu safe? How do futures companies determine the regularity
- 241. Design priorities for operational expressions
- [15. Interval consolidation]
- 微服务开发步骤(nacos)
- 保证生产安全!广州要求危化品企业“不安全不生产、不变通”
- En utilisant le paquet npoi de net Core 6 c #, lisez Excel.. Image dans la cellule xlsx et stockée sur le serveur spécifié
- Day-02 database
- Semiconductor foundation of binary realization principle
猜你喜欢

Sqlachemy common operations

Music player development example (can be set up)

定了!2022海南二级造价工程师考试时间确定!报名通道已开启!

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

Chapter 4 of getting started with MySQL: creation, modification and deletion of data tables
![[leetcode 324] 摆动排序 II 思维+排序](/img/cb/26d89e1a1f548b75a5ef9f29eebeee.png)
[leetcode 324] 摆动排序 II 思维+排序

241. 为运算表达式设计优先级

Salesforce、约翰霍普金斯、哥大 | ProGen2: 探索蛋白语言模型的边界

sqlilabs less10

写在Doris毕业后的第一天
随机推荐
Pat 1065 a+b and C (64bit) (20 points) (16 points)
Fundamentals of C language
The State Administration of Chia Tai market supervision, the national development and Reform Commission and the China Securities Regulatory Commission jointly reminded and warned some iron ores
C 语言基础
What value can NPDP bring to product managers? Do you know everything?
Salesforce, Johns Hopkins, Columbia | progen2: exploring the boundaries of protein language models
Markdown编辑器使用基本语法
Official announcement: Apache Doris graduated successfully and became the top project of ASF!
Research Report on the development trend and competitive strategy of the global facial wrinkle removal and beauty instrument industry
JVM第二话 -- JVM内存模型以及垃圾回收
JVM second conversation -- JVM memory model and garbage collection
Some thoughts on software testing
Details of appium key knowledge
Quelle valeur le pdnp peut - il apporter aux gestionnaires de produits? Vous savez tout?
NPDP产品经理国际认证报名有什么要求?
[15. Interval consolidation]
solidty-基础篇-结构体和数组,私有 / 公共函数,函数的返回值和修饰符,事件
JVM performance tuning and practical basic theory part II
Research Report on the development trend and competitive strategy of the global navigation simulator industry
[零基础学IoT Pwn] 复现Netgear WNAP320 RCE