Centos 7 安装并配置monit

Monit 是一个开源的linux 程序,用来监控程序,并且在必要的时候重启.

在centos上安装的非常的简单.

首先需要安装epel repo:

yum install epel-release

然后就可以安装monit了

yum install monit

将monit加入开机自启动并且start monit进程:

systemctl enable monit
systemctl start monit

查看monit 状态:

systemctl status monit

更多

404 error when downloading .iso file from IIS

最近运行了一些IIS 服务器来做下载服务器,在下载.iso 文件的时候,经常会有404 error,这是因为IIS 服务器的配置文件里面没有正确的iso文件的MIME类型,因此我们需要为iso 文件添加MIME 类型

在IIS Manager上,Sites -> Your_Site, 在右边feature view里面双击MIME Types, 选择添加, file name extension 为 iso, MIME type 是

application/octetstream

点击OK,这时候你在下载就会发现404 错误没有了

Debian 9, Debian 10 以及Ubuntu 关闭IPv6

用netinst.iso 安装的debian 和 ubuntu,默认都会开启IPv6,但是很多服务商并不分配IPv6,因此大部分的时候我们需要将IPv6 关闭。主要有两种办法,一个是修改sysctl.conf, 或者是在/etc/sysctl.d 目录下创建一个.conf 文件

Method 1:

编辑/etc/sysctl.conf 文件,在文件的最末尾添加下面的entry:

net.ipv6.conf.all.disable_ipv6 = 1

如果仅想关闭某一网卡的ipv6,比如说ens4, 那就可以添加下面的entry:

net.ipv6.conf.ens4.disable_ipv6 = 1

让命令生效:

sysctl -p

Method 2:

在/etc/sysctl.d 目录下创建70-disable-ipv6.conf

nano /etc/sysctl.d/70-disable-ipv6.conf

添加下面的entry:

net.ipv6.conf.all.disable_ipv6 = 1

如果仅仅想关闭某一网卡,比如说ens4, 添加下面的entry:

net.ipv6.conf.ens4.disable_ipv6 = 1

立刻生效:

sysctl -p -f /etc/sysctl.d/70-disable-ipv6.conf

就是这么简单

 

 

Centos 7, Debian 9, Debian 10 安装open virtual machine tools(open-vm-tools)

open-vm-tools 是esxi 采用的开源版本的vmware tools

在ESXi的虚拟机上,你或者安装vmware tools,或者安装开源版本的open-vm-tools. 在vmware的官方文档上,open-vm-tools 是被推荐使用的.

在centos7, debian 9 或者debian 10上,安装open-vm-tools 非常的简单,只需要一条命令就可以:

yum install open-vm-tools
apt-get install open-vm-tools

安装完毕以后,需要重启一下让open-vm-tools生效

搬瓦工DC9 CN2GIA 小鸡benchmark

用了很久的CN2GIA,今天没事正好看看网络质量,看看是不是合适做smb服务.

测试使用的程序:

wget -qO- bench.sh | bash

下面是结果:

----------------------------------------------------------------------
CPU model : QEMU Virtual CPU version (cpu64-rhel6)
Number of cores : 2
CPU frequency : 2599.998 MHz
Total size of Disk : 19.9 GB (2.5 GB Used)
Total amount of Mem : 1003 MB (89 MB Used)
Total amount of Swap : 259 MB (10 MB Used)
System uptime : 0 days, 0 hour 37 min
Load average : 0.33, 0.09, 0.03
OS : Debian GNU/Linux 10
Arch : x86_64 (64 Bit)
Kernel : 4.19.0-6-amd64
----------------------------------------------------------------------
I/O speed(1st run) : 444 MB/s
I/O speed(2nd run) : 431 MB/s
I/O speed(3rd run) : 406 MB/s
Average I/O speed : 427.0 MB/s
----------------------------------------------------------------------
Node Name IPv4 address Download Speed
CacheFly 205.234.175.175 84.2MB/s
Linode, Tokyo2, JP 139.162.65.37 2.32MB/s
Linode, Singapore, SG 139.162.23.4 1.09MB/s
Linode, London, UK 176.58.107.39 2.12MB/s
Linode, Frankfurt, DE 139.162.130.8 2.06MB/s
Linode, Fremont, CA 50.116.14.9 12.0MB/s
Softlayer, Dallas, TX 173.192.68.18 3.96MB/s
Softlayer, Seattle, WA 67.228.112.250 7.59MB/s
Softlayer, Frankfurt, DE 159.122.69.4 2.05MB/s
Softlayer, Singapore, SG 119.81.28.170 4.78MB/s
Softlayer, HongKong, CN 119.81.130.170 3.06MB/s

由此可见,DC9 的网络对US 的支持很一般,开启samba服务要当心

Debian 10 安装配置samba

samba, smb 在IPMI安装OS的时候非常有用,可以实现远程挂载. 对于远程挂载这种服务来说,可以简单配置一下samba就可以实现.

在debian 10 上安装十分的简单:

apt install samba

编辑samba的配置文件:

删掉/etc/samba/smb.conf文件,用下面的内容代替:

[global]
workgroup = WORDGROUP
netbios name = samba
security = user
map to guest = bad user

[share]
comment = Home Directories
path = /samba/share
browsable =yes
writable = no
guest ok =yes
read only = yes

这个表示目录位于/samba/share. 下面重启samba服务并且写入开机自启动服务:

systemctl restart smbd
systemctl enable smbd

十分的简单,这就完成了

需要挂在OS iso文件,直接放入/samba/share下面就可以了