linux命令

启动hadoop

myhadoop.sh start

 

 

查看安全模式

hadoop dfsadmin -safemode get

关闭

hadoop dfsadmin -safemode leave

 

启动metastore

nohup bin/hive --service metastore >> logs/metastore.log 2>&1 &

 

启动hive2

nohup bin/hive --service hiveserver2 >> logs/hiveserver2.log 2>&1 &

 

启动hive

bin/hive

show databases;

 

启动phoenix

/opt/module/phoenix/bin/sqlline.py hadoop102,hadoop103,hadoop104:2181

!tables

 

启动hbase

hbase shell

list

 

查看进程

ps -ef|grep 4107

 

查看端口

netstat -anp|grep 1000

 

杀死进程

kill -9 1023

 

集群分发

xsync ***
source ***

 

安装

2解压

[atguigu@hadoop102 software]$ tar -zxvf /opt/software/apache-hive-3.1.2-bin.tar.gz -C /opt/module/

3修改名称

[atguigu@hadoop102 software]$ mv /opt/module/apache-hive-3.1.2-bin/ /opt/module/hive

4添加环境变量

[atguigu@hadoop102 software]$ sudo vim /etc/profile.d/my_env.sh

添加内容

#HIVE_HOME

export HIVE_HOME=/opt/module/hive

export PATH=$PATH:$HIVE_HOME/bin

使环境变量生效

[atguigu@hadoop102 software]$ source /etc/profile.d/my_env.sh

 

创建hive表

CREATE  TABLE IF NOT EXISTS target_sales_sample (
  day_id STRING,
  sale_nbr STRING,
  buy_nbr STRING,
  cnt INT,
  round INT
)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
STORED AS TEXTFILE;

-- -- 将数据上传到HDFS
-- -- hadoop fs -put employees.csv /

-- -- 导入数据到Hive表
LOAD DATA INPATH '/xiyou/sales_sample_20170310.csv' INTO TABLE target_sales_sample;
--
-- -- 验证数据导入
SELECT * FROM  target_sales_sample ;

 

将hive中employees表数据导入到mysql

bin/sqoop export \
--connect jdbc:mysql://Hadoop102:3306/bigdata \
--username root \
--password 123456 \
--table jichang \
--num-mappers 1 \
--export-dir /user/hive/warehouse/jichang \
--input-fields-terminated-by ","

 

启动kafka

kf.sh start

 

启动zookeeper

zk.sh start

bin/zkServer.sh start

 

启动hbase

start-hbase

bin/start-hbase.sh

 

启动spark

./bin/spark-shell

 

启动MySQL

[anta@hadoop102 software]$ mysql -uroot -p'123456'

 

启动MongoDB

D:\MongoDB\Server\5.0>mongod --dbpath D:\MongoDB\Server\5.0\data\db
打开一个浏览器,输入网址“http://localhost:27017/ ”,如果网页上出现如下一行信息,就说明启动成功了:
新建一个cmd窗口,在里面执行如下命令进入MongoDB Shell

mongosh

 

启动redis

./redis-server /opt/module/redis/bin/redis.conf

/opt/module/redis/bin/redis-cli

 

Vim 编辑器中查找单词

按下 / 键后,在底部命令行输入要查找的单词,然后按下 Enter 键。

 

posted @ 2023-09-22 10:42  旺旺大菠萝  阅读(3)  评论(0编辑  收藏  举报