无法使用Azure RHEL节点中的yum访问第三方回购

问题描述:

我们从Azure调配了一个RHEL服务器。我知道我们的基础设施人员对访问有点严格。无法使用Azure RHEL节点中的yum访问第三方回购

我们需要在这台机器上安装Oracle JDK,它看起来像wget不是获得rpms的选项,只有yum。但是,我需要启用第三方回购如Oracle,以yum install一个JDK,所以我发出这个命令:

subscription-manager repos --enable rhel-7-server-thirdparty-oracle-java-rpms 

,我得到

Network error, unable to connect to server. Please see /var/log/rhsm/rhsm.log for more information 

当我做yum updateyum install telnet,它似乎在做它的工作。

我的问题是,我有安装JDK的替代方法吗?对于熟悉Azure和网络配置的人员,我们应该向我们的基础架构人员询问什么具体请求以启用“下载”?

根据我的经验,我认为这个问题可能是由VM网络引起的。但是,当你运行yum更新时,这没有问题。所以我建议你可以在VM终端上运行ping www.microsoft.com来检查你的虚拟机是否可以连接到外网。

对于第一个问题,我们可以使用另一种方法在RHEL上安装Oracle JDK。

1.You could download the Oracle JDK(.tar.gz) from Oracle official website just as below. 
http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html 

2.You可以上传您已通过FTP工具如FileZilla中下载到您的Azure的VM目录JDK包。

description image

3.You可以使用的SecureCRT连接到Azure的VM。

description image

4. 替代品安装Java。

 #cd /home/johnny 
    #tar -zxf jdk-7u79-linux-x64.tar.gz -C /opt/  
    #cd /opt/jdk1.7.0_79/ 
    #alternatives --install /usr/bin/java java /opt/jdk1.7.0_79/bin/java 2 
    #alternatives --config java 
    the output may be below: 

description image

你可以输入1继续。

5.现在,您可能还需要使用替代命令设置javac和jar命令路径。

 #alternatives --install /usr/bin/jar jar /opt/jdk1.7.0_79/bin/jar 2 
    #alternatives --install /usr/bin/javac javac /opt/jdk1.7.0_79/bin/javac 2 
    #alternatives --set jar /opt/jdk1.7.0_79/bin/jar 
    #alternatives --set javac /opt/jdk1.7.0_79/bin/javac 

6.检查安装的java版本。

 #java -version 

description image

7.Configuring环境变量。

 Setup JAVA HOME variable: 
     #export JAVA_HOME= /opt/jdk1.7.0_79 
     Setup JRE HOME variable: 
     #export JRE_HOME=/opt/jdk1.7.0_79/jre 
     Setup PATH variable: 
     #export PATH=$PATH:/opt/jdk1.7.0_79/bin:/opt/jdk1.7.0_79/jre/bin 

     There is another method to config environment variables. 
     Modify the config file: /etc/profile. In this method, anyone who has logged in can use java. 

description image

8。该REFFERENCE:

http://tecadmin.net/steps-to-install-java-on-centos-5-6-or-rhel-5-6/#

关于第二个问题,你可以问蔚蓝网络配置的一些问题。

希望它有帮助。任何疑虑,请随时让我知道。