'2017/04'에 해당되는 글 2건

  1. 2017.04.08 HAWQ 2.1.1.0 에서 pljava 활성화
  2. 2017.04.08 CentOS 6.7 에서 Redis cluster 구축
반응형

hawq 가 설치 된 모든 노드에서 JAVA_HOME 을 지정한 후 아래 명령어를 실행한다



그리고 hawq master 에서 아래 명령어를 실행한다



pg_language table 을 조회해보면 java 와 javau 가 추가된 것을 확인할 수 있다


gpadmin=# select oid, * from pg_language;

  oid  | lanname  | lanispl | lanpltrusted | lanplcallfoid | lanvalidator | lanacl 

-------+----------+---------+--------------+---------------+--------------+--------

    12 | internal | f       | f            |             0 |         2246 | 

    13 | c        | f       | f            |             0 |         2247 | 

    14 | sql      | f       | t            |             0 |         2248 | 

 10885 | plpgsql  | t       | t            |         10883 |        10884 | 

 16542 | java     | t       | t            |         16540 |            0 | 

 16543 | javau    | t       | f            |         16541 |            0 | 

(6 rows)


제대로 java 가 실행되는 지 확인해보기 위해서 아래를 실행해봤다


gpadmin=# create function get_property(varchar) returns varchar as 'java.lang.System.getProperty' language java;

CREATE FUNCTION

gpadmin=# select get_property('user.name')

gpadmin-# ;

 get_property 

--------------

 gpadmin

(1 row)


gpadmin=# select get_property('user.home');

 get_property  

---------------

 /home/gpadmin

(1 row)



반응형

'[BigData] > [HDP]' 카테고리의 다른 글

HDP 2.4.2 install with Ambari 2.2.2.0  (0) 2016.06.18
Posted by FeliZ_하늘..
,
반응형

hdp 의 hdb(hawq) 에서 redis 를 사용해 볼 목적으로 redis 를 설치했다


hdp 는 6개의 노드로 구성했고 namenode HA, resourcemanager HA 가 설정돼있고 datanode 는 3개이다


hawq 도 master, standby master, segment 3개로 구성했다


목표는 6개의 노드 전체에 redis 를 설치한 후 cluster 로 묶는 것이다.


아래 문서들을 참조하였다


https://redis.io/topics/cluster-tutorial

http://the-earth.tistory.com/entry/redis-cluster-%EA%B5%AC%EC%84%B1%ED%95%98%EA%B8%B0

https://www.facebook.com/notes/yongbok-kim/redis-cluster-%EA%B0%84%EB%8B%A8-%EC%84%A4%EC%A0%95/704524782949857/

http://www.redisgate.com/redis/cluster/cluster.php


아래 명령어를 실행하여 컴파일 했다



그리고나서 src 아래의 모든 파일을 내가 사용 할 redis directory 에 복사했다


나는 /usr/local/redis/redis-3.2.8 디렉토리를 만들어 여기에 복사한 뒤


/usr/local/redis/default 라는 링크를 만들어 위에서 만든 디렉토리에 링크를 걸어줬다


그리고 내가 수정 한 redis.conf 는 아래 5개이다 (port 는 default 값 6379 를 그대로 사용했다)


그리고 다운받고 압축을 풀었던 디렉토리에 존재하는 redis.conf 를 /usr/local/redis/default 아래에 복사했다

bind 0.0.0.0
appendonly yes
cluster-enabled yes
cluster-config-file nodes.conf
cluster-node-timeout 5000

그리고나서 아래 명령어를 실행하여 cluster 를 생성한다. (꼭 IP 로 적어야 정상실행 된다)

./redis-trib.rb create \
172.16.196.150:6379 \
172.16.196.151:6379 \
172.16.196.152:6379 \
172.16.196.153:6379 \
172.16.196.154:6379 \
172.16.196.155:6379

redis-trib.rb 를 실행할 때 각종 오류가 났다


1. rubygems 가 설치 돼있지 않음

-> yum install rubygems 를 실행했다


2. ruby 에서 redis 를 설치하지 않음

/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- redis (LoadError)

from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'

from ./redis-trib.rb:25

-> gem install redis 를 실행했다


3. redis-server 를 실행하지 않음

-> /usr/local/redis/default/redis-server /usr/local/redis/default/redis.conf 를 실행함


4. redis cluster cannot connect to node 오류가 발생함

-> redis.conf 에서 bind 값을 127.0.0.1 에서 0.0.0.0 으로 수정


5. redis cluster is already busy (Redis::CommandError) 오류가 발생함

-> cluster 로 묶으려는 전 노드에서 아래 명령어를 실행했다

flushall
cluster reset soft

그리고나서 redis-trib.rb 를 재실행한다


[root@admin default]# ./redis-trib.rb create 172.16.196.150:6379 172.16.196.151:6379 172.16.196.152:6379 172.16.196.153:6379 172.16.196.154:6379 172.16.196.155:6379

>>> Creating cluster

>>> Performing hash slots allocation on 6 nodes...

Using 6 masters:

172.16.196.155:6379

172.16.196.154:6379

172.16.196.153:6379

172.16.196.152:6379

172.16.196.151:6379

172.16.196.150:6379

M: b267c9964edae16d5b3c40e49f83c72585cac439 172.16.196.150:6379

   slots:13653-16383 (2731 slots) master

M: 000ac0c60361218076084d513306f15ea0460ab1 172.16.196.151:6379

   slots:10923-13652 (2730 slots) master

M: 16a628108b8ca9ecdcb353c1472a3e36d3269699 172.16.196.152:6379

   slots:8192-10922 (2731 slots) master

M: 99bd9cdd76efaa9a438844339114e654c3e92e6b 172.16.196.153:6379

   slots:5461-8191 (2731 slots) master

M: 4757a336d40f0203032acef88b3b440ea9f94152 172.16.196.154:6379

   slots:2731-5460 (2730 slots) master

M: 7d879254412e8636d106ea64161e95b8b8f09f13 172.16.196.155:6379

   slots:0-2730 (2731 slots) master

Can I set the above configuration? (type 'yes' to accept): yes

>>> Nodes configuration updated

>>> Assign a different config epoch to each node

>>> Sending CLUSTER MEET messages to join the cluster

Waiting for the cluster to join...

>>> Performing Cluster Check (using node 172.16.196.150:6379)

M: b267c9964edae16d5b3c40e49f83c72585cac439 172.16.196.150:6379

   slots:13653-16383 (2731 slots) master

   0 additional replica(s)

M: 000ac0c60361218076084d513306f15ea0460ab1 172.16.196.151:6379

   slots:10923-13652 (2730 slots) master

   0 additional replica(s)

M: 16a628108b8ca9ecdcb353c1472a3e36d3269699 172.16.196.152:6379

   slots:8192-10922 (2731 slots) master

   0 additional replica(s)

M: 4757a336d40f0203032acef88b3b440ea9f94152 172.16.196.154:6379

   slots:2731-5460 (2730 slots) master

   0 additional replica(s)

M: 99bd9cdd76efaa9a438844339114e654c3e92e6b 172.16.196.153:6379

   slots:5461-8191 (2731 slots) master

   0 additional replica(s)

M: 7d879254412e8636d106ea64161e95b8b8f09f13 172.16.196.155:6379

   slots:0-2730 (2731 slots) master

   0 additional replica(s)

[OK] All nodes agree about slots configuration.

>>> Check for open slots...

>>> Check slots coverage...

[OK] All 16384 slots covered.

[root@admin default]# ./redis-cli cluster nodes

b267c9964edae16d5b3c40e49f83c72585cac439 172.16.196.150:6379 myself,master - 0 0 1 connected 13653-16383

000ac0c60361218076084d513306f15ea0460ab1 172.16.196.151:6379 master - 0 1491643229950 6 connected 10923-13652

16a628108b8ca9ecdcb353c1472a3e36d3269699 172.16.196.152:6379 master - 0 1491643228945 2 connected 8192-10922

4757a336d40f0203032acef88b3b440ea9f94152 172.16.196.154:6379 master - 0 1491643228443 4 connected 2731-5460

99bd9cdd76efaa9a438844339114e654c3e92e6b 172.16.196.153:6379 master - 0 1491643229950 3 connected 5461-8191

7d879254412e8636d106ea64161e95b8b8f09f13 172.16.196.155:6379 master - 0 1491643228945 5 connected 0-2730

[root@admin default]# 

반응형
Posted by FeliZ_하늘..
,