碼迷,www.tparu.icu
吉利平特名人堂 > 編程語言 > 詳細

桂平特产蛤蚧:java項目高可用實現配置(包括nginx、redis、keepalived、ekl、filebeat、java、tomcat)

時間:2019-05-23 18:18:11      閱讀:47      評論:0      收藏:0      [點我收藏+]

吉利平特名人堂 www.tparu.icu 標簽:filebeat   i18n   安裝文件   用戶   gsm   鏈接   eve   hup   min   

0、涉及安裝包和配置文件下載

鏈接: https://pan.baidu.com/s/1xNYgrk8V_bB86WbRo8mNxg 提取碼: mxzk 

鏈接: https://pan.baidu.com/s/1ii64LcqhySegSMaDu5vlOg 提取碼: gu3s 

1、jdk安裝

tar -zxzf jdk-8u144-linux-x64.tar.gz

ln -s jdk1.8.0_144/ /usr/local/jdk

vim /etc/profile

 

source /etc/profile

 

#set java environment

JAVA_HOME=/usr/local/src/jdk1.8.0_144

JRE_HOME=$JAVA_HOME/jre

CLASS_PATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib

PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin

export JAVA_HOME JRE_HOME CLASS_PATH PATH

 

2、tomcat安裝

tar -zxzf apache-tomcat-8.5.41.tar.gz

mv apache-tomcat-8.5.41/ /usr/local/tomcat

 

URIEncoding="UTF-8" maxPostSize="-1"

 

#啟動時報host錯誤時,

vi /etc/hosts

在127.0.0.1后加上機器名

 

3、Gcc 離線安裝

cd /usr/local/src/gcc/

rpm -ivh linux-glibc-devel-3.9-1.1.noarch.rpm 

rpm -ivh glibc-devel-2.22-8.4.x86_64.rpm 

rpm -ivh cpp48-4.8.5-196.1.x86_64.rpm 

rpm -Uvh cpp48-4.8.5-196.1.x86_64.rpm 

rpm -ivh libasan0-4.8.5-196.1.x86_64.rpm 

rpm -ivh libatomic1-4.8.5-196.1.x86_64.rpm 

rpm -ivh libgomp1-4.8.5-196.1.x86_64.rpm 

rpm -ivh libtsan0-4.8.5-196.1.x86_64.rpm 

rpm -ivh libitm1-4.8.5-196.1.x86_64.rpm 

rpm -ivh gcc48-4.8.5-196.1.x86_64.rpm 

rpm -ivh gcc-4.8-6.68.x86_64.rpm 

rpm -ivh libstdc++48-devel-4.8.5-196.1.x86_64.rpm 

rpm -ivh libstdc++-devel-4.8-6.68.x86_64.rpm 

rpm -ivh gcc48-c++-4.8.5-196.1.x86_64.rpm 

rpm -ivh gcc-c++-4.8-6.68.x86_64.rpm 

gcc -v

 

若安裝出現版本沖突時,使用rpm -Uvh更新

 

4、nginx安裝

 

安裝依賴

 

tar -zxzf pcre-8.38.tar.gz 

cd pcre-8.38/

./configure && make && make install

cd ../

tar -zxzf zlib-1.2.11.tar.gz 

cd zlib-1.2.11/

./configure && make && make install

cd ../

tar -zxzf openssl-1.1.1b.tar.gz 

 

安裝nginx

tar -zxzf nginx-1.14.2.tar.gz 

cd nginx-1.14.2/

./configure --sbin-path=/usr/local/nginx/nginx --conf-path=/usr/local/nginx/nginx.conf --pid-path=/usr/local/nginx/nginx.pid --with-http_ssl_module --with-pcre=/usr/local/src/pcre-8.38 --with-zlib=/usr/local/src/zlib-1.2.11 --with-openssl=/usr/local/src/openssl-1.1.1b

make && make install

cp /usr/local/nginx/nginx /usr/bin/

cp /usr/local/nginx/nginx.conf /etc/nginx.conf

 

 

 

 

 

若安裝出現openssl問題可以把--with-openssl=/usr/local/src/openssl-1.1.1b暫時不用

 

5、redis安裝

 

tar -zxzf redis-5.0.4.tar.gz

cd redis-5.0.4/

make MALLOC=libc

cp src/redis-server /usr/bin/

cp src/redis-cli /usr/bin/

cp redis.conf /etc/

 

6、keepalived安裝

 

 

tar -zxzf keepalived-2.0.15.tar.gz 

cd keepalived-2.0.15/

./configure --prefix=/usr/local/keepalived

make && make install

 

cp /usr/local/keepalived/etc/sysconfig/keepalived  /etc/sysconfig/keepalived

cp /usr/local/keepalived/sbin/keepalived /usr/sbin/keepalived

cp /usr/local/src/keepalived-2.0.15/keepalived/etc/init.d/keepalived /etc/init.d/

mkdir /etc/keepalived

cp /usr/local/keepalived/etc/keepalived/keepalived.conf /etc/keepalived/keepalived.conf

chkconfig -add keepalived

 

#開機自啟動

chkconfig keepalived on

 

 

#可能需要依賴libopenssl-devel,使用zypper安裝

zypper in libopenssl-devel

 

7、redis高可用

 

配置文件:/temp/linux安裝文件/config/redis-keepalived

 

 

redis-server /etc/redis.conf 

keepalived

 

#sh文件賦予執行權限

chmod +x /etc/keepalived/*.sh

 

redis-cli -a 123456 shutdown

killproc keepalived

 

 

 

Log目錄

 

/var/log/message

/var/log/keepalived-redis-check.log

/var/log/keepalived-redis-state.log

 

 

8、nginx 高可用

 

配置文件:/temp/linux安裝文件/config/nginx-keepalived

 

 

nginx

keepalived

 

#sh文件賦予執行權限

chmod +x /etc/keepalived/*.sh

 

Nginx -s stop

killproc keepalived

 

 

 

 

Log目錄

/var/log/message

 

9、elasticsearch安裝 

 

 

cd /usr/local/src/

tar -zxzf elasticsearch-7.1.0-linux-x86_64.tar.gz 

mv elasticsearch-7.1.0/ /usr/local/elasticsearch

cd ../elasticsearch/bin

#啟動

./elasticsearch  

#后臺啟動

./elasticsearch -d

 

 

#配置文件

/temp/linux安裝文件/config/elasticsearch.yml

 

#不能使用root用戶允許,創建用戶

useradd elastic

chown -R elastic /usr/local/elasticsearch/

su elastic

 

#配置log統一路徑,賦予權限給新用戶

mkdir -p /usr/local/data/elasticsearch/log /usr/local/data/elasticsearch/data

chown -R elastic /usr/local/data/elasticsearch

chmod 777 /usr/local/data/elasticsearch

 

 

#修改系統配置

vim /etc/sysctl.conf

vm.max_map_count=655360

 

vim /etc/security/limits.conf

* soft nofile 65536

* hard nofile 131072

* soft nproc 4096

* hard nproc 4096

* hard memlock unlimited

* soft memlock unlimited

*  - as unlimited

 

#訪問路徑

//192.168.1.203:9200

 

#刪除所有日志

curl -XDELETE //192.168.1.203:9200/_all

 

10、kibana安裝

 

cd /usr/local/src/

tar -zxzf kibana-7.1.0-linux-x86_64.tar.gz

mv kibana-7.1.0-linux-x86_64 ../kibana

cd ../kibana/bin

./kibana

 

#后臺啟動

nohup ./kibana &

 

#配置文件

/temp/linux安裝文件/config/kibana.yml

 

#支持中文

i18n.locale: "zh-CN"

 

11、logstash安裝

 

 

cd /usr/local/src/

tar -zxzf logstash-7.1.0.tar.gz

mv logstash-7.1.0 ../logstash

cd ../logstash/bin

./logstash -f ../config/logstash.conf

 

#后臺啟動

nohup ./logstash -f ../config/logstash.conf &

 

12、filebeat安裝

 

cd /usr/local/src/

tar -zxzf filebeat-7.1.0-linux-x86_64.tar.gz

mv filebeat-7.1.0-linux-x86_64 ../filebeat

cd ../filebeat/

 ./filebeat 

 

 

#后臺啟動

nohup ./filebeat &

java項目高可用實現配置(包括nginx、redis、keepalived、ekl、filebeat、java、tomcat)

標簽:filebeat   i18n   安裝文件   用戶   gsm   鏈接   eve   hup   min   

原文地址:https://www.cnblogs.com/llmke/p/10913369.html

(0)
(0)
   
舉報
評論 一句話評論(0
0條  
登錄后才能評論!
? 2014 吉利平特名人堂 版權所有 京ICP備13008772號-2
迷上了代碼!
2015年3d走势图带线 pk10精准计划网站 彩票站点申请 足球计算器让球胜平负 幸运飞艇买3码怎么倍投 比分直播下载 微信买大小单双 极速pk10免费计划软件 拼十牛牛先翻4张看牌抢庄 双色球进五走势图 双人斗地主游戏 大乐透预测大乐透开奖 新号送分的打鱼10000 海南彩票七星彩开奖结果 斗牛游戏下载 快三技巧数学公式