centos下的redis一键安装shell脚本
#!/bin/bash
yum install cpp binutils glibc-kernheaders glibc-common glibc-devel gcc make wget #安装依赖库
wget http://download.redis.io/releases/redis-4.0.1.tar.gz
if [ -f /root/redis-4.0..tar.gz ];then
tar zxvf redis-4.0..tar.gz
mv redis-4.0. /usr/local/redis
cd /usr/local/redis
make
cd src/
make install
else
echo "文件不存在!"
exit;
fi sed -i '136s/daemonize no/daemonize yes/' /usr/local/redis/redis.conf #(编辑redis服务配置文件,修改其中配置) sed -i '69s/127.0.0.1/0.0.0.0/' /usr/local/redis/redis.conf sed -i '88s/protected-mode yes/protected-mode no/' /usr/local/redis/redis.conf
mkdir -p /etc/redis
ln -s /usr/local/redis/redis.conf /etc/redis/.conf #(在默认的配置文件路劲中放置配置文件)
ln -s /usr/local/redis/utils/redis_init_script /etc/init.d/redisd #(将初始化文件配置到系统自启动的文件夹内,redisd为服务名,可自行修改)
service redisd start #(开启redis服务,服务名为:redisd)
#redis-cli
netstat -ntpl|grep redis
echo "Redis 部署完成!"
echo " "
echo "如果你的系统是Centos 7在安装完毕后留意防火墙,可执行以下命令来放行redis 外部通信。"
echo "firewall-cmd --zone=public --add-port=6379/tcp --permanent"
echo "firewall-cmd --reload"
echo "firewall-cmd --zone= public --query-port=6379/tcp"
可根据个人需要酌情修改。
#!/bin/bash
yum install cpp binutils glibc-kernheaders glibc-common glibc-devel gcc make wget #安装依赖库
wget http://download.redis.io/releases/redis-4.0.1.tar.gz
if [ -f /root/redis-4.0.1.tar.gz ];then
tar zxvf redis-4.0.1.tar.gz
mv redis-4.0.1 /usr/local/redis
cd /usr/local/redis
make
cd src/
make install
else
echo "文件不存在!"
exit;
fi
sed -i '136s/daemonize no/daemonize yes/' /usr/local/redis/redis.conf #(编辑redis服务配置文件,修改其中配置)
sed -i '69s/127.0.0.1/0.0.0.0/' /usr/local/redis/redis.conf
sed -i '88s/protected-mode yes/protected-mode no/' /usr/local/redis/redis.conf
mkdir -p /etc/redis
ln -s /usr/local/redis/redis.conf /etc/redis/6379.conf #(在默认的配置文件路劲中放置配置文件)
ln -s /usr/local/redis/utils/redis_init_script /etc/init.d/redisd #(将初始化文件配置到系统自启动的文件夹内,redisd为服务名,可自行修改)
service redisd start #(开启redis服务,服务名为:redisd)
#redis-cli
netstat -ntpl|grep redis
echo "Redis 部署完成!"
echo " "
echo "如果你的系统是Centos 7在安装完毕后留意防火墙,可执行以下命令来放行redis 外部通信。"
echo "firewall-cmd --zone=public --add-port=6379/tcp --permanent"
echo "firewall-cmd --reload"
echo "firewall-cmd --zone= public --query-port=6379/tcp"
centos下的redis一键安装shell脚本的更多相关文章
- 在CentOS下利用Docker一键安装seafile
https://cloud.seafile.com/published/seafile-manual-cn/docker/pro-edition/%E7%94%A8Docker%E9%83%A8%E7 ...
- CentOS 6、7下pptp vpn一键安装脚本
之前有折腾过<CentOS 6.7下IPSEC/L2TP VPN一键安装脚本>,不稳定.不支持IOS,因此换成pptp,并已经添加到<lnmp一键安装包>.这个脚本可以单独使用 ...
- CentOS 6一键系统优化 Shell 脚本
CentOS 6一键系统优化 Shell 脚本 脚本的内容如下: #!/bin/bash#author suzezhi#this script is only for CentOS 6#check t ...
- (转)CentOS一键安装Nginx脚本
原文:https://www.xiaoz.me/archives/10301 https://blog.slogra.com/post-676.html-----centos7一键安装nginx脚本
- linux一键安装vncserver脚本
title: linux一键安装vncserver脚本 date: 2016-04-11 14:32:04 tags: --- linux多数情况下是作为服务器使用的,管理员一般也喜欢使用命令行来管理 ...
- openstack pike 单机 一键安装 shell
#openstack pike 单机 centos 一键安装 shell #openstack pike 集群高可用 安装部署 汇总 http://www.cnblogs.com/elvi/p/7 ...
- centos 下 Qt Creator 的安装使用
centos 下 Qt Creator 的安装使用 Qt 以其开源,免费,完全面向对象(很容易扩展),允许真正的组件编程以及可移植跨平台等诸多优势得到越来越多的开发人员的青睐.Qt Creator 是 ...
- CentOS下Samba文件服务器的安装与配置
CentOS下Samba文件服务器的安装与配置 http://blog.csdn.net/limingzhong198/article/details/22064801 一.安装配置 1. 安装sam ...
- Rehat一键安装mysql脚本和备份数据库脚本
Rehat一键安装mysql脚本 ##说明:适用,Rehat 5 6 7 1.运行状态,运行成功输出mysql临时密码 2.代码如下 #!/bin/bash #获取系统信息 sudo cat /etc ...
随机推荐
- [go]map基本使用和底层原理
1.map基本使用 map声明 var m4 map[int]int //只是声明 没有开辟空间 m4[1]=100 //报错 log.Println(m4) 创建 //1 m3:=make(map[ ...
- 中阶 d06.1 cookie && session && jsp介绍
##Cookie > 饼干. 其实是一份小数据, 是服务器给客户端,并且存储在客户端上的一份小数据 ### 应用场景 > 自动登录.浏览记录.购物车. ###为什么要有这个Cookie & ...
- Java中都通用文件下载(ContentType、文件头、response、out四步骤)
Java中都通用文件下载(ContentType.文件头.response.out四步骤) 新浪微博:IT国子监(记得关注噢) http://weibo.com/itguozijian 我们就直接 ...
- 【python实现卷积神经网络】池化层实现
代码来源:https://github.com/eriklindernoren/ML-From-Scratch 卷积神经网络中卷积层Conv2D(带stride.padding)的具体实现:https ...
- vue 全局自定义组件
1.vue文件 <template> <div style="position: absolute;bottom: 10px;text-align: center;widt ...
- 练习,自定义TextView(1.1)
重新自定义TextView是非常有趣的事情,跟着Android4高级编程,通过自定义TextView,来敲一下代码: 这个是那么的简单,自定义TextView,新建CustomTextView继承Te ...
- Daily Scrum 12/10/2015
Zhaoyang: Finished the implementation of query suggestion UI; Yandong: Changed the fusion algorithm ...
- C - Roads in the North DFS+树的直径
Building and maintaining roads among communities in the far North is an expensive business. With thi ...
- 还学的动吗? 盘点下Vue.js 3.0.0 那些让人激动的功能
转载请注明出处:葡萄城官网,葡萄城为开发者提供专业的开发工具.解决方案和服务,赋能开发者. 原文出处:https://blog.bitsrc.io/vuejs-3-0-0-beta-features- ...
- Jetson AGX Xavier更换apt-get源
使用apt-get安装时,会很慢,更换了国内的源后,就可以解决这个问题了. 1. 备份sources.list文件 sudo cp /etc/apt/sources.list /etc/apt/sou ...