1.错误提示:
Redis登录进去显示如下错误提示:
(error) MISCONF Redis is configured to save RDB snapshots,
but it is currently not able to persist on disk. Commands
that may modify the data set are disabled, because this
instance is configured to report errors during writes if
RDB snapshotting fails (stop-writes-on-bgsave-error option).
Please check the Redis logs for details about the RDB error.
127.0.0.1:6379> redis 127.0.0.1:6379> config set stop-writes
-on-bgsave-error no
(error) ERR unknown command 'redis'
2.解决方案:输入以下命令后,就可看到“ok”提示,说明已经成功了,
127.0.0.1:6379> config set stop-writes-on-bgsave-error no
3.测试结果:
127.0.0.1:6379> config set stop-writes-on-bgsave-error no
OK
127.0.0.1:6379> ping
PONG
127.0.0.1:6379>
---------------------
发现报"-bash: ifconfig: 未找到命令"这个错误,如下图:
command not found
针对这个问题,我们分两个部分整理一下思路,如下:
1.ifconfig 命令存在情况
当然我们安装的是mini版本的ifconfig是没有预装的,只不过这里作为考虑的范围需要列出来。这时我们可以使用命令查看一下它是否存在,ls /sbin/ifconfig,如下图:
存在的结果
不存在的结果
能看到存在的话我们在继续执行命令echo $PATH,这样我们看这个命令是不是包括在环境变量里面,如下图:
PATH环境变量
这时我们看到ifconfig没有在PATH环境变量下面,所以我们现在可以使用
export PATH=$PATH:/usr/sbin
这种临时添加的方式来添加,如下图:
临时添加
当然这种方式只是更改了当前的shell中的PATH,如果关闭该shell,下次还需要重复如上操作。所以可以使用将其添加到profile文件中,在/etc/profile文件末尾追加一行
export PATH=$PATH:/usr/sbin
如下图:
添加到profile文件
要想它在当前的shell生效还需执行一下source /etc/profile
这样后面打开的shell都能直接使用ifconfig了而不需要要再设置PATH。
2.ifconfig 命令不存在
这种情况就是我们现在面对的,因为centos7.2的mini版没有安装这个东东,所以我们就直接安装就好了,在终端里面输入:
yum -y install net-tools
等待安装完毕之后我们就可以直接使用了,如下图:
安装net-tools
验证命令