GreenPlum 4.3集群安装(二)

本文提供了一份详细的GreenPlum4.3在SUSE系统上的集群安装手册,包括数据存储区域的建立、系统时钟的同步、系统检查、字符集配置以及数据库的初始化等关键步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

GreenPlum 4.3 SUSE集群安装手册

1.0 建立数据存储区域

以下操作在moster主机上操作。(数据库的创建目录为/opt/greenplum

操作步骤

                                步骤 1     master主机上以root用户登录数据库服务器。

                                步骤 1     执行如下命令:

linux-82:/opt # mkdir -p greenplum/master

                                步骤 2     修改创建文件夹的权限,如下:

linux-82:/opt # chown -R gpadmin:gpadmin greenplum

                                步骤 3     运用gpsshsegment主机上创建文件夹及修改文件夹的权限,如下:

# source /usr/local/greenplum-db/greenplum_path.sh

# gpssh -h linux113 -e 'mkdir -p /opt/greenplum/master'

执行后的信息如下:

[linux113] mkdir -p /opt/greenplum/master

# gpssh -h linux113 -e 'chown -R gpadmin:gpadmin /opt/greenplum'

执行后的信息如下:

[linux113] chown -R gpadmin:gpadmin /opt/greenplum

                                步骤 4     配置segment主机的数据目录信息,先在master主机上建立配置文件hostfile_gpssh_segonly,如下:

linux-82:/usr/local # vi hostfile_gpssh_segonly

然后执行如下命令:

# source /usr/local/greenplum-db/greenplum_path.sh

linux-82:/usr/local # gpssh -f hostfile_gpssh_segonly -e 'mkdir -p /opt/greenplum/primary'

执行后的信息如下:

 [linux113] mkdir -p /opt/greenplum/primary

linux-82:/usr/local # gpssh -f hostfile_gpssh_segonly -e 'mkdir -p /opt/greenplum/mirror'

执行后的信息如下:

 [linux113] mkdir -p /opt/greenplum/mirror

linux-82:/usr/local # gpssh -f hostfile_gpssh_segonly -e 'chown -R gpadmin:gpadmin /opt/greenplum/primary'

执行后的信息如下:

 [linux113] chown -R gpadmin:gpadmin /opt/greenplum/primary

linux-82:/usr/local # gpssh -f hostfile_gpssh_segonly -e 'chown -R gpadmin:gpadmin /opt/greenplum/mirror'

执行后的信息如下:

 [linux113] chown -R gpadmin:gpadmin /opt/greenplum/mirro

 

2.0 同步系统时钟

操作步骤

                                步骤 1     master主机上以root用户登录数据库服务器;

                                步骤 2     执行如下命令来修改masterntpserver配置:

# vi /etc/ntp.conf 修改

server masterip 如:server 10.41.28.82

                                步骤 3     再在每台segment主机上以root用户登录执行下面的操作:

# vi /etc/ntp.conf 修改

server masterip prefer 如:server 10.41.28.82 prefer

server standby masterip

                                步骤 4     master主机上以root用户新建配置文件hostfile_gpssh_allhosts如下:

# cd /usr/local/greenplum-db

# vi hostfile_gpssh_allhosts 添加

Linux-82

Linux113

                                步骤 5     master主机上执行gpssh命令,如下:

# source /usr/local/greenplum-db/greenplum_path.sh

# gpssh -f hostfile_gpssh_allhosts -v -e 'ntpd'

执行后的信息如下:

[Reset ...]

[INFO] login linux-82

[INFO] login linux113

[linux-82] ntpd

[linux113] ntpd

[INFO] completed successfully

 

[Cleanup...]

注:需要等几分钟,时钟才会自动同步。

 

3.0 系统检查

操作步骤

                                步骤 1     master主机上以root用户登录数据库服务器;

                                步骤 2     conf文件夹下新建配置文件hostfile_gpcheck如下:

# cd /usr/local/greenplum-db/conf

# vi hostfile_gpcheck 添加

Linux-82

Linux113

                                步骤 3     master主机上执行gpcheck命令,如下:

# source /usr/local/greenplum-db/greenplum_path.sh

# gpcheck -f hostfile_gpcheck -m linux-82 -s linux113

执行后的信息如下:

20140415:11:15:47:013028 gpcheck:linux-82:root-[INFO]:-dedupe hostnames

20140415:11:15:47:013028 gpcheck:linux-82:root-[INFO]:-Detected platform: Generic Linux Cluster

20140415:11:15:47:013028 gpcheck:linux-82:root-[INFO]:-generate data on servers

20140415:11:15:47:013028 gpcheck:linux-82:root-[INFO]:-copy data files from servers

20140415:11:15:47:013028 gpcheck:linux-82:root-[INFO]:-delete remote tmp files

20140415:11:15:47:013028 gpcheck:linux-82:root-[INFO]:-Using gpcheck config file: /usr/local/greenplum-db/etc/gpcheck.cnf

20140415:11:15:47:013028 gpcheck:linux-82:root-[INFO]:-GPCHECK_NORMAL

20140415:11:15:47:013028 gpcheck:linux-82:root-[INFO]:-gpcheck completing...

 

4.0 配置字符集

操作步骤

                                步骤 1     在每台主机上分别以gpadmin用户登录数据库服务器;

                                步骤 2     编辑.bashrc配置文件,添加如下:

export LC_ALL=en_US.utf-8

export LANG=en_US.utf-8

                                步骤 3     source .bashrc 后,用命令locale查看字符集设置情况,如下:

LANG=en_US.utf-8

LC_CTYPE="en_US.utf-8"

LC_NUMERIC="en_US.utf-8"

LC_TIME="en_US.utf-8"

LC_COLLATE="en_US.utf-8"

LC_MONETARY="en_US.utf-8"

LC_MESSAGES="en_US.utf-8"

LC_PAPER="en_US.utf-8"

LC_NAME="en_US.utf-8"

LC_ADDRESS="en_US.utf-8"

LC_TELEPHONE="en_US.utf-8"

LC_MEASUREMENT="en_US.utf-8"

LC_IDENTIFICATION="en_US.utf-8"

LC_ALL=en_US.utf-8

 

5.0 初始化数据库
9.0.1 创建初始化主机文件

操作步骤

                                步骤 1     master主机上gpadmin用户登录数据库服务器;

su - gpadmin

                                步骤 2     创建文件夹,并编辑hostfile_gpinitsystem配置文件,如下:

gpadmin@linux-82:~> mkdir gpconfigs

gpadmin@linux-82:~> cd gpconfigs/

gpadmin@linux-82:~/gpconfigs> vi hostfile_gpinitsystem

添加各segment hostname,如:linux113

 

9.0.2 创建数据库配置文件

操作步骤

                                步骤 1     master主机上gpadmin用户登录数据库服务器;

su - gpadmin

                                步骤 2     备份gpinitsystem_config配置文件,如下:

gpadmin@linux-82:~> source /usr/local/greenplum-db/greenplum_path.sh

gpadmin@linux-82:~> cp $GPHOME/docs/cli_help/gpconfigs/gpinitsystem_config /home/gpadmin/gpconfigs/gpinitsystem_config

                                步骤 3     打开备份的gpinitsystem_config配置文件进行编辑,如下:

需修改部分已红色字体标记

# FILE NAME: gpinitsystem_config

 

# Configuration file needed by the gpinitsystem

 

################################################

#### REQUIRED PARAMETERS

################################################

 

#### Name of this Greenplum system enclosed in quotes.

ARRAY_NAME="EMC Greenplum DW"

 

#### Naming convention for utility-generated data directories.

SEG_PREFIX=gpseg

 

#### Base number by which primary segment port numbers

#### are calculated.

PORT_BASE=40000

 

#### File system location(s) where primary segment data directories

#### will be created. The number of locations in the list dictate

#### the number of primary segments that will get created per

#### physical host (if multiple addresses for a host are listed in

#### the hostfile, the number of segments will be spread evenly across

#### the specified interface addresses).

declare -a DATA_DIRECTORY=(/opt/greenplum/primary /opt/greenplum/primary)

 

#### OS-configured hostname or IP address of the master host.

MASTER_HOSTNAME=linux-82

 

#### File system location where the master data directory

#### will be created.

MASTER_DIRECTORY=/opt/greenplum/master

 

#### Port number for the master instance.

MASTER_PORT=5432

 

#### Shell utility used to connect to remote hosts.

TRUSTED_SHELL=ssh

 

#### Maximum log file segments between automatic WAL checkpoints.

CHECK_POINT_SEGMENTS=8

 

#### Default server-side character set encoding.

ENCODING=UNICODE

 

################################################

#### OPTIONAL MIRROR PARAMETERS

################################################

 

#### Base number by which mirror segment port numbers

#### are calculated.

MIRROR_PORT_BASE=50000

 

#### Base number by which primary file replication port

#### numbers are calculated.

REPLICATION_PORT_BASE=41000

 

#### Base number by which mirror file replication port

#### numbers are calculated.

MIRROR_REPLICATION_PORT_BASE=51000

 

#### File system location(s) where mirror segment data directories

#### will be created. The number of mirror locations must equal the

#### number of primary locations as specified in the

#### DATA_DIRECTORY parameter.

declare -a MIRROR_DATA_DIRECTORY=(/opt/greenplum/mirror /opt/greenplum/mirror)

 

 

################################################

#### OTHER OPTIONAL PARAMETERS

################################################

 

#### Create a database of this name after initialization.

#DATABASE_NAME=name_of_database

 

#### Specify the location of the host address file here instead of

#### with the the -h option of gpinitsystem.

#MACHINE_LIST_FILE=/home/gpadmin/gpconfigs/hostfile_gpinitsystem

 

 

基于html+python+Apriori 算法、SVD(奇异值分解)的电影推荐算法+源码+项目文档+算法解析+数据集,适合毕业设计、课程设计、项目开发。项目源码已经过严格测试,可以放心参考并在此基础上延申使用,详情见md文档 电影推荐算法:Apriori 算法、SVD(奇异值分解)推荐算法 电影、用户可视化 电影、用户管理 数据统计 SVD 推荐 根据电影打分进行推荐 使用 svd 模型计算用户对未评分的电影打分,返回前 n 个打分最高的电影作为推荐结果 n = 30 for now 使用相似电影进行推荐 根据用户最喜欢的前 K 部电影,分别计算这 K 部电影的相似电影 n 部,返回 K*n 部电影进行推荐 K = 10 and n = 5 for now 根据相似用户进行推荐 获取相似用户 K 个,分别取这 K 个用户的最喜爱电影 n 部,返回 K*n 部电影进行推荐 K = 10 and n = 5 for now Redis 使用 Redis 做页面访问次数统计 缓存相似电影 在使用相似电影推荐的方式时,每次请求大概需要 6.6s(需要遍历计算与所有电影的相似度)。 将相似电影存储至 redis 中(仅存储 movie_id,拿到 movie_id 后还是从 mysql 中获取电影详细信息), 时间缩短至:93ms。 十部电影,每部存 top 5 similar movie 登录了 1-6 user并使用了推荐系统,redis 中新增了 50 部电影的 similar movie,也就是说,系统只为 6 为用户计算了共 60 部电影的相似度,其中就有10 部重复电影。 热点电影重复度还是比较高的
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值