Redis是经常使用基于内存的Key-Value数据库,比Memcache更先进,支持多种数据结构,高效,快速。用Redis能够很轻松解决高并发的数据访问问题;做为实时监控信号处理也很是不错。redis
Ubuntu 16.04数据库
sudo apt-get install redis-server
安装完成后,Redis服务器会自动启动,咱们检查Redis服务器程序服务器
root@iZbp156ci35ho13vsftr7nZ:/www/fstock# ps -aux|grep redis redis 22540 0.0 0.0 40136 3288 ? Ssl 11:30 0:00 /usr/bin/redis-server 127.0.0.1:6379 root 22574 0.0 0.0 14224 944 pts/1 S+ 11:30 0:00 grep --color=auto redis
root@iZbp156ci35ho13vsftr7nZ:/www/fstock# netstat -nlt|grep 6379 tcp 0 0 127.0.0.1:6379 0.0.0.0:* LISTEN
root@iZbp156ci35ho13vsftr7nZ:/www/fstock# sudo /etc/init.d/redis-server status ● redis-server.service - Advanced key-value store Loaded: loaded (/lib/systemd/system/redis-server.service; enabled; vendor preset: enabled) Active: active (running) since Thu 2019-02-21 11:30:08 CST; 33s ago Docs: http://redis.io/documentation, man:redis-server(1) Main PID: 22540 (redis-server) CGroup: /system.slice/redis-server.service └─22540 /usr/bin/redis-server 127.0.0.1:6379 Feb 21 11:30:08 iZbp156ci35ho13vsftr7nZ systemd[1]: Starting Advanced key-value store... Feb 21 11:30:08 iZbp156ci35ho13vsftr7nZ run-parts[22530]: run-parts: executing /etc/redis/redis-server.pre-up.d/00_example Feb 21 11:30:08 iZbp156ci35ho13vsftr7nZ run-parts[22541]: run-parts: executing /etc/redis/redis-server.post-up.d/00_example Feb 21 11:30:08 iZbp156ci35ho13vsftr7nZ systemd[1]: Started Advanced key-value store.
安装Redis服务器,会自动地一块儿安装Redis命令行客户端程序。数据结构
在本机输入redis-cli命令就能够启动,客户端程序访问Redis服务器。并发
root@iZbp156ci35ho13vsftr7nZ:/www/fstock# redis-cli 127.0.0.1:6379>