环境配置

一。 装完centos6.x后,配置静态ip,参照  https://www.cnblogs.com/GH-123/p/8516474.html

二。永久修改主机名

    1.  打开配置文件

[root@localhost ~]# vim /etc/sysconfig/network

    2.  修改配置如下

NETWORKING=yes
HOSTNAME=host1              # host1 为主机名

三. 修改主机名和IP的映射关系

    1. 修改配置文件

[root@host1 ~]# vim /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

192.168.1.146 host1          # ip 和 主机名
192.168.1.147 host2
192.168.1.148 host3

  2. 重启服务,重新登录,主机名生效

[root@localhost ~]# service network restart
[root@host1 ~]#

四.  关闭防火墙iptables

    1.关闭防火墙

[root@host1 ~]# service iptables stop
iptables:将链设置为政策 ACCEPT:filter                    [确定]
iptables:清除防火墙规则:                                 [确定]
iptables:正在卸载模块:                                   [确定]
[root@host1 ~]#

     2. 关闭防火墙开机启动

[root@host1 ~]# chkconfig iptables off

     3.查看防火墙开机启动状态

[root@host1 ~]# chkconfig iptables --list
iptables           0:关闭    1:关闭    2:关闭    3:关闭    4:关闭    5:关闭    6:关闭

五。关闭selinux

     1. 打开配置文件

[root@host1 ~]# vim /etc/sysconfig/selinux

    2. 设置SELINUX为disabled

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#       enforcing - SELinux security policy is enforced.
#       permissive - SELinux prints warnings instead of enforcing.
#       disabled - SELinux is fully disabled.
SELINUX=disabled
# SELINUXTYPE= type of policy in use. Possible values are:
#       targeted - Only targeted network daemons are protected.
#       strict - Full SELinux protection.
SELINUXTYPE=targeted

六。安装jdk

    1.  下载jdk,官网下载: http://www.oracle.com/technetwork/java/index.html

[root@host1 ~]# rpm -ivh jdk-8u181-linux-x64.rpm
[root@host1 ~]# java -version
java version "1.8.0_181"
Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)
[root@host1 ~]#

七。 配置ssh免登陆, 参考  https://www.cnblogs.com/GH-123/p/7965852.html

原文地址:https://www.cnblogs.com/GH-123/p/9568720.html