编译安装:
/configure –enable-shared
make -j8 && make install
安装setuptools
tar xf setuptools-06c11targz
cd setuptools-06c11
python setuppy install
安装fabric
执行安装时,软件会自动从网上查找依赖的安装包并进行安装
tar xf fabric-09rc2targz
cd goosemo-fabric-1eacbf2
python setuppy install配置postfix邮件服务器首先要检查本机是否已安装sendmail邮件服务器,如果安装了sendmail服务,请将sendmail服务停止或卸载sendmail服务。
可以使用下面两种方法:
1 service sendmail stop:关闭sendmail服务,也要将开机启动服务关闭,否则重启机器时会发生冲突。
chkconfig –level sendmail 345 off:关闭sendmail开机启动项
2 yum remove sendmail 可以通过yum 删除sendmail服务
修改主机名 注意:主机名要和你配置的邮件域名相同,否则邮件会出问题
修改主机名方法:
hostname #查看本机名
hostname maillghcom 临时修改,重启后失效
vim /etc/sysconfig/network #修改网卡配置
HOSTNAME=maillghcom #修改主机名,需要重启后起作用
echo "maillghcom" > /proc/sys/kernel/hostname 这种方法是最好的办法,修改后不用重启就生效。
因为做实验测试邮件服务器,所要最好要把DNS服务安装上,这样测试比较容易理解,在真实生产环境,DNS一般不需要自己配置。
我们使用REHL54光盘进行一些软件包的安装,首先要先挂载光盘。
mount /dev/cdrom /mnt/cdrom //我光盘挂载的位置 /mnt/cdrom
安装一些软件包我们使用yum来进行安装,所以要先配置yum仓库。使用yum安装的好处是可以解决安装软件依赖关系问题。
首先要配置yum仓库:
cd /etc/yumreposrepo 进入安装目录
将此目录下的rhel-debuginforepo 文件另存为一个文件名
cp rhel-debuginforepo servicerepo
复制完成后: vim servicerepo 修改yum仓库配置文件内容如下:
[rhel]
name=rhel
baseurl=file:///mnt/cdrom/Server //指定仓库的位置,光盘挂载的位置。
enabled=1 //是否启用yum仓库,值为1表示启用,值为0表示禁用。
gpgcheck=0 //是否进行机校验,值为1表示校验,值为0表示不校验。
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
保存后退出
DNS服务配置:
#yum install bind //通过YUM 安装DNS服务
# rpm -qa |grep bind //安装完成后使用RPM检查所安装的软件包,至少要有以下4个软件包:
bind-devel-936-4P1el5
bind-936-4P1el5
bind-chroot-936-4P1el5
bind-utils-936-4P1el5
软件包安装完成后,我们首先要从模板中拷贝DNS主配置文件及数据库配置文件:
cp /usr/share/doc/bind-936/sample/etc/namedconf /var/named/chroot/etc/ DNS主配置文件
cp/usr/share/doc/bind-936/sample/var/named/localhostzone /var/named/chroot/var/named/lghcomzone 数据库配置文件,注意空格位置
DNS主配置文件:/var/named/chrot/etc/namedconf
vim /var/named/chroot/etc/namedconf :编辑DNS服务主配置文件
options {
directory "var/named";
};
zone "lghcom"{
type master;
file "lghcomzone";
};
zone "jeasoncom" {
type master;
file "jeasoncomzone";
};
DNS 服务数据库配置文件:/var/named/chroot/var/named/lghcomzone
$TTL 86400
@ IN SOA @ root (
42 ; serial (d adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
IN NS maillghcom
mail IN A 19216813
lghcom IN MX 10 maillghcom
DNS 服务数据库配置文件:/var/named/chroot/var/named/jeasoncomzone
$TTL 86400
@ IN SOA @ root (
42 ; serial (d adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
IN NS mailjeasoncom
mail IN A 19216814
jeasoncom IN MX 10 mailjeasoncom1准备一台Linux服务器,用最简单的版本CentOS-67-x86_64-minimaliso
2配置好这台服务器的IP地址
3上传CentOS-67-x86_64-bin-DVD1iso到服务器
4将CentOS-67-x86_64-bin-DVD1iso镜像挂载到某个目录
mkdir /var/iso
mount -o loop /home/hadoop/soft/CentOS-67-x86_64-bin-DVD1iso /var/iso
CentOS-67-x86_64-bin-DVD1iso
补充:挂载光盘(无需上传iso文件)
mkdir /mnt/cdrom
mount -t iso9660 -o ro /dev/cdrom/ /mnt/cdrom
mount /dev/sr0 /mnt/cdrom/
5修改本机上的YUM源配置文件,将源指向自己
备份原有的YUM源的配置文件
cd /etc/yumreposd/
rename repo repobak
vi CentOS-Localrepo
由于上面,没有找到怎么添加表格,所以就只能这样看了
[base]
name=CentOS-Local
baseurl=file:///var/iso
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
添加上面内容保存退出
箭头的这个部分是可以写多个的,本地和阿里的比较好(在国内开源的)
将下面的文件里面的内容全部粘贴到上面的这个文件里面就可以了
这是一个写阿里yum源的上的网址
(文件不能上传,加我好友发给你,微信maochentingqiang)
6清除YUM缓冲
yum clean all
7列出可用的YUM
yum repolist
8安装相应的软件免密
yum install -y >1开始说明
本教程中使用的IP地址是1921680100,主机名称为Server1examplecom 这些设置可能会有所不同,你需要根据不同情况进行修改。
CentOS 62下安装MySQL
2开始安装MySQL5
首先我们应该先用下面的命令安装MySQL:
yum install mysql mysql-server
然后我们需要创建MySQL系统的启动键链接启动MySQL服务器,这样以便于MySQL在系统启动时自动启动
chkconfig --levels 235 mysqld on
/etc/initd/mysqld start
为MySQL root帐户设置密码:
mysql_secure_installation
会出现下面的一系列提示:
root@server1 ~]# mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MySQL to secure it, we'll need the current
password for the root user If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here
Enter current password for root (enter for none):
OK, successfully used password, moving on
Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation
Set root password [Y/n] <-- ENTER
New password: <-- yourrootsqlpassword
Re-enter new password: <-- yourrootsqlpassword
Password updated successfully!
Reloading privilege tables
Success!
By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them This is intended only for testing, and to make the installation
go a bit smoother You should remove them before moving into a
production environment
Remove anonymous users [Y/n] <-- ENTER
Success!
Normally, root should only be allowed to connect from 'localhost' This
ensures that someone cannot guess at the root password from the network
Disallow root login remotely [Y/n] <-- ENTER
Success!
By default, MySQL comes with a database named 'test' that anyone can
access This is also intended only for testing, and should be removed
before moving into a production environment
Remove test database and access to it [Y/n] <-- ENTER
- Dropping test database
Success!
- Removing privileges on test database
Success!
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately
Reload privilege tables now [Y/n] <-- ENTER
Success!
Cleaning up
All done! If you've completed all of the above steps, your MySQL
installation should now be secure
Thanks for using MySQL!
[root@server1 ~]#
CentOS 62下安装Apache
3安装阿帕奇2
Apache2的是作为一个CentOS的软件包,因此我们可以直接用下面命令安装它:
yum install >
grep -E '(vmx|svm)' /proc/cpuinfo
yum install qemu virt kvm -y
Question:
Solution:已安装的跳过
yum install qemu virt kvm -y --skip-broken
systemctl start libvirtd
systemctl enable libvirtd
virsh list
yum install -y bridge-utils
#配置桥接模式
cd /etc/sysconfig/network-scripts
cp ifcfg-em2 ifcfg-br0
[root@localhost network-scripts]# vim ifcfg-em2
TYPE=Ethernet
BRIDGE=br0
NAME=em2
UUID=74c8085f-4c0d-4743-b0a0-70e51e3eb877
DEVICE=em2
ONBOOT=yes
#注意IPADDR 要改为自己的
[root@localhost network-scripts]# vim ifcfg-br0
TYPE=Bridge
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=br0
DEVICE=br0
ONBOOT=yes
IPADDR=17216103
PREFIX=24
GATEWAY=1721610254
DNS1=114114114114
systemctl restart network
#验证
brctl show
cd /home/kvm
#创建master虚拟机的存储盘 104
qemu-img create -f qcow2 -o cluster_size=2M k8s-master01qcow2 200G
virt-install --virt-type kvm --os-type=linux --os-variant rhel7 --name k8s-master01qcow2 --memory 8192 --vcpus 4 --disk /home/kvm/k8s-master01qcow2,format=qcow2 --cdrom /home/kvm/CentOS-7-x86_64-DVD-2009iso --network bridge=br0 --graphics vnc,listen=0000 --noautoconsole
#创建worker虚拟机的存储盘 105
qemu-img create -f qcow2 -o cluster_size=2M k8s-worker01qcow2 200G
virt-install --virt-type kvm --os-type=linux --os-variant rhel7 --name k8s-worker01qcow2 --memory 8192 --vcpus 4 --disk /home/kvm/k8s-worker01qcow2,format=qcow2 --cdrom /home/kvm/CentOS-7-x86_64-DVD-2009iso --network bridge=br0 --graphics vnc,listen=0000 --noautoconsole
#创建worker虚拟机的存储盘 103
qemu-img create -f qcow2 -o cluster_size=2M k8s-worker02qcow2 200G
virt-install --virt-type kvm --os-type=linux --os-variant rhel7 --name k8s-worker02qcow2 --memory 32768 --vcpus 32 --disk /home/kvm/k8s-worker02qcow2,format=qcow2 --cdrom /home/kvm/CentOS-7-x86_64-DVD-2009iso --network bridge=br0 --graphics vnc,listen=0000 --noautoconsole
netstat -ntlp | grep 5900
virsh list --all
virsh shutdown k8s-master01qcow2
virsh start k8s-master01qcow2
ssh 172161050 root@starQuest2022
Question:系统启动卡住
Solution:
virsh destroy k8s-master01qcow2
virsh undefine k8s-master01qcow2
Question:更改桥接模式失败引发的问题
Solution:
vi /etc/sysconfig/network-scripts/ifcfg-eth0
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=eth0
UUID=c510f2f9-9820-45e8-9c70-65674bd35258
DEVICE=eth0
ONBOOT=yes
IPADDR=172161050
PREFIX=24
GATEWAY=1721610254
DNS1=114114114114
systemctl restart network
Question:
Solution:
vi /root/ssh/known_hosts 删除有问题IP对应行
#设置hostname
hostnamectl set-hostname k8s-master01
hostnamectl set-hostname k8s-worker01
hostnamectl set-hostname k8s-worker02
yum update
yum install wget
yum install vim
rpm --import >没用过,不过查了下。
recv-keys:获取key
keyserver:key服务器
为什么需要key(我的理解):为了安全性,确保下载的包经过了认证、签名(而不是随便被篡改的包含病毒的包)。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)