码迷,mamicode.com
首页 > 其他好文 > 详细

vertical-greenplum

时间:2019-10-18 19:11:43      阅读:86      评论:0      收藏:0      [点我收藏+]

标签:nal   Fix   dev   虚拟   idt   pytho   sbin   persist   安装   

https://github.com/sumitchawla/docker-vertica
You can either pull the image from Docker Registry using following command:

docker pull sumitchawla/vertica
Or, build your own image using following command. Download the Vertica DEB package from https://my.vertica.com and put it in this folder as "vertica9.deb". Then run:

docker build -t sumitchawla/vertica .
To run without a persistent datastore
docker run -p 5433:5433 sumitchawla/vertica
To run with a persistent datastore
docker run -p 5433:5433 -d -v /path/to/vertica_data:/home/dbadmin/docker sumitchawla/vertica
Connection Parameters

Default DB Name - docker

Default User - dbadmin

Default Password (NO PASSWORD) -

./vsql -d docker -U dbadmin

./vsql --help
This is vsql, the Vertica Analytic Database interactive terminal.

Usage:
vsql [OPTIONS]... [DBNAME [USERNAME]]

General options:
-d DBNAME specify database name to connect to (default: "root")
-c COMMAND run only single command (SQL or internal) and exit
-f FILENAME execute commands from file, then exit
-l list available databases, then exit
-v NAME=VALUE set vsql variable NAME to VALUE
-X do not read startup file (~/.vsqlrc)
--help show this help, then exit
--version output version information, then exit

Input and output options:
-a echo all input from script
-e echo commands sent to server
-E display queries that internal commands generate
-q run quietly (no messages, only query output)
-o FILENAME send query results to file (or |pipe)
-n disable enhanced command line editing (readline)
-s single-step mode (confirm each query)
-S single-line mode (end of line terminates SQL command)

Output format options:
-A unaligned table output mode (-P format=unaligned)
-b beep on command completion
-H HTML table output mode (-P format=html)
-t print rows only (-P tuples_only)
-T TEXT set HTML table tag attributes (width, border) (-P tableattr=)
-x turn on expanded table output (-P expanded)
-P VAR[=ARG] set printing option VAR to ARG (see \pset command)
-F STRING set field separator for unaligned output (default: "|") (-P fieldsep=)
-R STRING set record separator (default: newline) (-P recordsep=)

Connection options:
-4 prefer IPv4 addresses when resolving hostnames
-6 prefer IPv6 addresses when resolving hostnames
-B SERVER:PORT set connection backup server/port (default: not set)
-C enable connection load balancing (default: not enabled)
-h HOSTNAME database server host or socket directory (default: "local socket")
-k KRB SERVICE kerberos service name (default: "vertica")
-K KRB HOST kerberos host name
-m SSLMODE SSL mode (require, prefer, allow or disable; default: prefer)
-p PORT database server port (default: "5433")
-U NAME database user name (default: "root")
-W prompt for password (should happen automatically)
-w PASSWORD database user‘s password

For more information, type "?" (for vsql commands)
from within vsql, or consult the vsql section in
the Vertica Analytic Database documentation.

vertca 镜像

https://github.com/bluelabsio/docker-vertica 需要下载rpm
下载vertica 客户端
https://www.vertica.com/download/vertica/
https://softwaresupport.softwaregrp.com/ 下载页面

greenplum
https://github.com/greenplum-db/gpdb/releases
https://hub.docker.com/r/kevinmtrowbridge/greenplumdb_singlenode
https://github.com/kevinmtrowbridge/greenplumdb_singlenode_docker
https://github.com/kevinmtrowbridge/greenplumdb_singlenode_docker/blob/master/Dockerfile

单机版安装
https://www.jianshu.com/p/513935550350

greenplum 源码安装
https://yq.aliyun.com/articles/609855#

单机安装(容器安装的重要节点时刻)
系统:centos7 greenplum版本:greenplum-db-6.0.0-rhel7-x86_64.rpm

使用root用户操作:
一,前期准备
关闭防火墙
systemctl disable firewalld.service
systemctl enable firewalld.service
关闭selinux
sed -i ‘/SELINUX/s/enforcing/disabled/‘ /etc/selinux/config

配置网络与内存参数

vim /etc/sysctl.conf
加入以下内容
net.ipv4.ip_forward = 0
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 1
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.sem = 250 64000 100 512
kernel.shmmax = 500000000
kernel.shmmni = 4096
kernel.shmall = 4000000000
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_max_syn_backlog = 4096
net.core.netdev_max_backlog = 10000
vm.overcommit_memory = 2
net.ipv4.conf.all.arp_filter = 1


vim  /etc/security/limits.conf

* soft nofile 65536
* hard nofile 65536
* soft nproc 131072
* hard nproc 131072

参数生效
sysctl -p

确定sshd 启动正常 ss -tanl 看端口

二,安装greenplum

安装依赖包(可能还有,使用yum -y localinstall xxxx.rpm 自动解决依赖问题)
yum install -y net-tools which openssh-clients openssh-server less zip unzip iproute rsync openssl openssh perl bzip2 apr apr-util ed libevent-devel libyaml

rpm -ivh greenplum-db-6.0.0-rhel7-x86_64.rpm 缺少依赖装之

默认安装在 /usr/local/greenplum-db/

三,配置单机模式
使用root 操作
1,配置hosts解析
vim /etc/hosts

10.1.5.10 mdw sdw
注:10.1.5.10是虚拟机的ip地址,使用127.0.0.1 不成功

2,创建用户
groupadd gpadmin
useradd -g gpadmin gpadmin
passwd gpadmin 设置简单的密码

3,改变greenplum安装目录的用户和用户组
chown -R gpadmin.gpadmin /usr/local/greenplum-db/

4,切换到gpadmin账户下,在家目录下建立master和segment的数据存放目录。你也可以自行设定数据存放目录,如果你不是以gpadmin建立的目录,还需要修改目录的用户和用户组,最好是建在家目录下

su - gpadmin
mkdir -p /home/gpadmin/masterdata
mkdir -p /home/gpadmin/segmentdata
mkdir -p /home/gpadmin/segmentmirror

以下是su - gpadmin 后的操作
5,创建包含所有主机的文件all_hosts
vim /home/gpadmin/all_hosts
mdw
sdw

6,建包含segment主机名的文件
vim /home/gpadmin/seg_hosts
sdw

7,更改主机的名称
这里使用root 修改(以下都执行)
hostnamectl set-hostname "mdw"
hostname mdw
vim /etc/sysconfig/network
mdw

退出服务器重新登录

8,将MASTER_DATA_DIRECTORY加入Master主机环境中,修改gpadmin用户的.bashrc
这里使用gpadmin 用户登录后操作

cd /home/gpadmin
vim .bashrc
export MASTER_DATA_DIRECTORY=/home/gpadmin/masterdata/gpseg-1 #(配置的masterdata路径)
source /usr/local/greenplum-db/greenplum_path.sh #安装的greenplum路径

忘记在哪里可以搜索

9,时间同步
因为master和segment是在同一台机器,所以不需要做时间同步,如果不在同一台机器,需要做时间同步

10,python模块转移,防止提示失败
\cp -R -f /usr/lib64/python2.7/site-packages/. /data/program/gpsql/lib/python/

11,centos 7执行(原因未知)
echo "RemoveIPC=no" >> /etc/systemd/logind.conf
systemctl restart systemd-logind.service

12,编辑gp初始化配置文件,
vim /home/gpadmin/gpinitsystem_config
添加以下内容
ARRAY_NAME="EMC Greenplum DW"
SEG_PREFIX=gpseg
PORT_BASE=33000
declare -a DATA_DIRECTORY=(/home/gpadmin/segmentdata)
MASTER_HOSTNAME=mdw
MASTER_DIRECTORY=/home/gpadmin/masterdata
MASTER_PORT=5432
MACHINE_LIST_FILE=/home/gpadmin/seg_hosts
TRUSTED_SHELL=ssh
CHECK_POINT_SEGMENTS=8
ENCODING=UNICODE
MIRROR_PORT_BASE=43000
REPLICATION_PORT_BASE=34000
MIRROR_REPLICATION_PORT_BASE=44000
declare -a MIRROR_DATA_DIRECTORY=(/home/gpadmin/segmentmirror)

有多个segment,declare就多加几个路径 参考其他资料

13,建立信任关系,主要为了免密码登录的麻烦,若果提示命令不存在,先source一下.bashrc

gpssh-exkeys -f /home/gpadmin/all_hosts

如果tab 键无法搞出该命令,可能环境变量未生效

14,初始化数据库

gpinitsystem -c /home/gpadmin/gpinitsystem_config

15,等待log出现,中间需要按y

完成后可以gpstop
再执行 gpstart 报成功后完成

集群模式(未做)
:参考他的做吧
https://www.cnblogs.com/scoter2008/p/5928972.html

如果在容器内操作,需要注意的是容器内无sshd服务,所以安装完openssh-server后使用/usr/sbin/sshd 后启动sshd服务,
使用ss -tanl 查看端口信息

vertical-greenplum

标签:nal   Fix   dev   虚拟   idt   pytho   sbin   persist   安装   

原文地址:https://www.cnblogs.com/g2thend/p/11699925.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!