【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:强行中断当前程序的执行
· tomcat为什么假死了
· 聊一聊 Linux 上对函数进行 hook 的两种方式
· C# 锁机制全景与高效实践:从 Monitor 到 .NET 9 全新 Lock
· 一则复杂 SQL 改写后有感
· golang中写个字符串遍历谁不会?且看我如何提升 50 倍
· 突发,CSDN 崩了!程序员们开始慌了?
· 完成微博外链备案,微博中直接可以打开园子的链接
· C# WinForms 实现打印监听组件
· C#实现欧姆龙 HostLink 通讯协议库
· 一个基于 .NET 开源、模块化 AI 图像生成 Web 用户界面
2016-12-21 SqlDataAdapter 批量更新 DataTable
2016-12-21 sqlCacheDependency 使用