JAVA
下載 https://www.oracle.com/technetwork/java/javase/downloads/index.html
操作
tar -zxvf jdk-8u201.tar.gz
vi /etc/profile
#尾部添加并保存
#java
export JAVA_HOME=/usr/local/jdk1.8.0_201
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib
source /etc/profile
驗證
java -version.png
java -version.png
MYSQL
下載
wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm
操作
yum localinstall mysql57-community-release-el7-8.noarch.rpm
yum install mysql-community-server
#啟動mysql服務
systemctl start mysqld
#設置開機啟動
systemctl enable mysqld
systemctl daemon-reload
#不能登錄時設置自定義密碼
#先找到原始密碼抛腕,然后登錄設置自定義密碼
grep 'temporary password' /var/log/mysqld.log
set password for 'root'@'localhost'=password('1234');
#設置MYSQL默認字符集
/etc/my.cnf
character_set_server=utf8
init_connect='SET NAMES utf8'
配置MYCAT
wget http://dl.mycat.io/1.6-RELEASE/Mycat-server-1.6-RELEASE-20161028204710-linux.tar.gz
tar -zxvf Mycat-server-1.6-RELEASE-20161028204710-linux.tar.gz
schema.xml / rule.xml ... mycat相關文件配置看自己 MYCAT官網(wǎng)鏈接
REDIS(主備機+哨兵模式)
下載 (版本自己選擇對應地址)
wget http://download.redis.io/releases/redis-4.0.11.tar.gz
操作
#安裝箍铲,提示缺少什么包就直接安裝什么包類似(yum install gcc)
make MALLOC=libc
make install
vim redis.conf
#主機器修改內容如下:
bind 127.0.0.1 #這一行注釋掉
protected-mode yes #改為protected-mode no
daemonize no #改為daemonize yes
logfile "" #改為logfile"/var/log/redis.log"
masterauth xxxxx
requirepass xxxxx
#在備機器上重復上述操作
#在備機器上添加主:
slaveof x.x.x.x<主機器IP> 6379
#在主機器上
vi sentinel.conf
sentinel known-slave mymaster xxx.xxx.xxx.xxx<備機IP> 6379
sentinel current-epoch 2
logfile "/var/log/sentinel.log"
daemonize yes
sentinel monitor mymaster xxx.xxx.xxx.xxx<主機IP> 6379 1
sentinel auth-pass mymaster xxxx
#啟動2個redis
./src/redis-server ./redis.conf
#啟動監(jiān)聽
./src/redis-sentinel ./sentinel.conf
驗證
Redis服務開啟
互為主備
互為主備
ZOOKEEPER
下載 (版本自己選擇對應地址)
wget https://mirrors.tuna.tsinghua.edu.cn/apache/zookeeper/zookeeper-3.4.14/zookeeper-3.4.14.tar.gz
操作
vi /etc/profile
#結尾處添加
#zk
export ZOOKEEPER_HOME=/usr/local/zookeeper-3.4.14/
export PATH=$ZOOKEEPER_HOME/bin:$PATH
export PATH
vi zoo.cfg
dataDir=/usr/local/zookeeper/zookeeper-3.4.10/data
dataLogDir=/usr/local/zookeeper/zookeeper-3.4.10/logs
# 啟動/停止/查看狀態(tài)
./bin/zkServer.sh start(stop/restart/status)
驗證
zookeeper啟動
NGINX
下載 (版本自己選擇對應地址)
wget -c https://nginx.org/download/nginx-1.10.2.tar.gz
操作
#安裝4個組件
yum install gcc-c++
yum install -y pcre pcre-devel
yum install -y zlib zlib-devel
yum install -y openssl openssl-devel
tar -zxvf nginx-1.10.2.tar.gz
cd nginx-1.10.2
#配置安裝4大模塊
./configure --user=nobody --group=nobody --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_gzip_static_module --with-http_realip_module --with-http_sub_module --with-http_ssl_module
make && make install
#配置生成的nginx.conf
cd /usr/local/nginx
vi conf/nginx.conf
#NGINX啟動、重啟济瓢、停止
./sbin/nginx -t
./sbin/nginx
(./sbin/nginx -s reload
./sbin/nginx -s stop)
驗證
NGINX首頁訪問
====================完畢===============================
====================有問題請留言=========================