1. 程式人生 > 其它 >linux離線安裝軟體

linux離線安裝軟體

技術標籤:linux

1 安裝zip和unzip

1.上傳檔案zip和unzip安裝包

百度雲盤路徑:/安裝包/linux/zip

unzip-6.0-21.el7.x86_64.rpm
zip-3.0-11.el7.x86_64.rpm 

2.解壓安裝

rpm -ivh unzip-6.0-21.el7.x86_64.rpm
rpm -ivh zip-3.0-11.el7.x86_64.rpm 

2 安裝JDK

1.解除安裝舊版

rpm -qa | grep java

rpm -e --nodeps tzdata-java-2015a-1.el7.noarch
rpm -e --nodeps  java-1.7.0-openjdk-headless-1.7.0.75-2.5.4.2.el7_0.x86_64
rpm -e --nodeps  java-1.7.0-openjdk-1.7.0.75-2.5.4.2.el7_0.x86_64

2.上傳解壓安裝包

百度雲盤路徑:/安裝包/linux/jdk

cd /usr/local/src/jdk
tar -zxvf jdk-8u161-linux-x64.tar.gz
mv jdk1.8.0_161  jdk1.8

3.配置環境變數

export JAVA_HOME=/usr/local/src/jdk/jdk1.8
export PATH=$PATH:$JAVA_HOME/bin
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

4.更新配置檔案

source /etc/profile

5.檢視jdk版本

java -version

3 安裝rocketmq叢集

1.建立安裝目錄,上傳壓縮包:

百度雲盤路徑:/安裝包/linux/rocketmq

cd /usr

2.解壓:

unzip rocketmq-all-4.3.2-bin-release.zip
mv rocketmq-all-4.3.2-bin-release rocketmq
cd rocketmq

3.啟動nameserver

#一般啟動:
/usr/rocketmq/bin/mqnamesrv 
#後臺啟動
sh /usr/rocketmq/bin/mqnamesrv &
#看日誌:
sh /usr/rocketmq/rocketmq/bin/mqnamesrv >>
/logs/namesrv.log 2>&1 & #指定配置檔案: sh /usr/rocketmq/bin/mqnamesrv -c /usr/rocketmq/conf/namesrv-a.properties > /dev/null /usr/rocketmq/logs/mqnamesrv.log 2>&1 & #關閉namesrv服務: sh /usr/rocketmq/bin/mqshutdown namesrv

4.配置2m2s叢集

進入rocketmq的conf資料夾進行配置

broker-a-master

#叢集名稱
brokerClusterName = rmqCluster
brokerName = broker-a
#master為0,slave為1
brokerId = 0
# 這個ip配置為內網訪問,讓mq只能內網訪問,不配置預設為內網
brokerIP1 = 172.0.0.10
brokerIP2 = 172.0.0.10
#資料清除時間 凌晨4點
deleteWhen = 04
#清除48小時之前的資料
fileReservedTime = 48
#Broker角色
brokerRole = SYNC_MASTER
#刷盤方式
flushDiskType = ASYNC_FLUSH
# nameserver的地址,如果只有一個nameserver,填一個即可
namesrvAddr=172.0.0.1:9876;172.0.0.2:9876
autoCreateTopicEnable=true
#Broker 對外服務的監聽埠,
listenPort = 10911
#Broker角色
#- ASYNC_MASTER 非同步複製Master
#- SYNC_MASTER 同步雙寫Master
#- SLAVE
#brokerRole=SLAVE
#刷盤方式
#- ASYNC_FLUSH 非同步刷盤
#- SYNC_FLUSH 同步刷盤
#flushDiskType=SYNC_FLUSH

broker-a-slave

brokerClusterName = rmqCluster
brokerName = broker-a
brokerId = 1
brokerIP1 = 172.0.0.11
deleteWhen = 04
fileReservedTime = 48
brokerRole = SLAVE
flushDiskType = ASYNC_FLUSH
namesrvAddr=172.0.0.1:9876;172.0.0.2:9876
autoCreateTopicEnable=true
listenPort = 10911

broker-b-master

brokerClusterName = rmqCluster
brokerName = broker-b
brokerId = 0
brokerIP1 = 172.0.0.20
brokerIP2 = 172.0.0.20
deleteWhen = 04
fileReservedTime = 48
brokerRole = SYNC_MASTER
flushDiskType = ASYNC_FLUSH
namesrvAddr=172.0.0.1:9876;172.0.0.2:9876
autoCreateTopicEnable=true
listenPort = 10911

broker-b-slave

brokerClusterName = rmqCluster
brokerName = broker-b
brokerId = 1
brokerIP1 = 172.0.0.21
deleteWhen = 04
fileReservedTime = 48
brokerRole = SLAVE
flushDiskType = ASYNC_FLUSH
namesrvAddr=172.0.0.1:9876;172.0.0.2:9876
autoCreateTopicEnable=true
listenPort = 10911

5.啟動broker

#修改記憶體:
vim /usr/rocketmq/bin/runbroker.sh
#指定nameserver地址和埠:
nohup sh /usr/rocketmq/bin/mqbroker -n localhost:9876 &
#指定配置檔案:
nohup sh /usr/rocketmq/rocketmq/bin/mqbroker -c /usr/rocketmq/rocketmq/conf/broker.conf >>/logs/broker.log 2>&1 &
#關閉 :
sh  /usr/rocketmq/bin/mqshutdown broker  

6.檢視日誌

tail -f ~/logs/rocketmqlogs/namesrv.log
tail -f ~/logs/rocketmqlogs/broker.log

7.資料清除:

rm -rf /root/logs/rocketmqlogs/*
rm -rf /root/store/*

4 安裝jmeter

1.壓縮包上傳到伺服器

百度雲盤路徑:安裝包/linux/jmeter

2.解壓縮

cd /usr/local
unzip apache-jmeter-5.3.zip

3.配置Jmeter環境變數,再新增如下變數

vim /etc/profile
export JMETER_HOME=/usr/local/jmeter
export CLASSPATH=$JMETER_HOME/lib/ext/ApacheJMeter_core.jar:$JMETER_HOME/lib/jorphan.jar:$CLASSPATH
export PATH=$JMETER_HOME/bin:$PATH

檢查

source /etc/profile 
jmeter -v

測試

jmeter -n -t /home/jessica/httpThread.jmx -l log.jtl
#-n:以NoGUI方式執行指令碼
#-t:後面接指令碼名稱
#-l:後面接日誌名稱,儲存執行結果

5 安裝nginx

1.上傳解壓安裝gcc和gcc-c++

百度雲盤路徑:安裝包/linux/nginx

2 安裝gcc和gcc-c++

cd /usr/local/src
cd /usr/local/src/nginx/gcc
rpm -Uvh *.rpm --nodeps --force
cd /usr/local/src/nginx/gcc-c++
rpm -Uvh *.rpm --nodeps --force

3.檢查

gcc -v
g++ -v

4.安裝PCRE

cd /usr/local/src/nginx 
tar -zxvf pcre-8.35.tar.gz
cd pcre-8.35
./configure
make
make install

5.安裝libtool

cd /usr/local/src/nginx    
tar -zxvf libtool-2.4.2.tar.gz
cd libtool-2.4.2
./configure
make
make install

6.安裝nginx

cd /usr/local/src/nginx    
tar -zxvf nginx-1.13.9.tar.gz
cd nginx-1.13.9
./configure
make
make install

7.常用命令

#啟動nginx :   nginx安裝目錄地址 -c nginx配置檔案地址
#安裝後的路徑好像會被變到/usr/local  裡面
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
#停止nginx
/usr/local/nginx/sbin/nginx -s stop (quit)                                       
#重啟
/usr/local/nginx/sbin/nginx -s reload                                   
# 檢視端口占用
netstat -tunlp                                                                           
#   檢視指定埠
netstat -tunlp |grep                                                                     
#nginx的配置檔案為安裝目錄下的nginx目錄中的nginx.conf,預設埠為80,啟動後出現如下頁面即為啟動成功

8.負載均衡配置:

 #gzip  on;
	upstream receive{
		server 192.168.0.1:8082; #第一個站點
		server 192.168.0.1:8083; #第二個站點
	}
    server {
        listen       8081;
        server_name  localhost;
        location / {
          proxy_pass http://receive;  #轉發或處理
        }
        #error_page  404              /404.html;

軟體連線
連結:https://pan.baidu.com/s/1u4Os0MM8Uhu2HLjopXZYgA
提取碼:istl
複製這段內容後開啟百度網盤手機App,操作更方便哦