linux机器上线流程 简单说明解析

一、 基础环境配置

1. 配置IP

编辑文件

vi /etc/sysconfig/network-scripts/ifcfg-eth0

具体修改如下:

BOOTPROTO=static

ONBOOT=yes

IPADDR=11.24.201.248

GATEWAY=11.24.201.254

NETMASK=255.255.254.0

DNS1=11.24.201.201

DNS2=11.24.201.209

按ESC输入:wq保存退出

注:在创建虚拟机时要在****hyper-V****中设置绑定****MAC****地址,不是进入虚拟机里进行设置

2. 修改主机名

hostnamectl set-hostname 主机名

例:hostnamectl set-hostname VPCRDAP04

或编辑文件修改

vi /etc/sysconfig/network

修改HOSTNAME=主机名

3. 创建用户账号

useradd 用户名

passwd 用户名

useradd crdadmin

passwd crdadmin

输入要设置的密码(一共2次)

账户密码设置成功后,编辑文件

visudo

找到如下:

Allow root to run any commands anywhere
root ALL=(ALL) ALL

在这句下面添加

crdadmin ALL=(ALL) NOPASSWD: ALL

注:完成以上操作,重启操作系统使配置生效,用户****sudo****会拥有****root****权限慎重

二、 其他服务配置

1. 关闭防火墙firewalld.service

Centos 7及以上版本使用

systemctl stop firewalld.service

systemctl disable firewalld.service

Centos 6.x及以下版本使用

查看filter表的规则:iptables -L

临时关闭防火墙:service iptables stop

开机默认关闭防火墙:chkconfig iptables off

2. 关闭selinux

判断是否开启:getenforce

暂时关闭selinux:setenforce 0

编辑文件

vi /etc/selinux/config

具体修改如下:

将SELINUX=enforcing------>改为SELINUX=disable

按ESC输入:wq保存退出

注意:

1. 修改后需要****reboot /&shutdown -now

2. 重启完需进行测试:****ping****一下网关****&ping****一下百度

3. 该状态下即可远程****SSH****进行登陆了

3. 时间同步

NTP配置 yum -y install ntp 然后进入/etc/ntp.conf

restrict 127.0.0.1 #允许本地的时间修改权限最高

restrict -6 ::1

server 同步源1(默认是域控) prefer #prefer表示优先匹配

server 同步源2

server 同步源3
fudge 客户端ip stratum 16 #设置本地时间层级为16,客户端的层级要大于服务端

重启ntp使配置生效/etc/init.d/ntpd restart

设置开机自启动关闭chkconfig ntpd on (centos6) systemctl disable ntp.service (centos7)

查看同步情况ntpq -p

强制同步时间ntpdate 11.24.201.201

手动修改时间date -s “2019-04-23 12:30:12”

开启ssh服务
ssh状态检查:/etc/init.d/sshd status

临时开启:/etc/init.d/sshd start

开机自启:chkconfig sshd on(centos6)

systemctl disable ssh.service(centos7)

此服务默认是开启的

安装zabbix监控(以centos 6.5为例)
下载rpm安装包repo.xxside.com/zabbix/3.0/rhel/6/x86_64/

<v:shapetype id="_x0000_t75" coordsize="21600,21600" o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f"><v:stroke joinstyle="miter"><v:formulas></v:formulas><v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"></v:path></v:stroke></v:shapetype><v:shape id="图片_x0020_3" o:spid="_x0000_i1025" type="#_x0000_t75" alt="IMG_256" style="width:391.5pt;height:148pt;visibility:visible;
mso-wrap-style:square"><v:imagedata src="file:///C:/Users/86111/AppData/Local/Temp/msohtmlclip1/01/clip_image001.png" o:title="IMG_256"></v:imagedata></v:shape>

xshell远程登陆用xftp导入压缩包,ls查看

强制安装rpm -ivh zabbix-agent-3.0.20-1.el6.x86_64.rpm --force --nodeps

修改配置文件vi /etc/zabbix/zabbix_agentd.conf

具体需要修改的地方如下:

Server=11.24.201.153

ServerActive=11.24.201.153

Hostname=vtoaet01

开启zabbix服务/etc/init.d/zabbix-agent start(设置开机自启动chkconfig zabbix-agent on)

查看服务是否成功开启ps -ef | grep zabbix

注:下载安装包时可通过命令****cat /etc/redhat-release****查看系统版本****(****这种方法只适合****Redhat****系的****Linux)

详情:rpm安装zabbix的教程链接(centos 6.5)7.4

https://www.fatiao.net/tag/titun

6. 查看进程可以打开的最大文件描述符的数量

查看进程可以同时打开的最大文件描述符的数量ulimit -n

<pre>将默认值修改为65535,编辑配置文件</pre>

vi /etc/security/limits.conf

具体修改部分:(在最后一行进行添加,保存后重启生效)

<pre>* soft nofile 65535</pre>

<pre>* hard nofile 65535</pre>

7. 默认显示语言

安装WAS因为用到xmanager界面一定要英文,安装完成后可以调整为中文。

编辑文件

vi /etc/sysconfig/i18n

具体修改部分:

LANG=zh_CN.GB18030
LANG="en_US.UTF-8"

注:****#****在前面表示行注释,本例生效的是****UTF-8

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值