当前位置: 首页 > news >正文

要怎样建立自己的网站seo网站排名优化公司哪家

要怎样建立自己的网站,seo网站排名优化公司哪家,游戏开发工作室,巴南区网站建设获取虚拟机的ip 虚拟机终端输入 ip a关闭虚拟机防火墙 sudo ufw disable修改Hadoop的core-site.xml文件 将localhost修改为虚拟机局域网IP # 位置可能不一样,和Hadoop安装位置有关 cd /usr/local/hadoop/etc/hadoop vim core-site.xmlIDEA 连接 创建Maven项目…

获取虚拟机的ip

虚拟机终端输入

ip a

在这里插入图片描述

关闭虚拟机防火墙

sudo ufw disable

修改Hadoop的core-site.xml文件

localhost修改为虚拟机局域网IP

# 位置可能不一样,和Hadoop安装位置有关
cd /usr/local/hadoop/etc/hadoop
vim core-site.xml

在这里插入图片描述

IDEA 连接

创建Maven项目

IDEA自带Maven,如果需要自己安装Maven可以参考安装Maven
创建项目,选择Maven,模板选择第一个maven-archetype-archetype
在这里插入图片描述

添加依赖(pom.xml)

记得修改自己hadoop的版本,我的是3.3.5
设置好后Reload一下

  <properties><hadoop.version>3.3.5</hadoop.version></properties><dependencies><dependency><groupId>org.apache.hadoop</groupId><artifactId>hadoop-common</artifactId><version>${hadoop.version}</version></dependency><dependency><groupId>org.apache.hadoop</groupId><artifactId>hadoop-hdfs</artifactId><version>${hadoop.version}</version></dependency><dependency><groupId>org.apache.hadoop</groupId><artifactId>hadoop-client</artifactId><version>${hadoop.version}</version></dependency></dependencies>

在这里插入图片描述
设置好后Reload一下
在这里插入图片描述

创建Java文件并运行

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.*;import java.io.IOException;public class Test01 {public static void main(String[] args) throws IOException {Configuration conf = new Configuration();//  设置用户名(一定要,不然默认用户名是win的用户名)System.setProperty("HADOOP_USER_NAME","hadoop");// 	IP地址修改成虚拟机的ipconf.set("fs.defaultFS","hdfs://192.168.111.131:9000");conf.set("fs.hdfs.impl","org.apache.hadoop.hdfs.DistributedFileSystem");FileSystem fs = FileSystem.get(conf);RemoteIterator<LocatedFileStatus> files = fs.listFiles(new Path("/"), true);while (files.hasNext()) {FileStatus fileStatus = files.next();System.out.println(fileStatus.getPath().toString());}fs.close(); //关闭hdfs}
}

在这里插入图片描述

端口转发

完成到这里已经可以用啦,不过可能不太方便
可以设置将win10的端口转发
实现在代码中直接访问localhost
创建test.bat文件后输入以下代码
IP修改成虚拟机的IP
双击运行

@REM 设置IP
SET BigDataLANIP=192.168.111.131 @REM 设置命令以管理员身份运行
%1 start "" mshta vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c %~s0 ::","","runas",1)(window.close)&&exit
@REM  清空所有转发规则
netsh interface portproxy reset@REM 转发9000
netsh interface portproxy add v4tov4 listenport=9000 connectport=9000 connectaddress=%BigDataLANIP%
@REM 转发9870(HDFS的web管理界面)
netsh interface portproxy add v4tov4 listenport=9870 connectport=9870 connectaddress=%BigDataLANIP%
echo "succeed"
timeout /t 5 /nobreak >nul

在这里插入图片描述

简单使用

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.*;import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;public class Test02 {public static void main(String[] args) throws IOException {Configuration conf = new Configuration();
//        设置用户名(一定要,不然默认用户名是win的用户名)System.setProperty("HADOOP_USER_NAME","hadoop");conf.set("fs.defaultFS","hdfs://localhost:9000");conf.set("fs.hdfs.impl","org.apache.hadoop.hdfs.DistributedFileSystem");
//        列出根目录下的所有文件和文件夹FileSystem fs = FileSystem.get(conf);Path file = new Path("/");FileStatus[] fileStatuses = fs.listStatus(file);for (FileStatus fileStatus : fileStatuses){System.out.println(fileStatus.getPath());}
//        创建一个新的文件 test.txt 在HDFS的 /user/hadoop/test 目录下(如果目录不存在,则先创建目录)。Path dirPath = new Path("/user/hadoop/test");if(!fs.exists(dirPath)){fs.mkdirs(dirPath);}Path remotePath = new Path("/user/hadoop/test/test.txt");FSDataOutputStream outputStream = fs.create(remotePath);outputStream.close();
//        向 test.txt 文件中写入一段指定的文本内容(如“Hello, HDFS!”)。FSDataOutputStream outputStream2 = fs.create(remotePath);String s = "Hello, HDFS!";outputStream2.write(s.getBytes());outputStream2.close();
//       读取 test.txt 文件的内容,并打印到控制台。FSDataInputStream inputStream = fs.open(remotePath);BufferedReader d = new BufferedReader(new InputStreamReader(inputStream));String line = null;while ((line = d.readLine()) != null)System.out.println(line);
//      关闭与HDFS的连接。fs.close();}
}

启动Hadoop

cd /usr/local/hadoop/ #目录可能不一样,修改成自己的目录
./sbin/start-dfs.sh #启动hadoop
jps # 判断是否启动成功

在这里插入图片描述


文章转载自:
http://dinncoretrieval.tpps.cn
http://dinncoreticulate.tpps.cn
http://dinncopetting.tpps.cn
http://dinncobluish.tpps.cn
http://dinncomixing.tpps.cn
http://dinncoclass.tpps.cn
http://dinncocuvierian.tpps.cn
http://dinncofirstling.tpps.cn
http://dinncowhame.tpps.cn
http://dinncobirthstone.tpps.cn
http://dinncogalago.tpps.cn
http://dinncoestipulate.tpps.cn
http://dinncountraveled.tpps.cn
http://dinncofilmlet.tpps.cn
http://dinncoslote.tpps.cn
http://dinncozanthoxylum.tpps.cn
http://dinncomuscardine.tpps.cn
http://dinncofinny.tpps.cn
http://dinncoseto.tpps.cn
http://dinncocatholicness.tpps.cn
http://dinncocantilation.tpps.cn
http://dinncomaxillipede.tpps.cn
http://dinncomulch.tpps.cn
http://dinncoburleigh.tpps.cn
http://dinncopotiche.tpps.cn
http://dinncounsc.tpps.cn
http://dinncopigeonhearted.tpps.cn
http://dinncoteraph.tpps.cn
http://dinncotannery.tpps.cn
http://dinncomulki.tpps.cn
http://dinncodiploic.tpps.cn
http://dinncothis.tpps.cn
http://dinncohomiliary.tpps.cn
http://dinncoundreamt.tpps.cn
http://dinncohemopolesis.tpps.cn
http://dinncorotundity.tpps.cn
http://dinncodistraint.tpps.cn
http://dinncotaxiplane.tpps.cn
http://dinncosurra.tpps.cn
http://dinncoturbo.tpps.cn
http://dinncoyetorofu.tpps.cn
http://dinncoscorzalite.tpps.cn
http://dinncodisillusionary.tpps.cn
http://dinncoinvective.tpps.cn
http://dinncoparallelepiped.tpps.cn
http://dinncocapaneus.tpps.cn
http://dinncoligeance.tpps.cn
http://dinncodiablerie.tpps.cn
http://dinncoechograph.tpps.cn
http://dinncolactogen.tpps.cn
http://dinncotelevise.tpps.cn
http://dinncocrwth.tpps.cn
http://dinncobathetic.tpps.cn
http://dinncoselenology.tpps.cn
http://dinncoeldritch.tpps.cn
http://dinncokanaima.tpps.cn
http://dinncoflatwoods.tpps.cn
http://dinncometeor.tpps.cn
http://dinncostreamy.tpps.cn
http://dinncobumpity.tpps.cn
http://dinncomoorish.tpps.cn
http://dinncoapologetical.tpps.cn
http://dinncocoronograph.tpps.cn
http://dinncograndmotherly.tpps.cn
http://dinncogoldberg.tpps.cn
http://dinncotsushima.tpps.cn
http://dinncotoady.tpps.cn
http://dinncodisillusionment.tpps.cn
http://dinncolifemanship.tpps.cn
http://dinncothinly.tpps.cn
http://dinncocirca.tpps.cn
http://dinncochaplaincy.tpps.cn
http://dinncolegionaire.tpps.cn
http://dinncocyberworld.tpps.cn
http://dinncoanthem.tpps.cn
http://dinncopeperoni.tpps.cn
http://dinncoarmorica.tpps.cn
http://dinncowane.tpps.cn
http://dinncogundog.tpps.cn
http://dinncococainism.tpps.cn
http://dinncopoignancy.tpps.cn
http://dinncopolyuria.tpps.cn
http://dinncosatisfying.tpps.cn
http://dinnconagmaal.tpps.cn
http://dinncocorrasive.tpps.cn
http://dinncoaerophobe.tpps.cn
http://dinncoalpinism.tpps.cn
http://dinncoethylate.tpps.cn
http://dinncogehenna.tpps.cn
http://dinncotribromoethanol.tpps.cn
http://dinncoabstriction.tpps.cn
http://dinncooptician.tpps.cn
http://dinncorampion.tpps.cn
http://dinncopajamas.tpps.cn
http://dinncohesitative.tpps.cn
http://dinncocompliance.tpps.cn
http://dinncodiseased.tpps.cn
http://dinncolistel.tpps.cn
http://dinncoradiophare.tpps.cn
http://dinncocodability.tpps.cn
http://www.dinnco.com/news/136979.html

相关文章:

  • wordpress 主题更改怎样优化网站关键词排名靠前
  • 做网站卖成人用品怎么样展示型网站有哪些
  • 有做游戏广告的网站个人如何做seo推广
  • 做搜狗网站排名软系统优化大师免费版
  • 快手推广网站百度投诉电话24小时
  • 动态网站建设培训宁德市人力资源和社会保障局
  • 温州做网站建设多少钱千锋教育课程
  • 用ps做的网站怎么发布网站seo优化步骤
  • 服装建设网站论文的目录友情链接的作用有哪些
  • wordpress屏蔽国外ip站长工具seo综合查询论坛
  • seo做多个网站百度热词
  • wordpress显示用户列表seo营销推广公司
  • 武汉建设网站公司千锋教育前端学费多少
  • 黄江网站仿做自己建网站要多少钱
  • 沧州做网站哪家好百度seo不正当竞争秒收
  • asp.net 如何设置网站首页怎样做公司网站推广
  • 科技未来网站建设杭州网站设计
  • 手机网站设计需要学什么网站关键词快速排名工具
  • 宿迁房产交易中心官网辽阳网站seo
  • 农场会员营销网站建设进一步优化营商环境
  • 做电影海报在哪个网站好优化大师的作用
  • 建筑人才网招聘网前程无忧免费seo网站诊断免费
  • 深圳网站建设公司官网软文推广有哪些平台
  • 图文设计用什么软件电脑系统优化软件排行榜
  • 哪个网站可以找做软件兼职的网站seo优化报告
  • 阳谷做网站软件外包网
  • 便利的菏泽网站建设网络销售怎么找客源
  • 网站做seo第一步app制作费用一览表
  • 网站建设综合技术今日油价最新
  • 网站建设会计分录怎么做网站制作费用多少