Linux下 安装好了jdk,输入jps时,系统提示“-bash: jps: command not found”。
前言:在网上有好多说是以 root 身份 vi /etc/profile,然后在下面加一行 export PATH="usr/java/jdk160_05/bin:$PATH"(其中 jdk160_05 是你的安装目录,依你自己的安装情况所决定),然后 source /etc/profile 即可解决。
Hadoop,zookeeper,HBase,Spark集群环境搭建【面试+工作】
在 安装和配置Hadoop(单节点) 这篇文章中,已经进行了Hadoop单机伪集群模式的部署。生产环境中,Hadoop都是以集群方式进行安装和部署的,否则,就不需要使用Hadoop了,分布式存储和分布式运算是Hadoop提供的核心功能。这篇文章将在单机安装的基础上,进行3个节点Hadoop集群的安装,因此如果你还没有单机安装过Hadoop,那么请先查看一下单机安装的这篇文章。
集群中只有mapred-site.xml.template,可以从这个文件进行复制
jps类似linux的ps命令,不同的是ps是用来显示进程,而jps只显示java进程,准确的说是当前用户已启动的部分java进程信息,信息包括进程号和简短的进程command。
准备至少3台机器(通过克隆虚拟机;配置好网络JDK 时间 hosts,保证节点间能互ping通)
1.环境前置说明: MAC电脑:自带的ssh终端 ssh hadoop@hadoop-machine ssh hadoop@192.168.21.166 Windws系统:CRT,XShell客户端 远程服务器:CentOS 6.7 hadoop-machine(192.168.21.166)是远程服务器的hostname 如果想在本地通过ssh hadoop@hadoop-machine远程登录, 那么本地的hosts肯定要添加ip和hostname的映射 192.168.21.16
本文详细介绍搭建4个节点的完全分布式Hadoop集群的方法,Linux系统版本是CentOS 7,Hadoop版本是2.7.7,JDK版本是1.8。
我们在大数据的日常生产当中会经常使用到jps命令,如果问起很多人他们都会知道jps命令是用来干什么的,查看java相关的进程。但是这个命令是属于哪个组件提供的呢?最起码可以肯定不是linux系统自带的。
特殊说明: 解决问题的光鲜,藏着磕Bug的痛苦。 万物皆入轮回,谁也躲不掉! 以上文章,均是我实际操作,写出来的笔记资料,不会出现全文盗用别人文章!烦请各位,请勿直接盗用!
Elasticsearch是一个基于Lucene的搜索服务器。它提供了一个分布式多用户能力的全文搜索引擎,基于RESTful web接口。Elasticsearch是用Java开发的,并作为Apache许可条款下的开放源码发布,是当前流行的企业级搜索引擎。它可以快速地储存、搜索和分析海量数据。维基百科、Stack Overflow、Github也都采用它做的搜索。 更多Elasticsearch的相关知识,请阅读官网《Elasticsearch: 权威指南》。
1)在各个JournalNode节点上,输入以下命令启动journalnode服务:(前提zookeeper集群已启动)
在上篇博客中简单介绍了Zookeeper的特点和应用场景,详情可参考:《Zookeeper简介(一)》,那么这篇博客我们介绍一下关于Zookeeper的单机模式安装步骤与配置。
1.安装前提条件 (1)首先安装jdk,最好安装1.7及1.7以上版本,并且安装jdk的环境变量 vi ~/.bashrc export JAVA_HOME=/usr/local/software/jdk1.8.0_141 export PATH=$JAVA_HOME/bin:$PATH (2)检查ssh和sshd是否安装,如果没有安装, ubuntu下面安装ssh和sshd: $ sudo apt-get install ssh $ sudo apt-
版权声明:本文为王小雷原创文章,未经博主允许不得转载 https://blog.csdn.net/dream_an/article/details/80700530
下面操作在linux环境下完成。如果您的电脑没有虚拟机环境,可以参考VMware软件下载(含秘钥).zip_免费高速下载|百度网盘-分享无限制 (baidu.com)配置。这里我们部署三台虚拟机环境,使用xshell工具对其进行统一的操作。关于使用xshell的原因和安装使用方法可用参考博客:XShell的安装和使用 - 简书 (jianshu.com)。
Zookeeper 是一个开源的分布式的,为分布式框架提供协调服务的 Apache 项目。
Hadoop搭建流程网上有很多,以下是我在搭建Hadoop伪分布式环境是遇到的一些比较菜鸟的问题。
Apache NiFi可以基于Linux和Window安装,这里建议基于Linux安装。安装NiFi的节点需要安装JDK8,NiFi0.x版本需要JDK7。NiFi安装可以单节点安装,也可以分布式安装。我们这里安装NiFi的1.13版本,需要JDK8。
HA:High Available,高可用 在Hadoop 2.0之前,在HDFS集群中NameNode存在单点故障 (SPOF:A Single Point of Failure) 对于只有一个NameNode的集群,如果NameNode机器出现故障(比如宕机或是软件、硬件升级),那么整个集群将无法使用,直到NameNode重新启动
因为在之前的博客在Linux中部署集群(零基础速学!)中,上述的准备操作均已详细描述,这里对于准备工作的内容就不做过多讲解。接下来正式开始进行集群环境的搭建
现在是资源共享的时代,同样也是知识分享的时代,如果你觉得本文能学到知识,请把知识与别人分享。
从官网http://apache.fayea.com/hadoop/common/ 下载hadoop
1)将apache-kylin-2.5.1-bin-hbase1x.tar.gz上传到Linux 2)解压apache-kylin-2.5.1-bin-hbase1x.tar.gz到/opt/module
32位:http://releases.ubuntu.com/16.04/ubuntu-16.04-desktop-i386.iso
node0、node1、node2三台机器之间要设置SSH免密码登录,详细的设置步骤请参考《Linux配置SSH免密码登录(非root账号)》;
HBase 需要依赖 JDK 环境,同时 HBase 2.0+ 以上版本不再支持 JDK 1.7 ,需要安装 JDK 1.8+ 。JDK 安装方式见本仓库:
spark官网下载:http://spark.apache.org/downloads.html
如上图,一共三台机器作为集群,servera作为master,其他两台作为worker。
jps位于jdk的bin目录下,其作用是显示当前系统的java进程情况,及其id号。 jps相当于Solaris进程工具ps。不象”pgrep java”或”ps -ef grep java”,jps并不使用应用程序名来查找JVM实例。因此,它查找所有的Java应用程序,包括即使没有使用java执行体的那种(例如,定制的启动 器)。另外,jps仅查找当前用户的Java进程,而不是当前系统中的所有进程。
Hadoop生态圈仍处于欣欣向荣的发展态势,不断涌现新的技术和名词。Hadoop的HDFS、YARN、MapReduce仍是最基础的部分,这篇文章记录了如何一步步在linux上安装单节点的Hadoop,之后就可以在它上面做一些练习了。截至目前(2018.7.16),Hadoop的最新版本是3.0.3,但使用最新版本的问题是:当你遇到问题时,所能找到的资料或者书籍都是针对较晚版本的。因此,对一项技术,如果没有达到特别熟悉,安装次新、或者次次新版本是一个相对稳妥的做法。所以,我选择安装的是2.9.1版本。
解决 Apache Hadoop 启动时 DataNode 没有启动的问题(注意这会删除 HDFS 中原有的所有数据,如果原有的数据很重要请不要这样做)。
本文用于解决 Apache Hadoop 启动时 DataNode 启动异常的问题,但是请注意这会删除 HDFS 中原有的所有数据,如果原有的数据很重要请不要这样做。
概述 jps 命令类似与 linux 的 ps 命令,但是它只列出系统中所有的 Java 应用程序。 通过 jps 命令可以方便地查看 Java 进程的启动类、传入参数和 Java 虚拟机参数等信息。
在上文的基础上本文来介绍下zookeeper的集群搭建。准备环境如果不清楚的可以参考上文:
从物理部署层面上来看,Spark主要分为两种类型的节点,Master节点和Worker节点,Master节点主要运行集群管理器的中心化部分,所承载的作用是分配Application到Worker节点,维护Worker节点,Driver,Application的状态。Worker节点负责具体的业务运行。
在linux环境下显示一个进程的信息大家可能一直都在使用ps命令,比如用以下命令来显示当前系统执行的java进程:
ElasticSearch-head是一个H5编写的ElasticSearch集群操作和管理工具,可以对集群进行傻瓜式操作。
jps(Java Virtual Machine Process Status Tool)是JDK 1.5提供的一个显示当前所有java进程pid的命令,简单实用,非常适合在linux/unix平台上简单察看当前java进程的一些简单情况。它和linux中的ps有类似的功能。
版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
上学期在Mac上搭建好了Hadoop,因为这学期开学重装了系统就没了,以为不会再折腾,结果大数据作业又要整hadoop,于是乎,爱折腾的程序猿又来折腾咯,有过上一次安装的经历,这次简单多了,下面简单的列举主要步骤。
系统信息 arch 显示机器的处理器架构(1) uname -m 显示机器的处理器架构(2) uname -r 显示正在使用的内核版本 dmidecode -q 显示硬件系统部件 - (SMBIOS / DMI) hdparm -i /dev/hda 罗列一个磁盘的架构特性 hdparm -tT /dev/sda 在磁盘上执行测试性读取操作 cat /proc/cpuinfo 显示CPU info的信息 cat /proc/interrupts 显示中断 cat /proc/meminfo 校验内存使用 cat /proc/swaps 显示哪些swap被使用 cat /proc/version 显示内核的版本 cat /proc/net/dev 显示网络适配器及统计 cat /proc/mounts 显示已加载的文件系统 lspci -tv 罗列 PCI 设备 lsusb -tv 显示 USB 设备 date 显示系统日期 cal 2007 显示2007年的日历表 date 041217002007.00 设置日期和时间 - 月日时分年.秒 clock -w 将时间修改保存到 BIOS 关机 (系统的关机、重启以及登出 ) shutdown -h now 关闭系统(1) init 0 关闭系统(2) telinit 0 关闭系统(3) shutdown -h hours:minutes & 按预定时间关闭系统 shutdown -c 取消按预定时间关闭系统 shutdown -r now 重启(1) reboot 重启(2) logout 注销 文件和目录 cd /home 进入 '/ home' 目录' cd .. 返回上一级目录 cd ../.. 返回上两级目录 cd 进入个人的主目录 cd ~user1 进入个人的主目录 cd - 返回上次所在的目录 pwd 显示工作路径 ls 查看目录中的文件 ls -F 查看目录中的文件 ls -l 显示文件和目录的详细资料 ls -a 显示隐藏文件 ls *[0-9]* 显示包含数字的文件名和目录名 tree 显示文件和目录由根目录开始的树形结构(1) lstree 显示文件和目录由根目录开始的树形结构(2) mkdir dir1 创建一个叫做 'dir1' 的目录' mkdir dir1 dir2 同时创建两个目录 mkdir -p /tmp/dir1/dir2 创建一个目录树 rm -f file1 删除一个叫做 'file1' 的文件' rmdir dir1 删除一个叫做 'dir1' 的目录' rm -rf dir1 删除一个叫做 'dir1' 的目录并同时删除其内容 rm -rf dir1 dir2 同时删除两个目录及它们的内容 mv dir1 new_dir 重命名/移动 一个目录 cp file1 file2 复制一个文件 cp dir/* . 复制一个目录下的所有文件到当前工作目录 cp -a /tmp/dir1 . 复制一个目录到当前工作目录 cp -a dir1 dir2 复制一个目录 ln -s file1 lnk1 创建一个指向文件或目录的软链接 ln file1 lnk1 创建一个指向文件或目录的物理链接 touch -t 0712250000 file1 修改一个文件或目录的时间戳 - (YYMMDDhhmm) file file1 outputs the mime type of the file as text iconv -l 列出已知的编码 iconv -f fromEncoding -t toEncoding inputFile > outputFile creates a new from the given input file by assuming it is encoded in fromEncoding and converting it to toEncoding. find . -maxdepth 1 -name *.jpg -print -exec convert "{}" -resize 80x60 "thumbs/{}" \; batch resize files in the current directory and send them to a thumbnails directory (requires convert from Imagemagick) 文件搜索 find / -name file1 从 '/' 开始进入根文件系统搜索文件和目录 find / -user user1 搜索属于用户 'user1' 的文件和目录 find /home/user1
https://github.com/eyjian/libmooon/releases
ZooKeeper可以独立搭建集群,HBase本身不能独立搭建集群需要和Hadoop和HDFS整合。
输出java版本 虽然默认已经将Java的路径配置到了系统环境变量中,但由于后续需要使用JAVA_HOME,我们最好将JAVA_HOME显式写入到系统的配置文件中。参考链接:https://segmentfault.com/a/1190000007950960
通过前面的几篇博客,我们介绍了Java虚拟机的内存分配以及内存回收等理论知识,了解这些知识对于我们在实际生产环境中提高系统的运行效率是有很大的帮助的。但是话又说回来,在实际生产环境中,线上项目正在运行,我们怎么去监控虚拟机运行效率?又或者线上项目发生了OOM,异常堆栈信息,我们又怎么去抓取,然后怎么去分析定位问题呢?
先参考:《Hadoop-2.3.0-cdh5.1.0伪分布安装(基于CentOS)》 http://www.linuxidc.com/Linux/2014-09/106372.htm
领取专属 10元无门槛券
手把手带您无忧上云