Teach you how to configure CentOS7 and configure Redis! ! !

1. Install the virtual machine


image

1. Select the system image you want to install later


image

2. Choose CentOS 7 under Linux


image

3. Name the virtual machine you want to install and choose the installation location


image

4. Configure the size of the disk


image

5. The basic installation is complete


image

2. Configure system mirroring and network


image

1. Configure the mirroring of the system


image

2. Configure the network of the system


image

3. Start

image

3. Install the system


image

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.


image

2. Install vim


image
Successful installation
image

3. Configure the static ip path


image

4. Open the network configuration file


image

5. Modify the position as shown in the figure below


image

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
image

6. Install wget


image

4. Install redis

image

1. Put redis in this folder

image

2. After decompression, install make && make install

image
image
  As shown in the figure below, the gcc environment is missing.
  Install the gcc environment. Make make
image
   again and make make again. If the following situations occur
image

解决办法: 使用以下命令
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
image
  you're done! ! !

3. View the redis executable file in the src directory


image

    redis-server  启动Redis服务器
  redis-cli  Redis命令行客户端
  redis-benchmark  Redis性能测试工具
  redis-check-aof  对AOF文件进行修复的工具
  redis-check-dump 对RDB文件检查的工具
  redis-sentinel  Sentinel服务器

image

4. Start redis


image

5. Redis.conf configuration file


image

6. Specify the redis.conf configuration file to start


image

7. Verify startup

image

8. Test link

image

9. Modify the configuration file of redis.conf to run in the background

imageimage

vim /etc/redis.conf
找到bind 127.0.0.1并注释掉
修改 protected-mode 属性值为no
注:redis默认是只能本地访问,注释掉并叫保护模式禁用以后可以IP访问

image

10. Specify ip access


image
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...

Guess you like

Origin blog.csdn.net/weixin_38071259/article/details/106409835