[root@centos7 ~]$ hostnamectl set-hostname prd_web1             # 使用这个命令会立即生效且重启也生效
[root@centos7 ~]$ hostname # 查看下
prd_web1
[root@centos7 ~]$ vim /etc/hosts # 编辑下hosts文件, 给127.0.0.1添加hostname
[root@centos7 ~]$ cat /etc/hosts # 检查
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 prd_web1
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 prd_web1 追记一下,请务必修改/etc/hosts文件,否则通过JDBC连接oracle数据库会有意向不到坑!

centos7修改hostname的更多相关文章

  1. centOS7 修改hostname

    hostnamectl set-hostname 你要修改到的hostname   localectl set-locale LANG=要修改的语言     介绍个Centos 7很不错的教程网站:h ...

  2. centos7修改hostname和hosts

    1.修改/etc/hostname vi /etc/hostname 打开之后的内容是: localhost.localdomain 把它修改成想要的名字就可以,比如:master 保存退出 2.修改 ...

  3. centos 修改hostname

    centos修改主机名的正确方法 1 centos6下修改hostname [root@centos6 ~]$ hostname # 查看当前的hostnmae centos6.magedu.com ...

  4. Liunx centos 系统 修改hostname

    1 centos6下修改hostname [root@centos6 ~]$ hostname # 查看当前的hostnmae centos6.magedu.com [root@centos6 ~]$ ...

  5. Centos7中修改Hostname的方法

    一.Centos7中修改的方法: hostnamectl set-hostname <new hostname> 说明:centOS 7 里面修改hostname的方式有所改变,修改/et ...

  6. CentOS 7 修改hostname

    centOS 7 里面修改hostname的方式有所改变,修改/etc/hosts和/etc/sysconfig/network两个文件已经不能生效.使用的新命令是 : hostnamectl set ...

  7. Linux修改hostname与免密码登录

    修改hostname [root@centos7 ~]$ hostnamectl set-hostname hadoop001 # 使用这个命令会立即生效且重启也生效 [root@centos7 ~] ...

  8. centos7 修改主机名(hostnamectl)

    hostnamectl 是在 centos7 中新增加的命令,它是用来修改主机名称的,centos7 修改主机名称会比以往容易许多. 用法 # hostnamectl -h -h --help 显示帮 ...

  9. Centos 7修改hostname浅析

    之前写过一篇博客"深入理解Linux修改hostname",里面总结了RHEL 5.7下面如何修改hostname,当然这篇博客的内容其实也适用于CentOS 6,但是自CentO ...

随机推荐

  1. div位置设置

    div居中显示 margin:0 auto div中的内容居中显示 text-algin:center div靠右显示 float:right 设置div元素的右外边距 margin-right:10 ...

  2. Serlvet学习笔记之二—不同页面共享数据

    一共有四种方法实现共享页面共享数据 1.cookie 2.sendRedirect 3.session 4.隐藏表单提交(form) 5.ServletContex 1.cookie:服务器在客户端保 ...

  3. hadoop错误各种原因

    NoRouteToHostException 错误描述: INFO hdfs.DFSClient: Exception in createBlockOutputStream java.net.NoRo ...

  4. FTP新建文件夹访问

    今天在远程服务器上添加了文件夹,本来还想着FTP打开看看,结果竟然发现没有这个文件夹访问 想了一下,感觉应该是FTP访问的文件设置,只有FTP设置了的文件夹才能有显示

  5. 【python系列】SyntaxError:Missing parentheses in call to 'print'

    打印python2和python3的区别 如上图所示,我的 PyCharm安装的是python3.6如果使用print 10会出现语法错误,这是python2.x和python3.x的区别所导致的.

  6. LeetCode——Add Digits

    Description: Given a non-negative integer num, repeatedly add all its digits until the result has on ...

  7. jQuery的无new构建

    正常面向对象的写法: var cJquery = function(){ //构造函数体 }; cJquery.prototype = { name : function(alert("ch ...

  8. Linux数据链路层的包解析

    仅以此文作为学习笔记,初学者,如有错误欢迎批评指正,但求轻喷.一般而言,Linux系统截获数据包后,会通过协议栈,按照TCP/IP层次进行解析,那我们如何直接获得更为底层的数据报文呢,这里用到一个类型 ...

  9. 把 Activity 改成 ListActivity继续使用 setContentView

    ListActivity has a default layout that consists of a single, full-screen list in the center of the s ...

  10. 修改Yii2的默认语言language为中文zh-CN的方法

    如果用的语言是en-US的话,网页加载速度很慢,因为要加载国外镜像或者链接什么的,使用zh-CN就直接加载国内链接或者CDN,速度比较快: ------------------------------ ...