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:

Continue reading “CDH 4 HA Related Problems” »

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

Create Windows 7/8 Bootable USB Drive on OS X

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.

Continue reading “Create Windows 7/8 Bootable USB Drive on OS X” »

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/

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

需求

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

准备工作

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

Continue reading “从GeoIP免费库里生成IP到省市编号的组合” »

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

Incoming search terms:

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:
Continue reading “Prestodb Command Line Client Output Formats” »

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

MySQL/Hive/Presto/Impala Transposition

Rows to Columns

Rows to Comma Separated String

MySQL

Use GROUP_CONCAT(). This function also works in Infobright.
Continue reading “MySQL/Hive/Presto/Impala Transposition” »

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

Incoming search terms: