设为首页 收藏本站
查看: 719|回复: 0

[经验分享] redis安全策略 redis工具

[复制链接]

尚未签到

发表于 2016-12-17 09:51:05 | 显示全部楼层 |阅读模式
  1 安全策略:
  设置数据库密码
修改配置requirepass password
验证密码auth password 只有验证通过后才能继续执行命令
注意:在配置redis复制功能的时候如果主数据库设置了密码,需要在从数据的配置文件中通过masterauth参数设置主数据库的密码,这样从数据库在连接主数据库时就会自动使用auth命令认证了。相当于做了一个免密码登录。
bind参数(可以让数据库只能在指定IP下访问)
bind 127.0.0.1 192.168.1.110 这样内网的1段都可以访问
命令重命名 不让错误执行flushall 清空所有数据
修改命令的名称rename-command flushall cleanall
禁用命令 rename-command flushall ""
  2 工具:
  redis-cli
Info查看使用信息等/monitor监视器 看用户做的每一个操作
  eg:

[iyunv@h2master bin]# redis-cli
127.0.0.1:6379> info
# Server
redis_version:2.8.19
redis_git_sha1:00000000
redis_git_dirty:0
redis_build_id:4b1addfd5f9adb27
redis_mode:standalone
os:Linux 2.6.18-308.el5 i686
arch_bits:32
multiplexing_api:epoll
gcc_version:4.1.2
process_id:21558
run_id:86a4890d01e244f1e0e5ac557497f8fee82182a3
tcp_port:6379
uptime_in_seconds:151177
uptime_in_days:1
hz:10
lru_clock:16746810
config_file:/etc/redis.conf
# Clients
connected_clients:2
client_longest_output_list:0
client_biggest_input_buf:0
blocked_clients:0
# Memory
used_memory:735376
used_memory_human:718.14K
used_memory_rss:1859584
used_memory_peak:812744
used_memory_peak_human:793.70K
used_memory_lua:23552
mem_fragmentation_ratio:2.53
mem_allocator:jemalloc-3.6.0
# Persistence
loading:0
rdb_changes_since_last_save:0
rdb_bgsave_in_progress:0
rdb_last_save_time:1425974859
rdb_last_bgsave_status:ok
rdb_last_bgsave_time_sec:0
rdb_current_bgsave_time_sec:-1
aof_enabled:0
aof_rewrite_in_progress:0
aof_rewrite_scheduled:0
aof_last_rewrite_time_sec:-1
aof_current_rewrite_time_sec:-1
aof_last_bgrewrite_status:ok
aof_last_write_status:ok
# Stats
total_connections_received:19
total_commands_processed:4090
instantaneous_ops_per_sec:0
total_net_input_bytes:139943
total_net_output_bytes:21378
instantaneous_input_kbps:0.00
instantaneous_output_kbps:0.00
rejected_connections:0
sync_full:0
sync_partial_ok:0
sync_partial_err:0
expired_keys:1
evicted_keys:0
keyspace_hits:20
keyspace_misses:3
pubsub_channels:1
pubsub_patterns:0
latest_fork_usec:786
# Replication
role:master    主节点
connected_slaves:0
master_repl_offset:0
repl_backlog_active:0
repl_backlog_size:1048576
repl_backlog_first_byte_offset:0
repl_backlog_histlen:0
# CPU
used_cpu_sys:0.72
used_cpu_user:0.40
used_cpu_sys_children:0.02
used_cpu_user_children:0.01
# Keyspace
db0:keys=2004,expires=0,avg_ttl=0

  
Redisclient
http://www.oschina.net/news/53391/redisclient-1-0
  Redisclient 截图如下:
  
DSC0000.png
 

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-315424-1-1.html 上篇帖子: redis 下篇帖子: redis sot操作
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表