下载安装MPush
http://mpush.mydoc.io/?t=134336
安装zookeeper
https://www.jianshu.com/p/de46acac2d8b
安装redis
https://www.cnblogs.com/happywish/p/10944253.html
1077 wget http://download.redis.io/releases/redis-4.0.8.tar.gz
1078 tar xzvf redis-4.0.8.tar.gz
1079 cd redis-4.0.8
1081 make
1082 cd src
1083 make install PREFIX=/opt/mpush/redis
1084 cd /opt/mpush/redis
1085 cd bin/
1086 ll
1087 cd -
1088 cd /opt/mpush/redis-4.0.8/src
1089 cd ..
1090 ll
1091 vi redis.conf
1092 cp redis.conf ../redis/bin/
1093 cd ../redis/bin/
1094 vi redis.conf
1095 ll
1096 ./redis-server ./redis.conf
1097 fuser -n tcp 6379
1104 pkill redis
1108 tail -fn100 redis.log
1111 cd mpush-0.8.0/
1112 ll
1113 con
1114 cd conf/
1115 ll
1116 vi mpush.conf
1117 cd ..
1118 ll
1119 cd bin/
1120 ll
1121 ./mp.sh start
1122 tail -fn100 ../logs/mpush.out
1123 cd ../conf/
1124 ll
1125 vi mpush.conf
1126 cd ../bin/
1127 ll
1128 ./mp.sh start
1129 tail -fn100 ../logs/mpush.out
本地源码编译:
在mpush下执行
mvn clean package -Pzip
生成好的包在:
mpush\mpush-boot\target
mkdir -p /opt/mpush
将安装文件全部复制到这个目录下
tar -xzvf alloc-release-0.8.0.tar.gz
tar -xzvf mpush-release-0.8.0.tar.gz
tar -xzvf redis-4.0.8.tar.gz
tar -xzvf zookeeper-3.4.14.tar.gz
cd zookeeper-3.4.14
cd conf/
cp zoo_sample.cfg zoo.cfg
vi zoo.cfg
------------------------
dataDir=/opt/mpush/zookeeper-3.4.14/data
logDir=/opt/mpush/zookeeper-3.4.14/log
------------------------
cd ..
mkdir data
mkdir log
vi /etc/profile
------------------------
export ZOOKEEPER_HOME=/opt/mpush/zookeeper-3.4.14/
export PATH=$ZOOKEEPER_HOME/bin:$PATH
export PATH
------------------------
source /etc/profile
cd /opt/mpush/zookeeper-3.4.14/bin
./zkServer.sh start
./zkServer.sh status
cd /opt/mpush/redis-4.0.8
make
cd src
make install PREFIX=/usr/local/redis
4.移动配置文件到安装目录下
cd ../
mkdir /usr/local/redis/etc
mv redis.conf /usr/local/redis/etc
5.配置redis为后台启动
vi /usr/local/redis/etc/redis.conf //将daemonize no 改成daemonize yes
6.将redis加入到开机启动
vi /etc/rc.local //在里面添加内容:/usr/local/redis/bin/redis-server /usr/local/redis/etc/redis.conf (意思就是开机调用这段开启redis的命令)
7.开启redis
/usr/local/redis/bin/redis-server /usr/local/redis/etc/redis.conf
8.将redis-cli,redis-server拷贝到bin下,让redis-cli指令可以在任意目录下直接使用
cp /usr/local/redis/bin/redis-server /usr/local/bin/
cp /usr/local/redis/bin/redis-cli /usr/local/bin/
redis-server /usr/local/redis/etc/redis.conf //启动redis
pkill redis //停止redis
卸载redis:
rm -rf /usr/local/redis //删除安装目录
rm -rf /usr/bin/redis-* //删除所有redis相关命令脚本
rm -rf /root/download/redis-4.0.4 //删除redis解压文件夹
安装mpush
vi /opt/mpush/mpush-0.8.0/conf/mpush.conf
-------------------------------------------------------
mp.zk.server-address="127.0.0.1:2181"
mp.redis { //redis 集群配置
nodes:["127.0.0.1:6379"] //格式是ip:port
cluster-model:single //single, cluster
}
mp.net.local-ip="" //本地ip, 默认取第一个网卡的本地IP,如果是阿里云,就真的要写内网IP
mp.net.public-ip="" //外网ip, 默认取第一个网卡的外网IP
mp.net.ws-server-port=0 //websocket对外端口, 0表示禁用websocket
----------------------------------------------------------
cd /opt/mpush/mpush-0.8.0/bin
chmod u+x *.sh
./mp.sh start
Usage: ./mp.sh {start|start-foreground|stop|restart|status|upgrade|print-cmd}
set-env.sh用于增加和修改jvm启动参数,比如堆内存、开启远程调试端口、开启jmx等
查看服务是否启动成功
cd ../logs
cat mpush.out