1. 程式人生 > >mPush實戰筆記1伺服器環境

mPush實戰筆記1伺服器環境

主機 IP
Redis 103.246.161.44 6379
ZooKeeper 103.246.161.44 2181
Mpush 103.246.161.44 3000
Alloc 103.246.161.44 9999

伺服器版本為Centos7,最小化安裝。

note:

1)最小化安裝,預設網絡卡沒有開機自動啟動,可以編輯網絡卡檔案(預設為ifcfg-eth0),將ONBOOT修改為yes

[[email protected] ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth0

ONBOOT=yes

2)安裝系統基本依賴包,用於編譯安裝軟體

[[email protected] ~]# yum install net-tools vim wget make gcc g++ gc++ -y

3)關閉防火牆和SELinux,防止系統干擾導致部署不成功

[[email protected] ~]# setenforce 0

[[email protected] ~]# iptables -F

[[email protected] ~]# iptables -X

安裝JDK

[[email protected]

app]# ll

-rw-------. 1 root root 181352138 Sep 6 22:54 jdk-8u101-linux-x64.tar.gz

1、安裝JDK並設定環境變數

[[email protected] app]# tar xf jdk-8u101-linux-x64.tar.gz

[[email protected] app]# ln -s jdk1.8.0_101 jdk

設定JAVA環境變數

[[email protected] app]# vim /etc/profile.d/java.sh

JAVA_HOME=/app/jdk

PATH=$JAVA_HOME/bin:$PATH

CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

export JAVA_HOME PATH CLASSPATH

給指令碼執行許可權

[[email protected] app]# chmod +x /etc/profile.d/java.sh

講JAVA環境變數應用到當前shell

[[email protected] app]# source /etc/profile.d/java.sh

[[email protected] app]# java -version

java version "1.8.0_101"

Java(TM) SE Runtime Environment (build 1.8.0_101-b13)

Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)