【博狗新闻】8pdy Linux节点环境搭建

  • A+
所属分类:行业新闻
摘要

环境搭建: jdk1.8,git,maven,tomcat8工具安装路径:java : /usr/local/jdk1.8maven : /usr/local/apache-maven-3.6.2git : /usr/local/gittomcat: /usr/local/apache-tomcat-8.5.46

博狗网站地址是多少-博狗亚洲在线娱乐城百家乐:www.bogoupoker.com

大发扑克|dafapoker|大发在线德州扑克|大发德州扑克策略网站——大发游戏导航(dfyxdh.com)

迈博myball最新网站|迈博体育官网|最好玩的体育直播观看平台——迈博体育导航(mbo388.com)

8pdy

【博狗新闻】8pdy Linux节点环境搭建

环境搭建: jdk1.8,git,maven,tomcat8
工具安装路径:

java : /usr/local/jdk1.8
maven : /usr/local/apache-maven-3.6.2
git : /usr/local/git
tomcat: /usr/local/apache-tomcat-8.5.46

1,开启ssh

[root@VM_0_6_centos ~]# netstat -anp|grep :22tcp        0      0 0.0.0.0:22              0.0.0.0:*            tcp        0     36 172.16.0.6:22           211.161.248.60:22447 [root@VM_0_6_centos ~]# service sshd startRedirecting to /bin/systemctl start sshd.service

2,关闭防火墙(内网环境相对安全)

安装iptables
如果你要改用iptables的话,需要安装iptables服务:

#安装sudo yum install iptables-services #开启iptablessudo systemctl enable iptables sudo systemctl enable ip6tables #启动服务sudo systemctl start iptables sudo systemctl start ip6tables

关闭防火墙

[root@VM_0_6_centos ~]# service iptables stopRedirecting to /bin/systemctl stop iptables.service[root@VM_0_6_centos ~]# service iptables statusRedirecting to /bin/systemctl status iptables.service● iptables.service - IPv4 firewall with iptables   Loaded: loaded (/usr/lib/systemd/system/iptables.service; enabled; vendor preset: disabled)   Active: inactive (dead) since Thu 2019-09-26 21:28:33 CST; 6s ago  Process: 9537 ExecStop=/usr/libexec/iptables/iptables.init stop (code=exited, status=0/SUCCESS)  Process: 9354 ExecStart=/usr/libexec/iptables/iptables.init start (code=exited, status=0/SUCCESS) Main PID: 9354 (code=exited, status=0/SUCCESS)Sep 26 21:27:28 VM_0_6_centos systemd[1]: Starting IPv4 firewall with iptables...Sep 26 21:27:28 VM_0_6_centos iptables.init[9354]: iptables: Applying firewall rules: [  OK  ]Sep 26 21:27:28 VM_0_6_centos systemd[1]: Started IPv4 firewall with iptables.Sep 26 21:28:33 VM_0_6_centos systemd[1]: Stopping IPv4 firewall with iptables...Sep 26 21:28:33 VM_0_6_centos iptables.init[9537]: iptables: Setting chains to policy ACCEPT: filte...  ]Sep 26 21:28:33 VM_0_6_centos iptables.init[9537]: iptables: Flushing firewall rules: [  OK  ]Sep 26 21:28:33 VM_0_6_centos systemd[1]: Stopped IPv4 firewall with iptables.Hint: Some lines were ellipsized, use -l to show in full.[root@VM_0_6_centos ~]# 

Stopped IPv4 firewall with iptables 说明防火墙已关闭

2,安装 jdk

2.1 方式一:普通安装方式:(下载慢)

yum install javajava -version

2.2 方式二:安装指定版本:java1.8(下载慢)

  • 在线下载jdk (下载比较慢)
wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.rpm
  • 赋权限
chmod +x jdk-8u131-linux-x64.rpm
  • 进行安装
rpm -ivh jdk-8u131-linux-x64.rpm
  • 查看是否安装成功
java -version

默认安装路径为 /usr/java/jdk1.8.0_131

  • 编辑环境变量
vim /etc/profile

环境变量为

export JAVA_HOME=/usr/java/jdk1.8.0_131export PATH=$JAVA_HOME/bin:$PATH export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar 
  • 使得配置立即生效
source /etc/profile
  • 查看是否安装成功
javacjava -versionecho $PATH

2.3 方式三:下载jdk1.8上传linux服务器(安装快-推荐)

下载:jdk-8u221-linux-x64.tar.gz
放到 /usr/local ,解压

tar -zxvf jdk-8u221-linux-x64.tar.gz

改名 jdk1.8

mv jdk1.8.0_221 jdk1.8
[root@VM_0_6_centos local]# lsbin  etc  games  include  jdk1.8  lib  lib64  libexec  qcloud  sbin  share  src  yd.socket.server

配置jdk1.8环境变量

[root@VM_0_6_centos jdk1.8]# pwd/usr/local/jdk1.8[root@VM_0_6_centos jdk1.8]# vi /etc/profile

环境变量为:

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

退出文件,保存
按Esc键 输入:wq 保存并退出
让配置文件生效:

[root@VM_0_6_centos jdk1.8]# source /etc/profile

查看是否配置成功:

[root@VM_0_6_centos jdk1.8]# java -versionjava version "1.8.0_221"

若出现jdk版本号,则安装并配置环境变量成功
如果提示命令找不到的话,查看一下jdk的配置路径是否错误。

删除安装包(可选):rm -rf jdk-8u221-linux-x64.tar.gz

3、安装 git

方式一:git安装(旧版本)

[root@VM_0_6_centos local]# yum install git[root@VM_0_6_centos local]# git --versiongit version 1.8.3.1

方式二:gti安装(最新版本—推荐)

1、获取github最新的Git安装包下载链接,下载新版本 git-2.9.5.tar.gz 上传到linux;
2、压缩包解压:

sudo tar -zxvf git-2.9.5.tar.gz

3、进入解压后的文件夹:

cd git-2.9.5

4、执行编译:耐心等待编译即可

make prefix=/usr/local/git all

5、安装Git至/usr/local/git路径,命令为

make prefix=/usr/local/git install

6、打开环境变量配置文件,命令 ,在底部加上Git相关配置信息:

vim /etc/profile

PATH=$PATH:/usr/local/git/bin
export PATH

然后wq保存,退出!
让配置文件生效:

source /etc/profile

7、输入命令 git --version ,查看安装的git版本,校验通过,安装成功。
8、删除安装包(可选):rm -rf git-2.9.5.tar.gz
9、查看git安装路径:
Linux-如果不清楚自己的Git安装在哪个路径下,终端执行

whereis git

配置:/usr/local/git/bin/git

生成ssh密钥及配置git

ssh公钥可以配置gitlab、github等,
ssh私钥可配置jenkins凭证等。
用户和邮箱不要求真实

[root@VM_0_6_centos ~]# git config --global user.name "zhengja"[root@VM_0_6_centos ~]# git config --global user.email "[email protected]"[root@VM_0_6_centos ~]# ssh-keygen -t rsa -C "[email protected]"Enter file in which to save the key (/root/.ssh/id_rsa):Generating public/private rsa key pair.Enter file in which to save the key (/root/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /root/.ssh/id_rsa.Your public key has been saved in /root/.ssh/id_rsa.pub.The key fingerprint is:SHA256:EqKVJUBpxVYpswJifGiXyplLTUcBYFNaMxaODZQPUmc [email protected] key's randomart image is:+---[RSA 2048]----+|oOO&E++.         ||=B%BB=.          ||*=@+=+.          || *.=.. .         ||. o.  . S        || .     .         ||                 ||                 ||                 |+----[SHA256]-----+

拿到公钥配置gitlab: (也可以配置github等)

[root@VM_0_6_centos local]# cd /root/.ssh/[root@VM_0_6_centos .ssh]# lsauthorized_keys  id_rsa  id_rsa.pub  known_hosts[root@VM_0_6_centos .ssh]# vim id_rsa.pub 

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDcArp9fBpi7CWJ50dQQTHbLfRkMyhVuox7bFEeYu3kaFYO3ECInfiBEK8PdYAKPjGWRirYQGCBQlsSzGd4F3sVTQH4ePk0bk/iAwnZsgOBgMgyZW6c00u+afJ/h8PNRK2xr60kB3n4no4UDov4hsuGdCKhavrHRzs3s6H+b7WKxILdSwZ7BpduGZGCOug8JtcnwF1mmMKi0YH0KrIxnrOR9GHT+wHAyJ5WjYU4Xzr+ZIGN6MfrM7X99y/uyMsrv8nzliMxWpFxduYAkKkfrqf46Y18oZfn5VdXhfnvyd+FqWTPdtJF2EZtKdhwGnouuyTdESQP3PPacFM1ZeW58R/T [email protected]

【博狗新闻】8pdy Linux节点环境搭建

【博狗新闻】8pdy Linux节点环境搭建

测试:git命令克隆sshUrl到本地

git clone sshURL

4、安装 maven

下载 apache-maven-3.6.2-bin.zip ,上传到linux系统并解压

[root@VM_0_6_centos local]# lsapache-maven-3.6.2-bin.zip  etc    include  lib    libexec  sbin   srcbin                         games  jdk1.8   lib64  qcloud   share  yd.socket.server[root@VM_0_6_centos local]# unzip apache-maven-3.6.2-bin.zip [root@VM_0_6_centos local]# lsapache-maven-3.6.2          bin  games    jdk1.8  lib64    qcloud  share  yd.socket.serverapache-maven-3.6.2-bin.zip  etc  include  lib     libexec  sbin    src

配置maven环境变量:

[root@VM_0_6_centos apache-maven-3.6.2]# pwd/usr/local/apache-maven-3.6.2[root@VM_0_6_centos apache-maven-3.6.2]# vim /etc/profile

末尾添加(路径要正确)

export MAVEN_HOME=/usr/local/apache-maven-3.6.2export PATH=$MAVEN_HOME/bin:$PATH

重新加载配置-->测试maven是否配置成功

[root@VM_0_6_centos apache-maven-3.6.2]# . /etc/profile[root@VM_0_6_centos apache-maven-3.6.2]# mvn -versionApache Maven 3.6.2 (40f52333136460af0dc0d7232c0dc0bcf0d9e117; 2019-08-27T23:06:16+08:00)Maven home: /usr/local/apache-maven-3.6.2Java version: 1.8.0_221, vendor: Oracle Corporation, runtime: /usr/local/jdk1.8/jre

删除安装包(可选):rm -rf apache-maven-3.6.2-bin.zip

5、安装 tomcat

下载 tomcat8 ,上传到linux,并解压

[root@VM_0_6_centos local]# unzip apache-tomcat-8.5.46.zip [root@VM_0_6_centos local]# lsapache-maven-3.6.2        bin    include  lib64    sbin   yd.socket.serverapache-tomcat-8.5.46      etc    jdk1.8   libexec  shareapache-tomcat-8.5.46.zip  games  lib      qcloud   src

配置tomcat
给tomcat下的所有文件授给任何人都可执行的权限

[root@VM_0_6_centos local]# cd apache-tomcat-8.5.46/[root@VM_0_6_centos apache-tomcat-8.5.46]# chmod a+x -R *

修改tomcat端口为8090

[root@VM_0_6_centos apache-tomcat-8.5.46]# vim conf/server.xml

<Connector port="8090" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />

启动tomcat:

[root@VM_0_6_centos apache-tomcat-8.5.46]# bin/startup.sh

查看tomcat是否启动成功:

[root@VM_0_6_centos apache-tomcat-8.5.46]# ps -ef|grep tomcat

root 22857 1 29 19:12 pts/0 00:00:02 /usr/local/jdk1.8/bin/java -Dcatalina.base=/usr/local/apache-tomcat-8.5.46 -Dcatalina.home=/usr/local/apache-tomcat-8.5.46 -Djava.io.tmpdir=/usr/local/apache-tomcat-8.5.46/temp org.apache.catalina.startup.Bootstrap start
root 27474 19080 0 10:10 pts/0 00:00:00 grep --color=auto tomcat

启动成功标识!

关闭tomcat:
首先,进入Tomcat下的bin目录

cd /usr/local/tomcat/bin使用./shutdown.sh或者是sh shutdown.sh关闭Tomcat

想直接直接杀死Tomcat进程(进程号: 22857),使用kill命令
kill -9 22857

到此节点环境搭建完毕!

51股吧网
神奇游戏网

猜你喜欢
主卧没要卫生间后悔了 没有黄段子存在的无聊世界 番石榴中间的籽能吃吗 开心游乐场 相安无事 雷珊 生腌虾 王初桐六娘历史中结局 智游精灵 egoman 夜之曲 黄焖鸡的读音 迪达拉的艺术 触手可及纪录片 快手粉丝排名最新2019 碳水循环 男女故事 备长炭粉 认真你就输了 明仕山庄 2013年工作总结 御夫之术 马心 excel表格数字显示不全 暑期政治集训心得体会 三个火枪手读后感 叫车网 促膝长谈 丹麦对瑞士 失眠怎么办如何快速睡 美国十大名校 神奇蓝药水 花枪缘 绯红先锋 男包包品牌大全 免费网课app 男士皮包品牌排行 yodaobot 约数 男包什么牌子好

【Bodog博狗体育博彩提供足球和篮球的重要赛事,让您及时掌握心仪球队的消息,随时随地为球队加油,享受精彩刺激的博弈感。
好消息,投注Bodog博狗体育 =保证奖励 + NBA现金返现 + 双人份新加坡F1大奖赛三日套票

博狗扑克官方网址:www.bogoupoker.com

本文由博狗博客整理发布。

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: