centos中redis、moongodb 安装方法

mongodb

https://docs.mongodb.com/manual/tutorial/install-mongodb-on-red-hat/

Redis

wget http://download.redis.io/releases/redis-3.0.7.tar.gz
$ tar xzf redis-3.0.7.tar.gz
$ ln -s redis-3.0.7 redis
$ cd redis
$ make
$ make install

cd /etc/systemd/system/redis.service

[Unit]
Description=Redis In-Memory Data Store
After=network.target

[Service]
User=redis
Group=redis
ExecStart=/usr/local/bin/redis-server /etc/redis/redis.conf
ExecStop=/usr/local/bin/redis-cli shutdown
Restart=always

[Install]
WantedBy=multi-user.target
复制代码

启动服务并配置为开机启动:

$ sudo systemctl start redis
$ sudo systemctl enable redis
$ sudo systemctl status redis

 

posted @ 2018-10-31 15:08  bili9527  阅读(227)  评论(0编辑  收藏  举报