背景 近期有人问我 yhz.me 这个博客是怎么弄的,这篇文章来简单阐述一下。
说明 博客一般来讲,流量会比较少,推荐使用Vercel的Hobby这个免费的版本,方便部署,而且自带https证书就可以,Vercel的网址是:https://vercel.com 这个。 博客网站使用静态网站生成器,可以将编辑好的Markdown文件生成好静态的HTML进行渲染。推荐使用Go语言的Hugo框架:https://gohugo.io 这个。 代码仓库用Github就好,创建个私有仓库用于提交相关的文件或代码就行。 步骤 1. 在Vercel上注册个账号 这里自行去网站上注册好就行了。
2. 在Github上创建个私有仓库 建议仓库命名为:GitHub账号名称.github.io
这里我重新创建了个 https://github.com/hwsdien/yhz.github.io 这个仓库。
3. Hugo 3.1. 安装 可以参考官网的文档:https://gohugo.io/getting-started/quick-start/
我这里是macOS系统,直接用brew install hugo 进行安装了。
3.2. 查看版本 执行 hugo version 即可获取版本号。 我这里的版本号是:
hugo v0.113.0+extended darwin/arm64 BuildDate=unknown
3.3. Clone仓库 git clone https://github.com/hwsdien/yhz.github.io.git
3.4. 创建网站 cd yhz.github.io
hugo new site . --force
3.5. 选择主题 可以在 https://themes.gohugo.io 这里挑选一个自己喜欢的主题,根据主题的说明文档进行安装。 这里我选了一个 hello-friend-ng 的主题。
git submodule add https://github.com/rhazdon/hugo-theme-hello-friend-ng.git themes/hello-friend-ng 执行上面这条命令就行。
3.6. 修改配置文件 vim hugo.
更新源 yum install https://centos6.iuscommunity.org/ius-release.rpm -y wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo yum makecache 安装 Python3.6 yum install python36u python36u-devel -y ln -s /usr/bin/python3.6 /bin/python3 安装 pip yum install python36u-pip -y ln -s /usr/bin/pip3.6 /bin/pip3 pip3 install --upgrade pip 安装 virtualenv pip3 install virtualenv 安装 Airflow 创建目录
mkdir -p /opt/airflow mkdir -p /opt/airflow/airflow cd /opt/airflow/ 激活环境
virtualenv -p `which python3.6` venv source venv/bin/activate 退出虚拟环境 deactivate 安装依赖包
pip3 install cryptography pip3 install flask-bcrypt pip3 install mysql-connector 安装
说明 只是记录Hadoop Balance速度太慢怎么处理的方法。 相关参数自行查阅网络。 查看 Hadoop 的配置项 hdfs getconf -confKey dfs.datanode.balance.bandwidthPerSec hdfs getconf -confKey dfs.datanode.max.transfer.threads hdfs getconf -confKey dfs.datanode.balance.max.concurrent.moves 设置配置项 hdfs dfsadmin -setBalancerBandwidth 104857600 指定配置执行 balance hdfs balancer \ -Ddfs.datanode.balance.max.concurrent.moves=50 \ -Ddfs.balancer.dispatcherThreads=1024 \ -Ddfs.balance.bandwidthPerSec=104857600 \ -threshold 5
说明 假设 table1 是 MySQL 里 demo 库里的表,其主键字段为 t_id, 需要导到 HBase 的 htable1 表。 指定表名导入 sqoop import \ -D sqoop.hbase.add.row.key=true \ --connect "jdbc:mysql://192.168.0.100:3306/demo?characterEncoding=utf-8" --username nate --password 123123 \ --table table1 \ --hbase-table htable1 \ --hbase-row-key t_id --split-by t_id -m 7 \ --column-family cf 指定查询语句导入 sqoop import \ -D sqoop.hbase.add.row.key=true \ --connect "jdbc:mysql://192.168.0.100:3306/demo?characterEncoding=utf-8" --username nate --password 123123 \ --query "select * from table1 where t_id > 0 and \$CONDITIONS" \ --hbase-table htable1 \ --hbase-row-key t_id --split-by t_id -m 7 \ --column-family cf split-by 字段为 text sqoop import \ -D sqoop.
说明 操作系统:Ubuntu 14.04.5 LTS Cassandra Version: 3.11.3 机器: 3台,192.168.0.100, 192.168.0.101, 192.168.0.102 更改主机名 sudo vim /etc/hostname sudo vim /etc/hosts 192.168.0.100 cassandra-1 192.168.0.101 cassandra-2 192.168.0.102 cassandra-3 reboot 安装 OpenJDK 8 sudo apt-get install software-properties-common -y sudo add-apt-repository ppa:openjdk-r/ppa sudo apt-get update -y sudo apt-get install openjdk-8-jdk -y sudo update-alternatives --config java sudo update-alternatives --config javac java -version 下载 Cassandra wget http://mirrors.tuna.tsinghua.edu.cn/apache/cassandra/3.11.3/apache-cassandra-3.11.3-bin.tar.gz sudo mkdir -p /opt sudo mkdir -p /data/cassandra/data sudo mkdir -p /data/cassandra/commitlog sudo mkdir -p /data/cassandra/saved_caches sudo mkdir -p /data/logs/cassandra sudo tar -xzvf .
Hive 表 Parquet & Orc 性能测试 说明 数据格式: 复杂的多层Json格式 数据记录数:60207297 数据大小:79.0G 数据压缩方式: Snappy 运行环境: 1.21 PB Disk 960 GB Memory 480 VCores Spark on Yarn executor-memory: 4g num-executors: 100 容量对比 Parquet Orc NONE 230.3G Uncompressed 236.1G SNAPPY 73.1G 73.0G Gzip 46.6G ZLIB 51.7G 写入时长 Parquet Orc NONE 22:34 Uncompressed 21:02 SNAPPY 19:10 19:43 Gzip 27:30 ZLIB 21:59 查询时长 count 查询(单位: 秒)
Parquet Orc NONE 21.995 Uncompressed 93.029 SNAPPY 44.186 15.558 Gzip 49.