CentOs73部署nginx+tomcat+redis集群说明_第1页
CentOs73部署nginx+tomcat+redis集群说明_第2页
CentOs73部署nginx+tomcat+redis集群说明_第3页
CentOs73部署nginx+tomcat+redis集群说明_第4页
CentOs73部署nginx+tomcat+redis集群说明_第5页
已阅读5页,还剩8页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

第1章操作参考Centos7.3参考命令配置网络连接[root@localhost〜]#vi/etc/sysconfig/network-scripts/ifcfg-ens33DEVICE=eth0#网卡设备名称ONBOOT=yes#启动时是否激活yes|noBOOTPROTO=static#协议类型固定IPdhcp(自动IP)bootpnoneIPADDR=#网络IP地址NETMASK=#网络子网地址GATEWAY=#网关地址DNS1=6#连接外网时,需要配置DNS[rootBloca1hostnetwark-scriptslitcatifcfgj-ens33TYTE=EthernetBOOTPBOTO=static®ErBOUTE=yesPEEBDHS=yespEERRWTES刃的IPU4_FAILURE_FATAL=noIPU6TNIT=yesIPU6_AUT0C0NF=yesIPU6_DEF3lOUTE=yesIPU6_PEEBDNS=yesIPU6_PEEBR0UTES=yesIPU6_rAILURE_FATAL=noIPU6_AM]l_GEN_M0DE=stable-prLvacyNAME=ens33加ID=%76c971-fe04-4438-ae67-80Z80266b5c2pEUICE=ens330HB00T=yesIPADDB=13Z.16a.l37.ZGATEWAY=13Z.168.137.1N£TT1ft5KN55.Z55.Z55.0msi=zii.i3a.24.66重启下网络服务#servicenetworkrestart查看改动后的效果#ipaddrErootBlacaIhostneiwork-scripts]ttipaddr1:lo:<LOOPEACK.UP.LOUER_UP>mtnS553BqdiscnoqueuestateUNKNOWNqlen1link./loopbackQ0:00:80:09:90:09brd00:Q0 :60"00:00inet127H0.0ul/8scopehostlova1id_1ftforeverpreferred_lftforeuerinet6::1^126scopehostva1id_1ftforeverpreferred_lftforeuer2:ens33:<BFOADCASTJMULTICAST,UP,LOLJER_UP>mtu1500qdiscpfifo_faststateUPqlenlink^ether00:Bc:29:?0"c3:69bpdff:ff:ff:ff:ff:£finet19Z.168E137.2/24Brd192.16B,137.255scopeglobalens33«^alid_lftForeverpreferred_lftforeverinet6feSB::4e4:ea:d67e:d2?b^64scope1ink«^alid_lftForeverpreferred_lftforever关闭防火墙systemctlstopfirewalld.service#停止firewallsystemctldisablefirewalld.service#禁止firewall开机启动firewall-cmd--state#查看默认防火墙状态(关闭后显示notrunning,开启后显示running)[raotia-LacalhoEt7#firewall-cmd--staterjrkriing[rootfalocalhost-]#systemctlstopfir&walld.service[rootfalacalhostsystemctldisablefirewalld.serviceRemovedsymlink/etc/systemtl/system/dbus-erg.fedoraproject.FirewallDl.service.Removedsymlink/etc/systemd/system/basic.target.wants/firewalld.service,[raotglacalhost-]#firewall-cmd--statenot「un门inqXshell连接虚拟机慢的解决方法原来是ssh的服务端在连接时会自动检测dns环境是否一致导致的,修改为不检测即可,操作如下:修改文件:/etc/ssh/sshd_configUseDNSyes>默认为注释行UseDNSno>把注释打开,改为no,然后重启ssh服务即可。JDK安装安装包:《server-jre-8u65-linux-x64.tar》。以root用户安装。进入目录cdopt授权chmod777server-jre-8u65-linux-x64.tar给予权限后显示绿色解压缩tar-xvfserver-jre-8u65-linux-x64.tar配置命令:vi/etc/profile。小心复制以下内容到命令行时,目录前多了一个空格,变成(JAVA_HOME=/opt/jdk1.8.0_65),导致配置出错。exportJAVA_HOME=/opt/jdk1.8.0_65exportPATH=$JAVA_HOME/bin:$PATHexportCLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar/etc/profileSystemwideanvironmentandstartupprograms(forloginsetupFunctionsandaliasesgoin/etc/bashrcIt'sMOTagoodideatochangethisfileunlessyouknouwhatyou集aredoing.It'smuctibettertocreatemciiEtoin.stishellscriptin#/etc/prafile.d/tomakecustomchangestoyourenvironment,asthis#willpreventtheneedfo「merginginfutureupdates.exportJMA_HQME=/Qpt/]dk1.8,0_55exportPATH=SJAVA_HOME^bin:$PATHexport<I,ASSPATH=7:$1卅A_H0ME八ib/dt.]m「伸JAVA_H0bEAib/tools,jarpathmunge什{case":^{PA7H}:"inif["$2"="after"];thenPATH=5PMM:$:lelsePATH=$1:$PA7Hfiesac注解:a.你要将/opt/jdk1.8.0_65改为你的jdk安装目录linux下用冒号":”来分隔路径$PATH/$CLASSPATH/$JAA_HOME是用来引用原来的环境变量的值在设置环境变量时特别要注意不能把原来的值给覆盖掉了,这是一种常见的错误。CLASSPATH中当前目录“不能丢,把当前目录丢掉也是常见的错误。export是把这三个变量导出为全局变量。f.大小写必须严格区分。命令(保存并退出)::wq!1.2.5使修改生效source/etc/profile查看进程jps[root^localliffstetc]#vi/etc/prafile[root(31ocalli9stetc]#source/etc/profile[root(31ocalli9stetc]#jps2485Jps查看java版本[roQt@localhQstetc]#java-versianjavaversion"L.S,&_65"Java^TH)SERuntimeEnvironment(build1.8.0_&5-bl7)JavaHotSpot(TMji64--BitServerVM(build25,65-bOLmixedmode)1.3apache-tomcat-7.0.67安装安装包:《apache-tomcat-7.0.67.tar.gz》。以普通用户安装。1-3-1授权[root@localhostopt]#chown-Rxjapache-tomcat-7.0.67.tar.gz[root@localhostopt]#suxj[xj@localhostetc]$cd/opt解压[xj@localhostopt]$tar-xzfapache-tomcat-7.0.67.tar.gz日常维护13.3.1启动服务在bin目录下面,运行命令shstartup.sh出现Bootstrap进程说明启动成功,可通过浏览器路径:8080/访问服务。8080为TOMCAT端口,可通过修改conf目录下server.xml设置。

[xjelocalhost[xjelocalhostbin)$shUsingCfiTALlNft.BASE:usingCftTi&LiNa_HfflE:UsingCfl1比IN匚百口工年UsingJRE.K'ME:UsingCLASSPATH:Tomcatstarted./opt/apache-tomcat-7.0.67/opt/apache-1oneat-7B9.57/opt/apache-toncat-7.0,67/t3ip/opt/]dkl.B.0_65/,cpt/apachB-tomcat-7.0.67/bin1/bootstrap-,jars/opt/apacho-toneat-7. in/toneat-jull.ja[xj'?!oralhostbinl$jps2627Jps2694Bootstrap停止服务在tomcatbin/下面,运行命令shshutdown.sh1.3.4请求tomcat服务:8080/mLsT.omcjn.i'7O.e7x ^3 —flX<- 。@1配1的137金创&0 IL:<r:■■:&igtfien期冲修mn附11rf川闻t的wr甲WlhliM痴Ki/ FindH0lpApacheTomcav7,0.67 ApacheSoftwareFoundmliiuni1/力'* R:*H!ilihg ■事msE-mut油-—-iorrtH『W・TDi.X7\Tz = 即MbMi:aiiDnHUMTO 第 CIU16HEfl!5«WMR・BteCgQflHCW~gDtvfdppvrQukK9t#rtTamB“SRb^tibAAAA风DCUaw5”gEKanriiriRb^tibAAAA风DCUaw5”gEKanriiriManagingTbnricatFo沁口刖忸*:w&aw i、&n#黄『"e&jccii&resTkxea.usa'aareciEnRritaT皿吠fhuNHnPxnraltQbcc™I。巾uf#ibj>w¥pW£ii曲niL华IIbWMAhiSfeTtfAHReadeh..R/l—她楠的电Cliangtd/DocuETiEritBhDnIbhWJE7.。口<!>»田由白frtMlHiToiiKitT』CafifmuxitKHi"fth*特tWIKIFinoMM"刖enfWIWCOiT^-MWfiir^WialkinntmiuMMK/EinnfewErRlwjmartwirtemlec-InMr*丁「日.由匚口区!也心GettingHelpFAGAndWailift9LhlftThe旧kwh口rurfhgkslsarea^alatielEvrcii-anriMrKBhpOfUPI刖网/由《热的* 藉CUT看tn.・附西上门nHfkiwi?(lETrtjmriUwmwEenddamaiwiiRh『叱iumii中的iaaacciEEMni13皿Sti:1.4redis安装授权[root@localhostopt]#chown-Rxjredis-3.0.5.tar.gz[root@localhostopt]#suxj[xj@localhostetc]$cd/opt解压[xj@localhostopt]$tar-xzfredis-3.0.5.tar.gz安装依赖包[root@localhostrpm]#rpm-ivhkernel-headers-3.10.0-514.el7.x86_64.rpm[root@localhostrpm]#rpm-ivhglibc-headers-2.17-157.el7.x86_64.rpm[root@localhostrpm]#rpm-ivhglibc-devel-2.17-157.el7.x86_64.rpm[root@localhostrpm]#rpm-ivhmpfr-3.1.1-4.el7.x86_64.rpm[root@localhostrpm]#rpm-ivhlibmpc-1.0.1-3.el7.x86_64.rpm[root@localhostrpm]#rpm-ivhcpp-4.8.5-11.el7.x86_64.rpm[root@localhostrpm]#rpm-ivhgcc-4.8.5-11.el7.x86_64.rpm[root@localhostrpm]#rpm-ivhtcl-8.5.13-8.el7.x86_64.rpm编译[xj@localhostredis-3.0.5]$makeMALLOC=libc[xj@localhostredis-3.0.5]$maketest经过一段时间的等待后,提示以下信息,表示检查成功。AUtestsp-assedwithmterrors查看、修改配置文件[xj@localhostrpm]$cd/opt/redis-3.0.5[xj@localhostredis-3.0.5]$catredis.conf

13iunitsaz"ecaseinse'naitivesc1GB1GbIgBareallttie.14手BydefaultRedxedoesnotnimasadaeiiQcn■Use'yes1if7ouDeedit-于Notethat willwriteapidfilein/var/run/zedis»pid.whendaeniDnized..17dscnioEiizen口IB19#和曰匚zumilnadaenionlzei,Rediswricesapldrilem/var/rmi/ieills.piibv2D*ilefault,Youcarsrecir7acustompidmelocationhere,pidfxle/var/run/redis/rsdis.pid23J九二口信工:七coimectionsonthespeciziedportfdefault±s6379.Ifpczt0isspeaifiedReciiawillnotlistenonaTCPsocket.25|p-工七后3r7926Ityouwaneyoocajibind,asinglelncexia.ceirerebind,opcionisnoc#BDeciiiedalltremtertaceswillLiBtenrar1Tleaminqconnecticrs.29至33bindqi1.4.6日常维护启动服务[xj@localhostredis-3.0.5]$cdsrc[xj@localhostsrc]$./redis-server&#显示以下图形则为成功:5&I1IRSF*S&lliF24F曲MdllP23F*』工恤Fqyird〜同rhE%q?EW5puuingstl«?t15&I1IRSF*S&lliF24F曲MdllP23F*导i23i2135工 CBfl't■t!!«■epenfiles-tiEfl-Gbtt&us?gf05we「i触utwnnetprmittrdLil;3l普阳工 7御・Ppff!tllW打洌”■6■C'LWwrShfl5 rEll(国B物』2CC^PWIIW旭「1WULVUaJt网hLDhC^"HKllflU?UKr«3P,ulIFlt-n!1fkka.e.s xbiti=uinLiiginsividaLoiN由已ran:unPCD::-IM:整1周?8RbBl?9l7l回X EICPMcH叫弓川I.厘讲n|r1gHmtbe 上旧叱 加加栓Iwrwf\.w讲12B.MdlRSF*闭办凶阻工女rm「Stjrtd,PWL5^TILWl3*35&iliF£€-F用13i3i2]一工WSRM1监t^n^KELtjiEry15irt1&即 mwt-dfftiLwikrtwpwqr口血twn.「◎Firthnusueadl.gmvercwsitj^r■3,t&ZrtCi'sirartl.inipiuMtbe^rrtwiQr!■晒g工wen,sywilgrvei■工WFlt_pfflanr-lfarliili律rrtw-HIej58dliP2fiF*Lii褥iZ:W』iiARWNSfdiihawTRifkEi: I1HPIaifKrtenstlirfthpwrkernel.Dl-3milc^MteUtwfanlworyu,wiiivti电力fieJiiiToHatin%LM-JtnnI:twcwsndMtnmgr-/t¥cA4nuL/MArarK^r4m_rugEf42«.i4f-ai)1tid'x^oit.hkIMlieto州片.'^t>:/nc.localinoEbcors品鼾:twMtIji口『fmranfai&t.Aadymetbfirxtirt4d』tr“THPitdlMhlod.到LH篦F曲U:K:2L犁地■g54F¥«r七mwra必caacu/tuiMCTLan£anaort4第L4.6.2测试服务[xj@localhostroot]$cd/opt/redis-3.0.5/src[xj@localhostsrc]$./redis-cli:6379>setfoobarOK:6379>getfoo"bar”

:6379>delfoo(integer)1:6379>getfoo(nil)14.6.3停止服务[xj@localhostsrc]$./redis-cli:6379>shutdownnotconnected>exit[xj(alocaltiastsrc]$./redis-cli127.D.0.1:6379c>shutdown5050:H28Feb58505050:H28Feb5850:H28Feb5850:H28Feb5850:H28Feb13:28:51.461#13:28:5.1,461*13:28:51.464*13:28:51.464#Savingthe-finalROESsnapshotbeforeexiting.DBsavedondislcRedisisnowreadytoexit,byet>ye...notconnected>exit[1],1■完成[1],1■完成1.5nginx安装授权[root@localhostopt]#chown-Rxjnginx-1.9.6.tar.gz[root@localhostopt]#suxj[xj@localhostetc]$cd/opt解压[xj@localhostopt]$tar-xzfnginx-1.9.6.tar.gz安装依赖包[root@localhostrpm]#rpm-ivhpcre-8.32-15.el7_2.1.x86_64.rpm[root@localhostrpm]#rpm-ivhpcre-devel-8.32-15.el7_2.1.x86_64.rpm[root@localhostrpm]#rpm-ivhzlib-1.2.7-17.el7.x86_64.rpm[root@localhostrpm]#rpm-ivhzlib-devel-1.2.7-17.el7.x86_64.rpm源码编译安装[xj@localhostnginx-1.9.6]$./configure--prefix=/opt/nginxConfiguratiarasummary4-usingsystanPCREIibrary4-GpenSSLlibraryisnotjs&d4-usingbuiltinmdscode¥sha1libraryisnotfound十usingsystemzlibIibrarynginx□己thpreiiK:"/opt/nginx"riginxbinaryfile:"/opt/nginx/sbin/nginx"nginxcoifiguratianpre'Fix:"/opt/nginx/conf"nginxcoifiguratianfile:"/npt/nginM/cGnf/rigiLnK.ctjnf”riginxpidfile:"/opt/nginx/logs/nginx.pid"riginxerrarlogfile:"/opt/nginx/lags/error,log"riginxlittpaccesslogfile:"/opt/nginx/logsZaccess.log"riginxlittpclientrequestbodytempararyfiles:"client_body_tempriginxlittppro?tytemporaryfiles;"firoxy_1:0np"riginxlittpfastcgitemporaryfiles;"fastegi-temp"nginxhttpuwsgitemporaryfiles:"uwsg^tsnp"nginxhttpsegitemporaryfiles:"scgi_temp"[xj@localhostnginx-1.9.6]$make[xj@localhostnginx-1.9.6]$makeinstall1.5.5日常维护#必须是root用户管理服务才能占用80端口。L5.5.1启动服务[root@localhostsbin]#cd/opt/nginx/sbin/[root@localhostsbin]#./nginxl-5-5-2停止服务[root@localhostsbin]#./nginx-sstop第10页重启服务[root@localhostsbin]#./nginx-sreloadl-5-5-4浏览器访问/Welcometonginx!Ifyouthispage,thenginxwebserverissuccessfillvinstalledandworking,Furtherconfiguiration2required.Foronlinedocimentationandsupportpleasertonginx.ogCommercialsupportisavailableat,Thankyouforusfngnginx.1-5-5-5查询nginx主进程号[root@localhostsbin]#ps-ef|grepnginx#在进程列表里面找master进程,它的编号就是主进程号了Eroot^lacalhostsbin]#ps-efgrepnginxroot124861013:547■00:&&:06nginx;masterprocess./nginxnobody1248712486013:5400:00:QOnginx:workerprocessroot1249912476013:58pts/160:39:06grep--calor=autong

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论