Teach you how to configure CentOS7 and configure Redi
-
-
- 1. Install the virtual machine
- 2. Configure system mirroring and network
- 3. Install the system
- 4. Install redis
-
- 1. Put redis in this folder
- 2. After decompression, install make && make install
- 3. View the redis executable file in the src directory
- 4. Start redis
- 5. Redis.conf configuration file
- 6. Specify the redis.conf configuration file to start
- 7. Verify startup
- 8. Test link
- 9. Modify the configuration file of redis.conf to run in the background
- 10. Specify ip access
-
1. Install the virtual machine
1. Select the system image you want to install later
2. Choose CentOS 7 under Linux
3. Name the virtual machine you want to install and choose the installation location
4. Configure the size of the disk
5. The basic installation is complete
2. Configure system mirroring and network
1. Configure the mirroring of the system
2. Configure the network of the system
3. Start
3. Install the system
1. Choose a language,
The next step-by-step installation is just fine. Just pay attention to the network settings. Just deal with the options with exclamation marks. Here, they won’t be displayed due to too many pictures.
2. Install vim
Successful installation
3. Configure the static ip path
4. Open the network configuration file
5. Modify the position as shown in the figure below
TYPE="Ethernet"
PROXY_METHOD="none"
BROWSER_ONLY="no"
BOOTPROTO="static"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
IPV6_ADDR_GEN_MODE="stable-privacy"
NAME="ens33"
DEVICE="ens33"
ONBOOT="yes"
IPADDR=172.16.178.2
NETMASK=255.255.255.0
DNS1=114.114.114.114
GATEWAY=172.16.178.1
Restart network
systemctl restart network,
ping Baidu, the configuration is successful as shown in the figure below
6. Install wget
4. Install redis
1. Put redis in this folder
2. After decompression, install make && make install
As shown in the figure below, the gcc environment is missing.
Install the gcc environment. Make make
again and make make again. If the following situations occur
解决办法: 使用以下命令
make MALLOC=libc
原因分析:
在README 有这个一段话。
Allocator
———
Selecting a non-default memory allocator when building Redis is done by setting
the `MALLOC` environment variable. Redis is compiled and linked against libc
malloc by default, with the exception of jemalloc being the default on Linux
systems. This default was picked because jemalloc has proven to have fewer
fragmentation problems than libc malloc.
To force compiling against libc malloc, use:
% make MALLOC=libc
To compile against jemalloc on Mac OS X systems, use:
% make MALLOC=jemalloc
说关于分配器allocator, 如果有MALLOC 这个 环境变量, 会有用这个环境变量的 去建立Redis。
而且libc 并不是默认的 分配器, 默认的是 jemalloc, 因为 jemalloc 被证明 有更少的
fragmentation problems 比libc。
但是如果你又没有jemalloc 而只有 libc 当然 make 出错。 所以加这么一个参数
Do another make && make install and
you're done! ! !
3. View the redis executable file in the src directory
redis-server 启动Redis服务器
redis-cli Redis命令行客户端
redis-benchmark Redis性能测试工具
redis-check-aof 对AOF文件进行修复的工具
redis-check-dump 对RDB文件检查的工具
redis-sentinel Sentinel服务器
4. Start redis
5. Redis.conf configuration file
6. Specify the redis.conf configuration file to start
7. Verify startup
8. Test link
9. Modify the configuration file of redis.conf to run in the background
vim /etc/redis.conf
找到bind 127.0.0.1并注释掉
修改 protected-mode 属性值为no
注:redis默认是只能本地访问,注释掉并叫保护模式禁用以后可以IP访问
10. Specify ip access
Writing is not easy to focus on three batter, I will always continue to look forward to next output ... the next issue of linux mysql configuration Thank you!
Encourage you...