Feb 062021
 

最近测试厂商的系统,部署完成后,通过IP地址登录,是HTTP的方式,其实这就是一个安全隐患,你登录输入的密码,其实都是明文传输。怎么解决这个问题呢?

这种情况下,我测试过用工具拦截过同事的密码的。

公司内网的设备,交换机,存储,都是通过ip访问,那么他们如何解决安全的问题呢?

基于的IP地址的证书:

https://ip

如果你是公网的ip地址,,你是可以通过花钱,拿到签发的证书,在公网使用。但是不会给私有的网段签发证书。如果私有的网络要使用证书,那么你就只能用自己签发证书的方式,来实现加密。

https://github.com/antelle/generate-ip-cert

一键搞定。

curl -sS https://raw.githubusercontent.com/antelle/generate-ip-cert/master/generate-ip-cert.sh | \
bash -s 23.105.203.97

一键签发ip地址证书

最后的是你的ip地址,记得更换。
May 312017
 

对于OpenStack来说,存储基本都是Ceph,那么磁盘一般都会做成raid0或者使用直通模式。对于直通模式,SATA盘的性能,会相对差不少,通过Raid卡,由于有raid卡的缓存,raid0,磁盘的性能会好很多。那么通过Raid卡,设置Raid0,一个问题就是,换盘,机器必须重启设置raid,能不能在运行的机器,把磁盘的raid 重建一下呢?

我在一台3年前的广达的四字星服务器上做验证。

我的raid卡是:LSI MegaRAID SAS PCI Express ROMB

Continue reading »

Feb 222017
 

很久没动手,导致配置一点东西,基本完全忘记。这次要在CentOS 7.3 下装Kolla,好好把这个补回来。

我的习惯都是最小化安装操作系统,然后慢慢玩和调整。

关闭Selinux

这个就基本不需要讨论的事情,编辑  /etc/selinux/config

SELINUX=disabled

我习惯重启机器,查看selinux状态

# sestatus
SELinux status:                 disabled

关闭Firewalld

做实验的时候,端口无法访问的事情是经常发生的。不折腾了。

systemctl status firewalld
systemctl stop firewalld
systemctl disable firewalld
systemctl status firewalld
firewall-cmd --state

Epel

现在的epel源,已经很简单了。

yum install epel-release

查看repo情况

yum repolist

Hostname

对于很多环境,这是必须的。

cat /etc/hostname
kolla
# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

192.168.27.10   kolla.chenshake.com     kolla

检查

#hostname -F /etc/hostname

#hostname
kolla

#hostname -f
kolla.chenshake.com

同步时间

yum install ntp
systemctl enable ntpd.service
systemctl start ntpd.service

手工同步时间

ntpdate 0.centos.pool.ntp.org
Oct 042016
 

自从自己维护blog以后,基本一个月内,都会出现1,2次这种错误,以前解决的办法很简单,就是把虚拟机重启一下就可以。经常是网友在微信,qq,微博提醒我blog挂掉。

Error establishing a database connection

刚好国庆期间碰上,就顺便提高一下自己的运维能力,看看具体的原因。

tail /var/log/mariadb/mariadb.log

看到大概的错误

161004 11:21:05 InnoDB: Fatal error: cannot allocate memory for the buffer pool
161004 11:21:05 [ERROR] Plugin 'InnoDB' init function returned error.
161004 11:21:05 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
161004 11:21:15 [Note] Plugin 'FEEDBACK' is disabled.
161004 11:21:16 [ERROR] Unknown/unsupported storage engine: InnoDB
161004 11:21:16 [ERROR] Aborting

其实我也能猜到,肯定是数据库的内存使用有啥问题。

有错误,其实就是利用google,基本就有答案

http://www.webtrafficexchange.com/solved-mysql-crash-fatal-error-cannot-allocate-memory-buffer-pool

我使用的青云的虚拟机,swap分区,就是1G,所以应该也不需要创建。

编辑 /etc/my.cnf,

[mysqld]
innodb_buffer_pool_size=64M

重启mysql

systemctl restart mariadb

查看swap内存使用

# free -m
              total        used        free      shared  buff/cache   available
Mem:            993         431         386           6         175         424
Swap:          1023           0        1023

查看一下启动日志

[root@chenshake mariadb]# tail /var/log/mariadb/mariadb.log 
161004 20:42:46 InnoDB: Initializing buffer pool, size = 64.0M
161004 20:42:46 InnoDB: Completed initialization of buffer pool
161004 20:42:46 InnoDB: highest supported file format is Barracuda.
161004 20:42:46  InnoDB: Waiting for the background threads to start

密切关注一下后续的效果如何。

Sep 162013
 

一直以来对VG都不是很理解,不过这次有人逼一下,就顺便好好理解一下。

其实现在如果是服务器,基本上架的时候,硬盘就是配置好,基本没啥机会添加硬盘,不过对于虚拟机,这样的机会还是很多的。

在Openstack下,给虚拟机添加一块硬盘倒是比较简单,不过有时候你会发现你添加的硬盘,虚拟机必须重启才能发现这块硬盘,现在终于有办法,不需要重启就可以找到硬盘。

Continue reading »

Sep 112012
 

当你机器数量多的时候,一个头痛的事情就是害怕硬盘坏了。那么怎么知道硬盘的运行状况呢?其实很早以前硬盘就有一个Smart的技术,用来检测硬盘的运行状况。

如何可以做到预测硬盘马上要坏掉和硬盘坏掉后,马上知道,这目前来说,还是比较高难度,作法还是比较白痴,依靠人工去机器前面看灯.

不过这个工具,很少资料介绍如何使用。尤其在服务器端,基本都是做Raid。这样也就导致查看硬盘信息更加困难。

上次和搜狐交流,专门提到Smart监控硬盘的运行状况。今天刚好有朋友在群里发了一个资料

http://jianlee.ylinux.org/Computer/SystemAdmin/smarttools.html

我比较关心是否能透过Raid查看。官方网站查看了一下,可以,http://sourceforge.net/apps/trac/smartmontools/wiki/Supported_RAID-Controllers

不过好像我手头上的测试机器,不支持这个。

root@node08:~# smartctl -a /dev/sda
smartctl 5.41 2011-06-09 r3365 [x86_64-linux-3.2.0-30-generic] (local build)
Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net

Vendor:               LSI     
Product:              MegaRAID 8708EM2
Revision:             1.40
User Capacity:        896,998,047,744 bytes [896 GB]
Logical block size:   512 bytes
Logical Unit id:      0x600605b00350d8b017c4c7570751a04f
Serial number:        004fa0510757c7c417b0d85003b00506
Device type:          disk
Local Time is:        Tue Sep 11 14:42:30 2012 CST
Device does not support SMART

Error Counter logging not supported
Device does not support Self Test logging

不过至少通过这个命令,可以看到阵列卡信息。已经不容易了。

看来这个和IPMI一样,都是一个比较有意思的技术。继续关注。