因公司原有的Oracle数据库已经无法满足当前的实际应用,现需要跟换数据库系统,综合考虑选择greenplum分布式数据库。在安装部署中遇到各种问题,都一一解决,如有错误的地方,请指正,谢谢!

物理环境

硬件环境:

3台台式机

16G内存的作为master,操作系统为RHEL6.2,最小化安装

24G联想电脑安装虚拟机vmwareworkstation11,其上各安装两台RHEL6.2,最小化安装

分别的IP

master168.168.168.16

台式机的windowsIP

segment1:168.168.168.17

segment2:168.168.168.18

 

虚拟机:

segment1-1:168.168.168.20

segment1-2:168.168.168.22

 

segment2-1:168.168.168.19

segment2-2:168.168.168.21

 

基础配置

首先需要关闭防火墙,selinux

[root@master ~]#service iptables stop

[root@master ~]# chkconfig iptables off

[root@master ~]# vi /etc/sysconfig/selinux   修改SELINUX参数为disabled

# This file controls the state of SELinuxon the system.

# SELINUX= can take one of these threevalues:

#    enforcing - SELinux security policy is enforced.

#    permissive - SELinux prints warnings instead of enforcing.

#    disabled - No SELinux policy is loaded.

SELINUX=disabled

# SELINUXTYPE= can take one of these twovalues:

#    targeted - Targeted processes are protected,

#    mls - Multi Level Security protection.

SELINUXTYPE=targeted

编辑hosts文件

[root@master ~]# vi /etc/hosts

127.0.0.1  localhost localhost.localdomain localhost4 localhost4.localdomain4

168.168.168.16  master

168.168.168.20  segment1-1

168.168.168.22  segment1-2

168.168.168.19  segment2-1

168.168.168.21  segment2-2

 

分别拷贝到其他服务器

[root@master ~]# scp /etc/hostsroot@168.168.168.20:/etc/

The authenticity of host '168.168.168.20(168.168.168.20)' can't be established.

RSA key fingerprint isd9:ae:87:98:5f:c7:7e:50:0b:74:ce:b5:81:94:5e:66.

Are you sure you want to continueconnecting (yes/no)? yes

Warning: Permanently added '168.168.168.20'(RSA) to the list of known hosts.

root@168.168.168.20's password:

hosts                                                                                                        100%  205     0.2KB/s  00:00  

[root@master ~]# scp /etc/hostsroot@168.168.168.19:/etc/

The authenticity of host '168.168.168.19(168.168.168.19)' can't be established.

RSA key fingerprint is0c:d0:33:c8:bf:c2:47:7c:eb:dd:ca:59:08:b7:25:ae.

Are you sure you want to continueconnecting (yes/no)? yes

Warning: Permanently added '168.168.168.19'(RSA) to the list of known hosts.

root@168.168.168.19's password:

hosts                                                                                                        100%  205    0.2KB/s   00:00  

[root@master ~]# scp /etc/hostsroot@168.168.168.21:/etc/

The authenticity of host '168.168.168.21(168.168.168.21)' can't be established.

RSA key fingerprint is0c:d0:33:c8:bf:c2:47:7c:eb:dd:ca:59:08:b7:25:ae.

Are you sure you want to continueconnecting (yes/no)? yes

Warning: Permanently added '168.168.168.21'(RSA) to the list of known hosts.

root@168.168.168.21's password:

hosts                                                                                                        100%  205    0.2KB/s   00:00  

[root@master ~]# scp /etc/hostsroot@168.168.168.22:/etc/

The authenticity of host '168.168.168.22(168.168.168.22)' can't be established.

RSA key fingerprint isd9:ae:87:98:5f:c7:7e:50:0b:74:ce:b5:81:94:5e:66.

Are you sure you want to continueconnecting (yes/no)? yes

Warning: Permanently added '168.168.168.22'(RSA) to the list of known hosts.

root@168.168.168.22's password:

hosts                                                                                                        100%  205    0.2KB/s   00:00  

测试各个主机名是否配置成功

[root@master ~]# ping segment1-2

PING segment1-2 (168.168.168.22) 56(84)bytes of data.

64 bytes from segment1-2 (168.168.168.22):icmp_seq=1 ttl=64 time=0.531 ms

64 bytes from segment1-2 (168.168.168.22):icmp_seq=2 ttl=64 time=0.512 ms

^C

--- segment1-2 ping statistics ---

2 packets transmitted, 2 received, 0%packet loss, time 1301ms

rtt min/avg/max/mdev =0.512/0.521/0.531/0.024 ms

[root@master ~]# ping segment1-1

PING segment1-1 (168.168.168.20) 56(84)bytes of data.

64 bytes from segment1-1 (168.168.168.20):icmp_seq=1 ttl=64 time=0.523 ms

64 bytes from segment1-1 (168.168.168.20):icmp_seq=2 ttl=64 time=0.526 ms

^C

--- segment1-1 ping statistics ---

2 packets transmitted, 2 received, 0%packet loss, time 1987ms

rtt min/avg/max/mdev =0.523/0.524/0.526/0.022 ms

[root@master ~]# ping segment2-1

PING segment2-1 (168.168.168.19) 56(84)bytes of data.

64 bytes from segment2-1 (168.168.168.19):icmp_seq=1 ttl=64 time=0.589 ms

64 bytes from segment2-1 (168.168.168.19):icmp_seq=2 ttl=64 time=0.513 ms

64 bytes from segment2-1 (168.168.168.19):icmp_seq=3 ttl=64 time=0.525 ms

^C

--- segment2-1 ping statistics ---

3 packets transmitted, 3 received, 0%packet loss, time 2970ms

rtt min/avg/max/mdev = 0.513/0.542/0.589/0.038ms

[root@master ~]# ping segment2-2

PING segment2-2 (168.168.168.21) 56(84)bytes of data.

64 bytes from segment2-2 (168.168.168.21):icmp_seq=1 ttl=64 time=0.505 ms

64 bytes from segment2-2 (168.168.168.21):icmp_seq=2 ttl=64 time=0.517 ms

64 bytes from segment2-2 (168.168.168.21):icmp_seq=3 ttl=64 time=0.652 ms

^C

--- segment2-2 ping statistics ---

3 packets transmitted, 3 received, 0%packet loss, time 2396ms

rtt min/avg/max/mdev =0.505/0.558/0.652/0.066 ms

分区挂载data

[root@segment1-1 ~]# fdisk /dev/sdb

Device contains neither a valid DOSpartition table, nor Sun, SGI or OSF disklabel

Building a new DOS disklabel with diskidentifier 0xcc19fbe2.

Changes will remain in memory only, untilyou decide to write them.

After that, of course, the previous contentwon't be recoverable.

 

Warning: invalid flag 0x0000 of partitiontable 4 will be corrected by w(rite)

 

WARNING: DOS-compatible mode is deprecated.It's strongly recommended to

        switch off the mode (command 'c') and change display units to

        sectors (command 'u').

 

Command (m for help): m

Command action

  a   toggle a bootable flag

  b   edit bsd disklabel

  c   toggle the dos compatibilityflag

  d   delete a partition

   l   list known partition types

  m   print this menu

  n   add a new partition

  o   create a new empty DOSpartition table

  p   print the partition table

  q   quit without saving changes

  s   create a new empty Sundisklabel

  t   change a partition's system id

  u   change display/entry units

  v   verify the partition table

  w   write table to disk and exit

  x   extra functionality (expertsonly)

 

Command (m for help): n

Command action

  e   extended

  p   primary partition (1-4)

p

Partition number (1-4): 1

First cylinder (1-10443, default 1): (直接回车)

Using default value 1

Last cylinder, +cylinders or +size{K,M,G}(1-10443, default 10443): (直接回车)

Using default value 10443

 

Command (m for help): p

 

Disk /dev/sdb: 85.9 GB, 85899345920 bytes

255 heads, 63 sectors/track, 10443cylinders

Units = cylinders of 16065 * 512 = 8225280bytes

Sector size (logical/physical): 512 bytes /512 bytes

I/O size (minimum/optimal): 512 bytes / 512bytes

Disk identifier: 0xcc19fbe2

 

  Device Boot      Start         End     Blocks   Id  System

/dev/sdb1               1       10443   83883366   83  Linux

 

Command (m for help): w

The partition table has been altered!

 

Calling ioctl() to re-read partition table.

Syncing disks.

[root@segment1-1 ~]#

创建物理卷

[root@segment1-1 ~]# pvcreate /dev/sdb1

 Writing physical volume data to disk "/dev/sdb1"

 Physical volume "/dev/sdb1" successfully created

[root@segment1-1 ~]# pvdisplay

  ---Physical volume ---

  PVName               /dev/sda2

  VGName               vg_segment11

  PV Size               99.51 GiB / not usable 3.00 MiB

 Allocatable           yes (butfull)

  PESize               4.00 MiB

 Total PE              25474

 Free PE               0

 Allocated PE          25474

  PVUUID               JwEYLt-EFX2-GMmL-LJpZ-mxSQ-B5Hl-BaiAb3

 

 "/dev/sdb1" is a new physical volume of "80.00 GiB"

  ---NEW Physical volume ---

  PVName               /dev/sdb1

  VGName             

  PVSize               80.00 GiB

 Allocatable           NO

  PESize               0 

  TotalPE              0

 Free PE               0

 Allocated PE          0

  PVUUID              GPUe1K-H6SN-t6z8-v0nA-rOPv-rP0y-W8j46d

创建虚拟卷组

[root@segment1-1 ~]# vgcreate segment/dev/sdb1

 Volume group "segment" successfully created

创建逻辑卷

[root@segment1-1 ~]# lvcreate -L 78G -nlv_segment segment

 Logical volume "lv_segment" created

[root@segment1-1 ~]# lvs

 LV         VG           Attr   LSize Origin Snap%  Move Log Copy%  Convert

 lv_segment segment      -wi-a-78.00g                                    

 lv_home    vg_segment11 -wi-ao45.60g                                    

 lv_root    vg_segment11 -wi-ao50.00g                                    

 lv_swap    vg_segment11-wi-ao  3.91g                                    

[root@segment1-1 ~]# vgs

 VG           #PV #LV #SN Attr   VSize VFree

 segment        1   1   0wz--n- 80.00g 2.00g

 vg_segment11   1   3   0wz--n- 99.51g    0

[root@segment1-1 ~]#

挂载光盘安装xfs文件系统格式化工具

[root@segment1-1 ~]# mount /dev/cdrom/media/iso

mount: block device /dev/sr0 iswrite-protected, mounting read-only

[root@segment1-1 ~]# vi/etc/yum.repos.d/rhel-source.repo

[root@segment1-1 ~]# df -h

文件系统           容量  已用  可用 已用%% 挂载点

/dev/mapper/vg_segment11-lv_root

                       50G  1.3G  46G   3% /

tmpfs                996M     0 996M   0% /dev/shm

/dev/sda1             485M   31M 429M   7% /boot

/dev/mapper/vg_segment11-lv_home

                       45G  180M  43G   1% /home

/dev/sr0              3.4G  3.4G    0 100% /media/iso

[root@segment1-1 ~]# vi /etc/yum.repos.d/rhel-source.repo

[root@segment1-1 ~]# yum clean all

Loaded plugins: product-id,subscription-manager

Updating certificate-based repositories.

Cleaning repos: local

Cleaning up Everything

[root@segment1-1 ~]# yum update

Loaded plugins: product-id,subscription-manager

Updating certificate-based repositories.

local                                                                                                                   | 4.0 kB     00:00 ...

local/primary_db                                                                                                         |3.1 MB     00:00 ...

Setting up Update Process

No Packages marked for Update   

[root@segment1-1 ~]# cd/media/iso/Packages/

[root@segment1-1 Packages]# yum install xf

xferstats-2.16-21.el6.x86_64.rpm          xfsdump-3.0.4-2.el6.x86_64.rpm           xfsprogs-devel-3.1.1-6.el6.x86_64.rpm

xfig-3.2.5-22.a.1.el6.x86_64.rpm          xfsprogs-3.1.1-6.el6.i686.rpm            xfsprogs-qa-devel-3.1.1-6.el6.i686.rpm

xfig-common-3.2.5-22.a.1.el6.x86_64.rpm   xfsprogs-3.1.1-6.el6.x86_64.rpm          xfsprogs-qa-devel-3.1.1-6.el6.x86_64.rpm

xfig-plain-3.2.5-22.a.1.el6.x86_64.rpm    xfsprogs-devel-3.1.1-6.el6.i686.rpm     

[root@segment1-1 Packages]# yum installxfsprogs-*

Loaded plugins: product-id,subscription-manager

Updating certificate-based repositories.

Setting up Install Process

Examining xfsprogs-3.1.1-6.el6.i686.rpm:xfsprogs-3.1.1-6.el6.i686

Marking xfsprogs-3.1.1-6.el6.i686.rpm to beinstalled

Examining xfsprogs-3.1.1-6.el6.x86_64.rpm:xfsprogs-3.1.1-6.el6.x86_64

xfsprogs-3.1.1-6.el6.x86_64.rpm: does notupdate installed package.

Examiningxfsprogs-devel-3.1.1-6.el6.i686.rpm: xfsprogs-devel-3.1.1-6.el6.i686

Marking xfsprogs-devel-3.1.1-6.el6.i686.rpmto be installed

Examining xfsprogs-devel-3.1.1-6.el6.x86_64.rpm:xfsprogs-devel-3.1.1-6.el6.x86_64

Markingxfsprogs-devel-3.1.1-6.el6.x86_64.rpm to be installed

Examiningxfsprogs-qa-devel-3.1.1-6.el6.i686.rpm: xfsprogs-qa-devel-3.1.1-6.el6.i686

Marking xfsprogs-qa-devel-3.1.1-6.el6.i686.rpmto be installed

Examiningxfsprogs-qa-devel-3.1.1-6.el6.x86_64.rpm: xfsprogs-qa-devel-3.1.1-6.el6.x86_64

Markingxfsprogs-qa-devel-3.1.1-6.el6.x86_64.rpm to be installed

Resolving Dependencies

--> Running transaction check

---> Package xfsprogs.i686 0:3.1.1-6.el6will be installed

--> Processing Dependency: libblkid.so.1for package: xfsprogs-3.1.1-6.el6.i686

--> Processing Dependency:libblkid.so.1(BLKID_2.15) for package: xfsprogs-3.1.1-6.el6.i686

--> Processing Dependency:libblkid.so.1(BLKID_2.17) for package: xfsprogs-3.1.1-6.el6.i686

--> Processing Dependency: libc.so.6 forpackage: xfsprogs-3.1.1-6.el6.i686

--> Processing Dependency:libc.so.6(GLIBC_2.0) for package: xfsprogs-3.1.1-6.el6.i686

--> Processing Dependency:libc.so.6(GLIBC_2.1) for package: xfsprogs-3.1.1-6.el6.i686

--> Processing Dependency:libc.so.6(GLIBC_2.1.3) for package: xfsprogs-3.1.1-6.el6.i686

--> Processing Dependency:libc.so.6(GLIBC_2.11) for package: xfsprogs-3.1.1-6.el6.i686

--> Processing Dependency:libc.so.6(GLIBC_2.2) for package: xfsprogs-3.1.1-6.el6.i686

--> Processing Dependency:libc.so.6(GLIBC_2.3) for package: xfsprogs-3.1.1-6.el6.i686

--> Processing Dependency:libc.so.6(GLIBC_2.3.3) for package: xfsprogs-3.1.1-6.el6.i686

--> Processing Dependency: libc.so.6(GLIBC_2.3.4)for package: xfsprogs-3.1.1-6.el6.i686

--> Processing Dependency:libc.so.6(GLIBC_2.4) for package: xfsprogs-3.1.1-6.el6.i686

--> Processing Dependency:libpthread.so.0 for package: xfsprogs-3.1.1-6.el6.i686

--> Processing Dependency: libpthread.so.0(GLIBC_2.0)for package: xfsprogs-3.1.1-6.el6.i686

--> Processing Dependency:libpthread.so.0(GLIBC_2.1) for package: xfsprogs-3.1.1-6.el6.i686

--> Processing Dependency:libpthread.so.0(GLIBC_2.2) for package: xfsprogs-3.1.1-6.el6.i686

--> Processing Dependency:libpthread.so.0(GLIBC_2.3.2) for package: xfsprogs-3.1.1-6.el6.i686

--> Processing Dependency:libreadline.so.6 for package: xfsprogs-3.1.1-6.el6.i686

--> Processing Dependency: librt.so.1for package: xfsprogs-3.1.1-6.el6.i686

--> Processing Dependency:librt.so.1(GLIBC_2.2) for package: xfsprogs-3.1.1-6.el6.i686

--> Processing Dependency: libuuid.so.1for package: xfsprogs-3.1.1-6.el6.i686

--> Processing Dependency:libuuid.so.1(UUID_1.0) for package: xfsprogs-3.1.1-6.el6.i686

---> Package xfsprogs-devel.i6860:3.1.1-6.el6 will be installed

---> Package xfsprogs-devel.x86_640:3.1.1-6.el6 will be installed

---> Package xfsprogs-qa-devel.i6860:3.1.1-6.el6 will be installed

---> Package xfsprogs-qa-devel.x86_640:3.1.1-6.el6 will be installed

--> Running transaction check

---> Package glibc.i686 0:2.12-1.47.el6will be installed

--> Processing Dependency:libfreebl3.so(N×××AWHASH_3.12.3) for package: glibc-2.12-1.47.el6.i686

--> Processing Dependency: libfreebl3.sofor package: glibc-2.12-1.47.el6.i686

---> Package libblkid.i6860:2.17.2-12.4.el6 will be installed

---> Package libuuid.i6860:2.17.2-12.4.el6 will be installed

---> Package readline.i686 0:6.0-3.el6will be installed

--> Processing Dependency: libtinfo.so.5for package: readline-6.0-3.el6.i686

--> Running transaction check

---> Package ncurses-libs.i6860:5.7-3.20090208.el6 will be installed

---> Package nss-softokn-freebl.i6860:3.12.9-11.el6 will be installed

--> Finished Dependency Resolution

 

Dependencies Resolved

 

================================================================================================================================================

Package                         Arch                Version                           Repository                                          Size

================================================================================================================================================

Installing:

xfsprogs                        i686                3.1.1-6.el6                       /xfsprogs-3.1.1-6.el6.i686                         3.4 M

xfsprogs-devel                  i686                3.1.1-6.el6                      /xfsprogs-devel-3.1.1-6.el6.i686                    55 k

xfsprogs-devel                  x86_64              3.1.1-6.el6                      /xfsprogs-devel-3.1.1-6.el6.x86_64                  58 k

xfsprogs-qa-devel               i686                3.1.1-6.el6                      /xfsprogs-qa-devel-3.1.1-6.el6.i686                355 k

xfsprogs-qa-devel               x86_64              3.1.1-6.el6                      /xfsprogs-qa-devel-3.1.1-6.el6.x86_64             355 k

Installing for dependencies:

glibc                           i686                2.12-1.47.el6                     local                                              4.3 M

libblkid                        i686                2.17.2-12.4.el6                   local                                             116 k

libuuid                         i686                2.17.2-12.4.el6                   local                                              65 k

ncurses-libs                    i686                5.7-3.20090208.el6                local                                             251 k

nss-softokn-freebl              i686                3.12.9-11.el6                     local                                             116 k

readline                        i686                6.0-3.el6                         local                                             176 k

 

Transaction Summary

================================================================================================================================================

Install     11 Package(s)

 

Total size: 9.2 M

Total download size: 5.0 M

Installed size: 19 M

Is this ok [y/N]: y

Downloading Packages:

------------------------------------------------------------------------------------------------------------------------------------------------

Total                                                                                                           33 MB/s |5.0 MB     00:00   

warning: rpmts_HdrFromFdno: Header V3RSA/SHA256 Signature, key ID fd431d51: NOKEY

Retrieving key fromfile:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

Importing GPG key 0xFD431D51:

Userid : Red Hat, Inc. (release key 2)<security@redhat.com>

Package:redhat-release-server-6Server-6.2.0.3.el6.x86_64(@anaconda-RedHatEnterpriseLinux-201111171049.x86_64/6.2)

From  : /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

Is this ok [y/N]: y

Importing GPG key 0x2FA658E0:

Userid : Red Hat, Inc. (auxiliary key)<security@redhat.com>

Package:redhat-release-server-6Server-6.2.0.3.el6.x86_64(@anaconda-RedHatEnterpriseLinux-201111171049.x86_64/6.2)

From  : /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

Is this ok [y/N]: y

Running rpm_check_debug

Running Transaction Test

Transaction Test Succeeded

Running Transaction

 Installing : glibc-2.12-1.47.el6.i686                                                                                                   1/11

  Installing :nss-softokn-freebl-3.12.9-11.el6.i686                                                                                      2/11

 Installing : libuuid-2.17.2-12.4.el6.i686                                                                                               3/11

 Installing : libblkid-2.17.2-12.4.el6.i686                                                                                              4/11

 Installing : ncurses-libs-5.7-3.20090208.el6.i686                                                                                        5/11

 Installing : readline-6.0-3.el6.i686                                                                                                    6/11

 Installing : xfsprogs-3.1.1-6.el6.i686                                                                                                   7/11

 Installing : xfsprogs-devel-3.1.1-6.el6.x86_64                                                                                          8/11

 Installing : xfsprogs-qa-devel-3.1.1-6.el6.x86_64                                                                                       9/11

 Installing : xfsprogs-qa-devel-3.1.1-6.el6.i686                                                                                        10/11

 Installing : xfsprogs-devel-3.1.1-6.el6.i686                                                                                           11/11

local/productid                                                                                                         | 1.7kB     00:00 ...

Installed products updated.

 

Installed:

 xfsprogs.i686 0:3.1.1-6.el6                    xfsprogs-devel.i6860:3.1.1-6.el6               xfsprogs-devel.x86_64 0:3.1.1-6.el6        

 xfsprogs-qa-devel.i686 0:3.1.1-6.el6           xfsprogs-qa-devel.x86_640:3.1.1-6.el6        

 

Dependency Installed:

 glibc.i686 0:2.12-1.47.el6             libblkid.i686 0:2.17.2-12.4.el6 libuuid.i686 0:2.17.2-12.4.el6ncurses-libs.i686 0:5.7-3.20090208.el6

 nss-softokn-freebl.i686 0:3.12.9-11.el6 readline.i686 0:6.0-3.el6    

 

Complete!

[root@segment1-1 Packages]#

格式化逻辑卷

[root@segment1-1 ~]# mkfs.xfs -f/dev/segment/lv_segment

meta-data=/dev/segment/lv_segmentisize=256    agcount=4, agsize=5111808blks

        =                       sectsz=512   attr=2

data    =                      bsize=4096   blocks=20447232,imaxpct=25

        =                      sunit=0      swidth=0 blks

naming  =version 2             bsize=4096   ascii-ci=0

log     =internal log           bsize=4096  blocks=9984, version=2

        =                      sectsz=512   sunit=0 blks,lazy-count=1

realtime =none                   extsz=4096   blocks=0, rtextents=0

查看文件系统的挂载情况

[root@segment1-1 ~]# df -hT

文件系统    类型      容量  已用  可用 已用%% 挂载点

/dev/mapper/vg_segment11-lv_root

              ext4     50G 1.4G   46G   3% /

tmpfs       tmpfs    996M     0 996M   0% /dev/shm

/dev/sda1     ext4   485M   31M  429M  7% /boot

/dev/mapper/vg_segment11-lv_home

              ext4     45G 180M   43G   1% /home

/dev/sr0  iso9660    3.4G  3.4G    0 100% /media/iso

创建挂载路径

[root@segment1-1 ~]# mkdir /data

挂载

[root@segment1-1 ~]# mount/dev/segment/lv_segment /data

[root@segment1-1 ~]# df -h

文件系统           容量  已用  可用 已用%% 挂载点

/dev/mapper/vg_segment11-lv_root

                       50G  1.4G  46G   3% /

tmpfs                 996M     0 996M   0% /dev/shm

/dev/sda1             485M   31M 429M   7% /boot

/dev/mapper/vg_segment11-lv_home

                      45G  180M  43G   1% /home

/dev/sr0              3.4G  3.4G    0 100% /media/iso

/dev/mapper/segment-lv_segment

                       78G   33M  78G   1% /data

查看挂载以及挂载的文件系统

[root@segment1-1 ~]# df -hT

文件系统    类型      容量  已用  可用 已用%% 挂载点

/dev/mapper/vg_segment11-lv_root

              ext4     50G 1.4G   46G   3% /

tmpfs       tmpfs    996M     0 996M   0% /dev/shm

/dev/sda1     ext4   485M   31M  429M  7% /boot

/dev/mapper/vg_segment11-lv_home

              ext4     45G 180M   43G   1% /home

/dev/sr0  iso9660    3.4G  3.4G    0 100% /media/iso

/dev/mapper/segment-lv_segment

               xfs     78G  33M   78G   1% /data

[root@segment1-1 ~]#

 

系统优化

修改磁盘参数

[root@segment1-1 ~]# vi /boot/grub/menu.lst

 

# grub.conf generated by anaconda

#

# Note that you do not have to rerun grubafter making changes to this file

# NOTICE: You have a /boot partition.  Thismeans that

#         all kernel and initrd paths are relative to /boot/, eg.

#         root (hd0,0)

#         kernel /vmlinuz-version ro root=/dev/mapper/vg_segment11-lv_root

#         initrd /initrd-[generic-]version.img

#boot=/dev/sda

default=0

timeout=5

splashp_w_picpath=(hd0,0)/grub/splash.xpm.gz

hiddenmenu

title Red Hat Enterprise Linux(2.6.32-220.el6.x86_64)

       root (hd0,0)

       kernel /vmlinuz-2.6.32-220.el6.x86_64 roroot=/dev/mapper/vg_segment11-lv_root nomodeset rd_NO_LUKSrd_LVM_LV=vg_segment11/lv_swap rd_LVM_LV=vg_segment11/lv_root rd_NO_MD quietrhgb crashkernel=auto.UTF-8 KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM elevator=deadline

       initrd /initramfs-2.6.32-220.el6.x86_64.img

 

查看块大小

[root@master tmp]# /sbin/blockdev --getra/dev/sda

256 

修改sysctl.conf

[root@master ~]# vim /etc/sysctl.conf

 

kernel.shmmni = 4096

kernel.sem = 250 5120000 100 20480

#SEMMSL SEMMNS SEMOPM SEMMNI

kernel.msgmni = 2048

net.ipv4.tcp_syncookies = 1

net.ipv4.ip_forward = 0

net.ipv4.tcp_tw_recycle = 1

net.ipv4.tcp_max_syn_backlog = 4096

net.ipv4.conf.default.arp_filter = 1

net.ipv4.conf.all.arp_filter = 1

net.ipv4.ip_local_port_range = 1025 65535

net.core.netdev_max_backlog = 10000

vm.overcommit_memory = 2

 

[root@master ~]# sysctl -p

net.ipv4.ip_forward = 0

net.ipv4.conf.default.rp_filter = 1

net.ipv4.conf.default.accept_source_route =0

kernel.sysrq = 1

kernel.core_uses_pid = 1

net.ipv4.tcp_syncookies = 1

error:"net.bridge.bridge-nf-call-ip6tables" is an unknown key

error:"net.bridge.bridge-nf-call-iptables" is an unknown key

error:"net.bridge.bridge-nf-call-arptables" is an unknown key

kernel.msgmnb = 65536

kernel.msgmax = 65536

kernel.shmmax = 68719476736

kernel.shmall = 42949672960

kernel.shmmni = 4096

kernel.sem = 250 5120000 100 20480

kernel.msgmni = 2048

net.ipv4.tcp_syncookies = 1

net.ipv4.ip_forward = 0

net.ipv4.tcp_tw_recycle = 1

net.ipv4.tcp_max_syn_backlog = 4096

net.ipv4.conf.default.arp_filter = 1

net.ipv4.conf.all.arp_filter = 1

net.ipv4.ip_local_port_range = 1025 65535

net.core.netdev_max_backlog = 10000

vm.overcommit_memory = 2

[root@master ~]#

 

拷贝到4segment服务器

[root@master ~]# scp /etc/sysctl.conf root@168.168.168.19:/etc/

root@168.168.168.19's password:

sysctl.conf                                                                                                  100% 1548     1.5KB/s  00:00   

[root@master ~]# scp /etc/sysctl.conf root@168.168.168.20:/etc/

root@168.168.168.20's password:

sysctl.conf                                                                                                  100% 1548     1.5KB/s  00:00   

[root@master ~]# scp /etc/sysctl.conf root@168.168.168.21:/etc/

root@168.168.168.21's password:

sysctl.conf                                                                                                  100% 1548     1.5KB/s   00:00   

[root@master ~]# scp /etc/sysctl.conf root@168.168.168.22:/etc/

root@168.168.168.22's password:

sysctl.conf

修改limits.conf

[root@master ~]# vi/etc/security/limits.conf

* soft nofile 65536

* hard nofile 65536

* soft nproc 131072

* hard nproc 131072

* soft core unlimited

 

拷贝到4segment节点

[root@master ~]# scp/etc/security/limits.conf root@168.168.168.19:/etc/security/

root@168.168.168.19's password:

limits.conf                                                                                                  100%1929     1.9KB/s   00:00   

[root@master ~]# scp/etc/security/limits.conf root@168.168.168.20:/etc/security/

root@168.168.168.20's password:

limits.conf                                                                                                  100%1929     1.9KB/s   00:00   

[root@master ~]# scp/etc/security/limits.conf root@168.168.168.21:/etc/security/

root@168.168.168.21's password:

limits.conf                                                                                                  100%1929     1.9KB/s   00:00   

[root@master ~]# scp/etc/security/limits.conf root@168.168.168.22:/etc/security/

root@168.168.168.22's password:

limits.conf

修改90-nproc.conf

注意:对于RedHat6.x系统,还需要将/etc/security/limits.d/90-nproc.conf文件中的1024修改为131072

[root@master ~]# vi/etc/security/limits.d/90-nproc.conf

*         soft    nproc     131072

 

[root@master ~]# scp/etc/security/limits.d/90-nproc.confroot@168.168.168.22:/etc/security/limits.d/

root@168.168.168.22's password:

90-nproc.conf                                                                                                100%  154     0.2KB/s  00:00   

[root@master ~]# scp/etc/security/limits.d/90-nproc.confroot@168.168.168.21:/etc/security/limits.d/

root@168.168.168.21's password:

90-nproc.conf                                                                                                100%  154     0.2KB/s  00:00   

[root@master ~]# scp/etc/security/limits.d/90-nproc.conf root@168.168.168.20:/etc/security/limits.d/

root@168.168.168.20's password:

90-nproc.conf                                                                                                100%  154     0.2KB/s  00:00   

[root@master ~]# scp/etc/security/limits.d/90-nproc.conf root@168.168.168.19:/etc/security/limits.d/

root@168.168.168.19's password:

90-nproc.conf                                                                                                100%  154     0.2KB/s  00:00   

[root@master ~]#

安装ntp服务器

[root@master ~]# yum install ntp*

Loaded plugins: product-id,subscription-manager

Updating certificate-based repositories.

Setting up Install Process

Resolving Dependencies

--> Running transaction check

---> Package ntp.x86_64 0:4.2.4p8-2.el6will be installed

---> Package ntpdate.x86_640:4.2.4p8-2.el6 will be installed

--> Finished Dependency Resolution

 

Dependencies Resolved

 

====================================================================================================

 Package                          Arch                            Version                          

====================================================================================================

Installing:

 ntp                              x86_64                          4.2.4p8-2.el6                    

 ntpdate                          x86_64                          4.2.4p8-2.el6                    

 

Transaction Summary

====================================================================================================

Install       2 Package(s)

 

Total download size: 503 k

Installed size: 1.2 M

Is this ok [y/N]: y

Downloading Packages:

----------------------------------------------------------------------------------------------------

Total                                                                                               

warning: rpmts_HdrFromFdno: Header V3RSA/SHA256 Signature, key ID fd431d51: NOKEY

Retrieving key fromfile:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

Importing GPG key 0xFD431D51:

 Userid : Red Hat, Inc. (release key 2)<security@redhat.com>

 Package:redhat-release-server-6Server-6.2.0.3.el6.x86_64(@anaconda-RedHatEnterpriseLinux-20111117

 From   :/etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

Is this ok [y/N]: y

Importing GPG key 0x2FA658E0:

 Userid : Red Hat, Inc. (auxiliary key)<security@redhat.com>

 Package:redhat-release-server-6Server-6.2.0.3.el6.x86_64(@anaconda-RedHatEnterpriseLinux-20111117

 From   :/etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

Is this ok [y/N]: y

Running rpm_check_debug

Running Transaction Test

Transaction Test Succeeded

Running Transaction

 Installing : ntpdate-4.2.4p8-2.el6.x86_64                                                        

 Installing : ntp-4.2.4p8-2.el6.x86_64                                                             

local/productid                                                                                    

Installed products updated.

 

Installed:

 ntp.x86_64 0:4.2.4p8-2.el6                                          ntpdate.x86_64 0:4.2.4p8-2.el

 

Complete!


[root@master ~]# chkconfig ntpd on

[root@master ~]# clock

20150918 星期五 012905  -0.062791 seconds

[root@master ~]# date -s 09/17/2015

2015 09 17 星期四 00:00:00 CST

[root@master ~]# date -s 17:27:30

2015 09 17 星期四 17:27:30 CST

[root@master ~]# clock -w

[root@master ~]# clock

20150917 星期四 172738  -0.906502 seconds

[root@master ~]# vim /etc/ntp.conf

-bash: vim: command not found

[root@master ~]# vi /etc/ntp.conf

修改配置文件使所有的segment与master主机时间同步

配置用户以及用户组

[root@master ~]# groupadd gpadmin

[root@master ~]# passwd gpadmin

重启服务器