【Redis - 1】Redis Installation
Download, extract and compile Redis with:
$ wget http://download.redis.io/releases/redis-5.0.3.tar.gz $ tar xzf redis-5.0.3.tar.gz $ cd redis-5.0.3 $ make
The binaries that are now compiled are available in the src directory. Run Redis with:
$ src/redis-server
出现这下面这节目是没有启动成功

使用命令设置:
sysctl vm.overcommit_memory=1
查看redis 的redis.conf 配置的 找到daemonize 如需要在后台运行,把该项的值改为yes。
vi redis.conf

再次使用命令src/redis-server启动,但还是再警告:

官方里面有提到这个问题:https://redis.io/topics/quickstart
Starting Redis
The simplest way to start the Redis server is just executing the redis-server binary without any argument.
$ redis-server [28550] 01 Aug 19:29:28 # Warning: no config file specified, using the default config. In order to specify a config file use 'redis-server /path/to/redis.conf' [28550] 01 Aug 19:29:28 * Server started, Redis version 2.2.12 [28550] 01 Aug 19:29:28 * The server is now ready to accept connections on port 6379 ... more logs ...
In the above example Redis was started without any explicit configuration file, so all the parameters will use the internal default. This is perfectly fine if you are starting Redis just to play a bit with it or for development, but for production environments you should use a configuration file.
In order to start Redis with a configuration file use the full path of the configuration file as first argument, like in the following example: redis-server /etc/redis.conf. You should use the redis.conf file included in the root directory of the Redis source code distribution as a template to write your configuration file.
提示没找到相应的配置文件,使用下面的命令则可以正常启动:
src/redis-server redis.conf
或者
src/redis-server --daemonize yes

You can interact with Redis using the built-in client:
$ src/redis-cli redis> set foo bar OK redis> get foo "bar"
Are you new to Redis? Try our online, interactive tutorial.
扩展
#ctrl+z:挂起,程序放到后台,程序没有结束。
#jobs:查看被挂起的程序工作号
恢复进程执行时,有两种选择:fg命令将挂起的作业放回到前台执行;用bg命令将挂起的作业放到后台执行
格式:fg 工作号;bg 工作号
#ps -ef |grep redis:相关redis相关进程
#ctrl+c:强行中断当前程序的执行
浙公网安备 33010602011771号