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

How to install redis5.0.10 for centos7.8

2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article mainly explains how to install redis5.0.10 in centos 7.8. Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let Xiaobian take you to learn "how to install redis5.0.10 in centos 7.8"!

ready

Centos 7.8 server one

# cd /opt# tar -zxf redis-5.0.10.tar.gz compile install #cd/opt #cd redis-5.0.10 #install gcc compiler # yum install gcc# make MALLOC=libc# # make installcd src && make installmake[1]: Entering directory `/opt/redis-5.0.10/src'Hint: It's a good idea to run 'make test';) INSTALL install INSTALL install INSTALL install INSTALL install INSTALL installmake[1]: Leaving directory `/opt/redis-5.0.10/src Modify system parameters ##Modify sysctl.conf# (cat /etc/sysctl.conf

The above operation is a persistent solution to solve the first two warnings of the default startup prompt of redis-server. The two warning messages of default startup of redis-server are attached as follows:

The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.

overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to/etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.

Modify system startup parameters Close TCP##Modify/etc/default/grub##Add transparent_hugepage=never# vi /etc/default/grub_TIMEOUT=5GRUB_DISTRIBUTOR="$(sed 's, release .*$,, GRUB g' /etc/system-release)"GRUB_DEFAULT=savedGRUB_DISABLE_SUBMENU=trueGRUB_TERMINAL_OUTPUT="console"GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv =centos/root rd.lvm.lv=centos/swap rh quiet transparent_hugepage=never"GRUB_DISABLE_RECOVERY="true"##Regeneration to grub configuration file # grub2-mkconfig -o /boot/grub2/grub. cfggb Generating grub configuration file ... Found linux image: /boot/vmlinuz-3.10.0-1127.el7.x86_64Found initrd image: /boot/initramfs-3.10.0-1127.el7.x86_64.imgFound linux image: /boot/vmlinuz-0-rescue-385c7efe9475460c95c436866e593af3Found initrd image: /boot/initramfs-0-rescue-385c7efe9475460c95c436866e593af3.imgdone

The above operation is a persistent solution to solve the third warning of the default startup prompt of redis-server. The third warning message of the default startup of redis-server is attached as follows:

you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix thisissue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain thesetting after a reboot. Redis must be restarted after THP is disabled.

According to the prompt, writing 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' to/etc/rc.local is actually not useful, but changing the grub startup file can take effect.

Start redis as a background process modify the configuration file redis.conf# cd /opt/redis-5.0.10# mkdir /etc/redis# cp redis.conf /etc/redis/redis.conf

Modify the following 3 entries in/etc/redis/redis.conf

Start as a background process

Change daemonize no to daemonize yes

Set up redis remote connection

Comment out bind 127.0.0.1

Set redis connection password

For requirepass foobard read requirepass redis1234

Set up systemctl startup program

/usr/lib/systemd/system/redis.service

[Unit]Description=Redis 6379After=syslog.target network.target[Service]Type=forkingPrivateTmp=yesRestart= alwaysExecuStart =/usr/local/bin/redis-server /etc/redis/redis.confUser=rootGroup=rootLimitCORE=infinityLimitNOFILE= 10000LimitNPROC =100000[Install]WantedBy=multi-user.target Configuration automatic startsystemctl daemon-reload systemctl enable redis startCommand systemctl redis systemctl start redissystemctl restart redis

{{o.name}}

{{m.name}}

At this point, I believe that everyone has a deeper understanding of "how to install redis5.0.10 in centos 7.8," so you may wish to actually operate it! Here is the website, more related content can enter the relevant channels for inquiry, pay attention to us, continue to learn!

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

Development

Wechat

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

12
Report