[TOC]
网络配置
vmware 桥接模式下:
各种网络模式参考 https://www.linuxidc.com/Linux/2016-09/135521.htm
/etc/sysconfig/network-scripts 下一般会有一个网络配置文件,如:ifcfg-eno16777736
修改该文件:
1 | TYPE=Ethernet |
修改完重启
1 | /etc/init.d/network restart |
CentOS中修改主机名
CentOS 6
1 | [root@centos6 ~]$ hostname # 查看当前的hostnmae |
centos6以及其他有些发行版本,主机名的配置文件是/etc/sysconfig/network
, 用 hostname newname
也只是暂时生效,修改了内核的值,重启丢失。 所以可以结合临时加修改配置文件这种方式修改主机名。
CentOS 7
1 | [root@centos7 ~]$ hostnamectl set-hostname centos77.magedu.com # 使用这个命令会立即生效且重启也生效 |
在centos7中,主机名的配置文件为 /etc/hostname, 在该文件中配置了新的主机名后,不会立即生效,需要重启进行生效;因为系统内核已经中的主机名还没有更新,还是旧的指。 可以使用修改CentOS6的策略,也可以通过 hostnamectl set-hostname newname
来更改主机名,内核和配置文件中的主机名都被更新了,不用重启。
至于/etc/hosts
文件,同Windows下的hosts文件一样,只是起到本地DNS的作用一样,路由的作用。或者也可以说起别名。
SSH 服务配置
首先查看是否有安装
1 | yum list installed | grep openssh-server |
没有安装的话,用yum进行安装 yum install openssh-server
SSH 服务的配置文件是 /etc/ssh/sshd_config
1 | Port 22 |
重启或开启SSH服务
1 | systemctl restart sshd.service |
查看22端口
1 | yum instatll net-tools –y #如果没有netstat服务,安装netstat工具 |
必要时关闭防火墙或开放22端口
1 | systemctl stop firewalld.service |
ssh-keygen -t rsa -b 2048 -f /etc/ssh/ssh_host_rsa_key
RPM
https://www.cnblogs.com/zengkefu/p/5666947.html
ntpdate cn.pool.ntp.org
\1. 安装ntpdate工具
# yum -y install ntp ntpdate
\2. 设置系统时间与网络时间同步
# ntpdate cn.pool.ntp.org
\3. 将系统时间写入硬件时间
# hwclock –systohc
4.强制系统时间写入CMOS中防止重启失效
hwclock -w
或clock -w
本文来自 紫漪 的CSDN 博客 ,全文地址请点击:https://blog.csdn.net/u011391839/article/details/62892020?utm_source=copy
sudo passwd root 更改密码,要在root用户下
sudo su - root
apt list –installed|grep jdk java
/opt/zookeeper-3.4.6/bin/zkServer.sh start
/opt/kafka_2.11-0.9.0.1/bin/kafka-server-start.sh -daemon /opt/kafka_2.11-0.9.0.1/config/server.properties
/opt/kafka_2.11-0.9.0.1/bin/kafka-server-stop.sh
bin/kafka-console-producer.sh –broker-list localhost:9092 –topic test
1 | bin/kafka-console-consumer.sh --zookeeper localhost:2181 --topic test1 --from-beginning |