通过Hadoop实现集群分布式计算
hadoop是一个分布式系统基础架构,由Apache基金会开发.用户可以在不了解分布式底层细节的情况下,开发分布式程序.充分利用集群的威力高速运算和存储. Hadoop实现了一个分布式文件系统(Hadoop Distributed File System),简称HDFS. HDFS有着高容错性的特点,并且设计用来部署在低廉的(low-cost)硬件上. 而且它提供高传输率(high throughput)来访问应用程序的数据, 适合那些有着超大数据集(large data set)的应用程序. HDFS放宽了(relax)POSIX的要求(requirements)这样可以流的形式访问(streaming access)文件系统中的数据.
好现在我们就在centos操作系统里面来实际操作一下:
以下集群配置内容,以两台机器为例.其中一台是 master ,另一台是 slave1 . master 上运行:
name node, data node, task tracker, job tracker , secondary name node
slave1 上运行:
data node, task tracker
前面加 表示对两台机器采取相同的操作.
1.安装 JDK
yum install java-1.6.0-openjdk-devel
2.设置环境变量 编辑/etc/profile文件,设置 JAVA_HOME 环境变量以及类路径:
export JAVA_HOME="/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64"
export PATH=$PATH:$JAVA_HOME/bin
export CLASSPATH=.:$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jar
3.添加 hosts 的映射 编辑/etc/hosts文件,注意 host name 不要有下划线,见下步骤 9.
192.168.225.16 master
192.168.225.66...
centos下yum升级php到5.3 升级mysql到5.5
不保证本文链接永久有效,如果失效请去rpm search 下载对应软件包.
1、运行以下命令
wget http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/5/remi/i386/remi-release-5-7.el5.remi.noarch.rpm
rpm -Uvh remi-release-5*.rpm epel-release-5*.rpm
2、编辑 /etc/yum.repos.d/remi.repo
vi /etc/yum.repos.d/remi.repo
在这个文件的最后增加一行:
priority=1
保存退出. /etc/yum.repos.d/epel.repo和/etc/yum.repos.d/epel-testing.repo这两个文件也按照上面的方法进行编辑! 3、使用下面的命令进行升级,如果单独升级php将提示失败,只有联同mysql一起升级才可以,所我们必须执行以下命令才能升级php到5.3版本:
yum --enablerepo=remi update php* mysql*
去掉linux系统开机动画
编辑:
/boot/grub/grub.conf
注释掉:
splashimage=(hd0,6)/grub/splash.xpm.gz
开机的动画显示就消失了,剩下的就是文本的启动界面了,看上去很专业的.
关闭CENTOS不必要的默认服务
关闭服务启动命令:
chkconfig –level 2345 服务名称 off
系统服务说明:
服務名稱
建議
說明
acpid
停用
Advanced Configuration and Power Interface 電源進階設定,常用在 Laptop 上
apmd
停用
Adventage Power Management daemon 偵測系統的電池電量,常用在 Laptop 上
atd
停用
/etc/at.allow,/etc/at.deny 我大概都使用 crond 來達成
autofs
停用
自動掛載檔案系統與週邊裝置 (如光碟、USB),常用在 Laptop 上
avahi-daemon
停用
當區網沒有 DNS 服務時會試著尋找提供 zeroconf 協定的主機
bluetooth
停用
Bluetooth 藍芽,常用在 Laptop 上
cpuspeed
停用
控制 CPU 速度主要用來省電,常用在 Laptop 上
cups
停用
Common UNIX Printing System 使系統支援印表機
firstboot
停用
安裝完成後第一次啟動時的服務,設定 auth、firewall、keyboard…
gpm
停用
記錄週邊裝置的檔案資料,例如文字模式下可使用滑鼠
haldaemon
停用
使系統支援 plug and play 裝置
hidd
停用
使系統支援藍芽裝置,例如滑鼠,鍵盤
hplip
停用
使系統支援 HP 相關型號印表機
ip6tables
停用
使系統支援 IPTables Filrewall IPv6
isdn
停用
使系統支援 Integrated Services Digital Network (ISDN) 環境
lm_sensors
停用
使系統支援偵測主機版或硬體,常用在 Laptop 上
messagebus
停用
使系統支援 plug and play 裝置
nfslock
停用
使系統支援 NFS Server...
禁止Apache列出目录文件
默认情况下,Apache服务器会列出网站目录中的文件及子目录,这对于用于发布站点的服务器来说是很不安全的,所以需要禁用,修改httpd.conf配置文件中的对应设置即可.
问题的现象:
如果你的网站目录下有一个xxx的文件夹,如果xxx文件夹下没有默认页面(index.*等),当用户使用URL:http://你的网址/a/ 访问你的网站的话,Apache会把xxx文件夹里的内容全列出来.
解决方法:
要禁止此功能,修改httpd.conf. 找到下面这一句删除掉Indexes即可.
Options Indexes FollowSymLinks
配置示例:
<Directory "E:/Program Files/Apache Software Foundation/Apache2.2/htdocs">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
# 就是这一行,只去掉indexes也可
#Options Indexes FollowSymLinks
Options...
修改linux网络参数
linux下修改IP、DNS、路由命令行设置 ubuntu 版本命令行设置IP.
cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.1.104
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.2
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 58.22.96.66 218.104.128.106 202.101.138.8
重启网卡:
/etc/init.d/networking restatr
redhat linux版本命令行设置IP:
ifconfig eth0 新ip
然后编辑 /etc/sysconfig/network-scripts/ifcfg-eth0,修改ip.
一、修改IP地址
vi ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=static
IPADDR=219.136.241.211
NETMASK=255.255.255.128
GATEWAY=219.136.241.254
二、修改网关
vi...