编程常用命令

1.redis

(1)启动:
1
2
3
cd /usr/local/redis

./bin/redis-server ./redis.conf
(2)查看
1
ps -ef | grep redis
(3)启动客户端:
1
2
3
4
5
cd /usr/local/redis

./bin/redis-cli

./bin/redis-cli -h 192.168.31.141
(4)插入数据:
1
lpush uid:1 1129:2.0 1172:4.0 1263:2.0 1287:2.0 1293:2.0 1339:3.5 1343:2.0 1371:2.5
(5)查询数据:
1
lrange uid:1 0 20

2.Mongodb

(1)启动
1
2
3
cd /usr/local/mongodb

./bin/mongod -config ./data/mongodb.conf
(2)关闭:
1
2
3
cd /usr/local/mongodb

./bin/mongod -shutdown -config ./data/mongodb.conf

3.kafka

(1)启动
1
bin/kafka-server-start.sh config/server.properties &
(2)关闭
1
bin/kafka-server-stop.sh stop
(3)生产消息
1
2
3
bin/kafka-console-producer.sh --broker-list bigdata11:9092 --topic first

>hello world
(4)消费消息
1
2
3
bin/kafka-console-consumer.sh --zookeeper bigdata11:2181 --from-beginning --topic first

bin/kafka-console-consumer.sh --bootstrap-server 192.168.31.141:9092 --topic first
(5)查看所有topic
1
bin/kafka-topics.sh --zookeeper bigdata13:2181 --list

4.HBase

(1)启动方式一
1
2
3
bin/hbase-daemon.sh start master

bin/hbase-daemon.sh start regionserver
(2)启动方式二
1
bin/start-hbase.sh
(3)停止服务
1
bin/stop-hbase.sh

5.Spark

(1)启动
1
sbin/start-all.sh
(2)停止
1
sbin/stop-all.sh

6.ZooKeeper

(1)分别启动
1
bin/zkServer.sh start
(2)分别停止
1
bin/zkServer.sh stop

7.Hive

(1)启动
1
bin/hive
(2)退出hive
1
2
3
quit;

exit;
(3).“-e”不进入hive的交互窗口执行sql语句
1
bin/hive -e "select id from student;"
(4).“-f”执行脚本中sql语句,执行文件中的sql语句
1
bin/hive -f /opt/module/datas/hive.sql
(5).在hive cli命令窗口中如何查看hdfs文件系统
1
dfs -ls /;
(6).在hive cli命令窗口中如何查看linux本地系统
1
! ls /opt/module/datas;
打赏
  • 版权声明: 本博客所有文章除特别声明外,著作权归作者所有。转载请注明出处!
  • Copyrights © 2015-2021 Movle
  • 访问人数: | 浏览次数:

请我喝杯咖啡吧~

支付宝
微信