Sign inSign up

thunderboltlei/centos-bdcluster-db

By thunderboltlei

•Updated about 4 years ago

Image
0

59

thunderboltlei/centos-bdcluster-db repository overview

⁠一、basic

1、centos 8.4 + java 1.8 + anaconda 4.12.0(2021.05)

$ mkdir -p /opt/developments/
$ cd /opt/developments/anaconda
$ wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-2021.05-Linux-x86_64.sh
$ chmod +x Anaconda3-2021.05-Linux-x86_64.sh
$ ./Anaconda3-2021.05-Linux-x86_64.sh
>>> yes
>>>  /opt/developments/anaconda
>>> yes

2、容器运行及端口映射

$ docker run --hostname bdnode001 --privileged -d -p <端口映射 1> ... -p <端口映射 n>  --restart="always" <用户名>/<repository name>:<tag name> /usr/sbin/init

例:docker run --name centos-bdcluster-db --hostname bdnode001 --privileged -d -p 3306:3306 -p 6379:6379 -p 50070:50070 -p 9000:9000 -p 8088:8088 -p 8040:8040 -p 8042:8042  -p 49707:49707  -p 50010:50010  -p 50075:50075  -p 50090:50090 -p 16010:16010 -p 9083:9083 -p 10000:10000 -p 9092:9092 -p 7077:7077 -p 18080:18080 -p 18081:18081 -p 18282:18282 -p 8008:8008 -p 4040:4040 --restart="always" thunderboltlei/centos-bdcluster-db:202210311540 /usr/sbin/init

$ docker exec -it <container id> /bin/bash

3、启动服务

启动所有服务
$ ./bigdatas-hostname.sh start

停止所有服务
$ ./bigdatas-hostname.sh stop

服务列表
$ ./bigdatas-hostname.sh info

4、重要两点在启动服务后,需要执行:
(1)beeline 登录 hive,要赋予 root 管理权限。
beeline > set role admin;
(2)登录 mysql,修改 hive 数据库的字符集。否则,presto 连接前预执行的sql为出错。详细信息见笔记。
mysql > alter database hive character set latin1;

⁠二、relation db & cache db

mysql 8.0.26 + redis 2.6.0

启动 mysql
$ nohup mysqld --user=root &

###(1)mysql

  • 用户:anonymous / anonymous,root / root

###(2)redis config

  • 注释掉:bind 127.0.0.1
  • 修改:protected-mode yes 为 protected-mode no
  • 设置密码:requirepass xxxxxxxxx

⁠三、bg cluster

###################################################################
# 自上而下,通过源码中 pom.xml 来确认版本
#               zookeeper
#               |------------|
#          hive       hbase         hudi
#      |------------|------------|------------|     
#  hadoop     spark       flink        kafka      trino      ElasticSearch
###################################################################

本地测试:将 <宿主机 IP> 换成 localhost 远程访问:使用 <宿主机 IP>

├── bigdatas.md
├── bigdatas-hostname.sh
├── flink
│   └── flink-1.14.4

web - http://<宿主机 IP>:18282

├── hadoop
│   └── hadoop-3.1.2

最新版本 3.3.2 仅支持 JDK1.8
web: http://<宿主机 IP>:8088/cluster

├── hbase
│   └── hbase-2.4.11

web: http://<宿主机 IP>:16010

├── hive
│   └── hive-3.1.2

$ beeline
beeline > !connect jdbc:hive2://<node hostname>:10000/default root root;
beeline > set role admin;
metastore - thrift://<宿主机 IP>:9083
$ beeline
beeline > !connect jdbc:hive2://<宿主机 IP>:10000/<schema> <user> <password>
beeline > set role admin;

├── kafka
│   └── kafka_2.12-3.1.0

port: 9092
$ nohup ./bin/kafka-server-start.sh config/server.properties
$ ./bin/kafka-console-producer.sh --bootstrap-server <宿主机 IP>:9092 --topic demo
$ ./bin/kafka-console-consumer.sh --bootstrap-server <宿主机 IP>:9092 --from-beginning --topic demo

├── presto │   └── presto-server-315

web port: 8008
$ presto-cli-315 --server <docker_hostname>:8008 --catalog hive --schema default

├── spark
│   └── spark-3.1.3-bin-hadoop3.2

spark://<宿主机 IP>:7077        # 分布式为 master 主机 IP
master web uri -  http://<宿主机 IP>:18080
work web uri - http://<宿主机 IP>:18081

└── zookeeper
└── zookeeper-3.8.0

port: 2181

Tag summary

Content type

Image

Digest

sha256:95e9b94f2…

Size

5.7 GB

Last updated

about 4 years ago

docker pull thunderboltlei/centos-bdcluster-db:202210311540