In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Security code: it is impossible to have inner peace without a considerable degree of loneliness.
1. Environmental preparation
Hostname IP system redis-01192.168.10.24CentOS release 6.9 (Final)
The installation of Redis is relatively simple, and there is a reference in the download interface of the official website:
Https://redis.io/download
2. Installation
# create installation directory mkdir / app# download redis4.0.0cd / optwget http://download.redis.io/releases/redis-4.0.0.tar.gz# extract and install tar zxf redis-4.0.0.tar.gz-C / appcd / app/redis-4.0.0makemake PREFIX=/app/redis install# configuration environment variable: export PATH=/app/redis/bin/:$PATHecho "export PATH=/app/redis/bin/:$PATH" > > / etc/profile
3. Start
An error occurred in redis-server / app/redis-4.0.0/redis.conf#: 4631 Jul M 20 Jul 16 01V 04.624 # WARNING: The TCP backlog setting of 511 cannot be enforced because / proc/sys/net/core/somaxconn is set to the lower value of 128.4631 V M 20 Jul 16V 01R 04.624 # WARNING 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.4631:M 20 Jul 16 etc/sysctl.conf and then reboot or run the command 01.04.624 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue 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 the setting after a reboot. Redis must be restarted after THP is disabled.
Resolve Alert 1:
Echo 511 > / proc/sys/net/core/somaxconn
Resolve Alert 2:
Echo "vm.overcommit_memory=1" > / etc/sysctl.confsysctl vm.overcommit_memory=1
Overcommit_memory parameter description:
Optional values: 0, 1, 2.
0, which means that the kernel will check whether there is enough memory available for the application process; if there is enough memory available, the memory request is allowed; otherwise, the memory request fails and the error is returned to the application process.
1, which means that the kernel allows all physical memory to be allocated, regardless of the current memory state, that is, the maximum use of memory.
2, indicating that the kernel allows more than the sum of all physical memory and swap space to be allocated
Linux replies "yes" to most requests for memory so that it can run more and larger programs. Because memory will not be used immediately after applying for memory. This technique is called Overcommit. OOM killer (OOM=out-of-memory) occurs when linux finds that it is out of memory. It chooses to kill some processes (user-mode processes, not kernel threads) to free memory.
Which processes does linux choose to kill when oom-killer occurs? The function for selecting a process is the oom_badness function (in mm/oom_kill.c), which calculates the number of points for each process (0,1000). The higher the points, the more likely the process is to be killed. The number of points per process is related to oom_score_adj, and oom_score_adj can be set (- 1000 lowest, 1000 highest).
Resolve Alert 3:
Echo never > / sys/kernel/mm/transparent_hugepage/enabledecho 'echo never > / sys/kernel/mm/transparent_hugepage/enabled' > > / etc/rc.local
Check to see if it started successfully:
[root@redis-01] # ps-ef | grep redisroot 27905 1437 0 16:53 pts/0 00:00:00 redis-server 127.0.0.1:6379root 27910 1437 0 16:53 pts/0 00:00:00 grep-- color=auto reds [root @ redis-01 ~] # lsof-I: 6379COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAMEredis-ser 27905 root 6u IPv4 35926 0t0 TCP localhost:6379 (LISTEN)
Turn off redis:
Redis-cli shutdown
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.