Categories
CDH Hadoop相关 HDFS 学习研究 笔记

CDH 4 HA Related Problems

By @sskaje
Link: https://sskaje.me/2014/02/cdh-4-ha-related-problems/

Problem

I meet ‘Failed to initialize High Availability state in ZooKeeper. This might be because a ZNode for this nameservice is already created. Either remove the ZNode, or to reuse the ZNode skip this step and simply start the NameNodes and Failover Controllers. To retry, use the “Initialize High Availability state in ZooKeeper” command available as a Failover Controller action.‘ When I was trying to enable automatic failover for HDFS in Cloudera Manager after HA being enabled.

Error logs:

CDH 4 HA Related Problems by @sskaje: https://sskaje.me/2014/02/cdh-4-ha-related-problems/
Categories
OS X 笔记

Create Windows 7/8 Bootable USB Drive on OS X

By @sskaje
Link: https://sskaje.me/2014/02/create-windows-7-8-bootable-usb-drive-on-osx/

This note works for Windows (e.g. Windows 7, Windows 8, …), Linux … ISO image only, and all commands in Terminal.

If you’re interested in using Disk Utility, try this: Create OS X Mavericks Bootable USB Drive from AppStore Release, but DON’T forget to unmount partitions.

To launch a Terminal, simply open Spotlight and type Terminal, in most cases, you can see Terminal listed after ‘Ter‘.

For Windows 7/8 or later, Boot Camp Assistant is the BEST tool.
In ‘Select Tasks‘, CHECK ‘Create a Windows 7 or later version disk’ and UNCHECK all others.
In ‘Create Bootable USB Drive for Windows Installation‘, choose the right usb destination disk.

Create Windows 7/8 Bootable USB Drive on OS X by @sskaje: https://sskaje.me/2014/02/create-windows-7-8-bootable-usb-drive-on-osx/
Categories
杂七杂八

从GeoIP免费库里生成IP到省市编号的组合

By @sskaje
Link: https://sskaje.me/2014/02/geoip-china-province-city-code-database/

需求

生成一份从大陆地区的IP到省市编号的映射列表,用于数据分析。

准备工作

统计局提供的标准行政区划代码 http://www.stats.gov.cn/tjsj/tjbz/xzqhdm/,身份证前6位的编号。
从 http://dev.maxmind.com/geoip/geoip2/geolite2/ 下载CSV格式的城市数据库
新浪首页提供一个IP查询接口,可以输出TSV,JSONP,JSON的IP信息

从GeoIP免费库里生成IP到省市编号的组合 by @sskaje: https://sskaje.me/2014/02/geoip-china-province-city-code-database/

Incoming search terms:

Categories
Hadoop相关 PrestoDB 学习研究 笔记

Prestodb Command Line Client Output Formats

By @sskaje
Link: https://sskaje.me/2014/02/prestodb-command-line-client-output-formats/

Output format is not listed in cli client help.

In presto-cli/src/main/java/com/facebook/presto/cli/ClientOptions.java:

Output like:

Prestodb Command Line Client Output Formats by @sskaje: https://sskaje.me/2014/02/prestodb-command-line-client-output-formats/

Incoming search terms:

Categories
Hadoop相关 Hive Impala PrestoDB 学习研究

MySQL/Hive/Presto/Impala Transposition

By @sskaje
Link: https://sskaje.me/2014/02/mysql-hive-presto-impala-transposition/

Rows to Columns

Rows to Comma Separated String

MySQL

Use GROUP_CONCAT(). This function also works in Infobright.

MySQL/Hive/Presto/Impala Transposition by @sskaje: https://sskaje.me/2014/02/mysql-hive-presto-impala-transposition/

Incoming search terms: