yugabyte 安装pg_hashids 扩展
主要目的比较简单,就是测试下yugabyte 对于pg 扩展的支持,今天在测试plv8的时候发现有问题(以及提交issue了,很期待官方的解决)
所以测试下一个其他的扩展,看看是否像官方介绍的那样
环境准备
- 说明
环境基于docker 运行,同时pg_hashids 扩展也基于docker 构建,之后copy yugabyte 扩展安装目录 - pg_hashids dockerfile
FROM postgres:11.2
ENV PG_HASHIDS=v1.2.1
LABEL EMAIL="1141591465@qq.com"
LABEL AUTHOR="dalongrong"
RUN buildDependencies="curl build-essential ca-certificates git pkg-config postgresql-server-dev-$PG_MAJOR" \
&& apt-get update \
&& apt-get install -y --no-install-recommends libc++1 ${buildDependencies} \
&& mkdir -p /tmp/build \
&& cd /tmp/build \
&& git clone https://github.com/iCyberon/pg_hashids.git /tmp/build/pg_hashids \
&& cd /tmp/build/pg_hashids \
&& make && make install \
&& cd / \
&& apt-get clean \
&& apt-get remove -y ${buildDependencies} \
&& apt-get autoremove -y \
&& rm -rf /tmp/build /var/lib/apt/lists/*
- yugabyte 集群
基于docker-compose 运行
version: '2'
services:
yb-master:
image: yugabytedb/yugabyte:latest
container_name: yb-master-n1
command: [ "/home/yugabyte/bin/yb-master",
"--fs_data_dirs=/mnt/disk0,/mnt/disk1",
"--master_addresses=yb-master-n1:7100",
"--replication_factor=1"]
ports:
- "7000:7000"
environment:
SERVICE_7000_NAME: yb-master
yb-tserver:
image: yugabytedb/yugabyte:latest
container_name: yb-tserver-n1
command: [ "/home/yugabyte/bin/yb-tserver",
"--fs_data_dirs=/mnt/disk0,/mnt/disk1",
"--start_pgsql_proxy",
"--tserver_master_addrs=yb-master-n1:7100"]
ports:
- "9042:9042"
- "6379:6379"
- "5433:5433"
- "9000:9000"
environment:
SERVICE_5433_NAME: ysql
SERVICE_9042_NAME: ycql
SERVICE_6379_NAME: yedis
SERVICE_9000_NAME: yb-tserver
depends_on:
- yb-master
yb-tserver2:
image: yugabytedb/yugabyte:latest
container_name: yb-tserver-n2
command: [ "/home/yugabyte/bin/yb-tserver",
"--fs_data_dirs=/mnt/disk0,/mnt/disk1",
"--start_pgsql_proxy",
"--tserver_master_addrs=yb-master-n1:7100"]
ports:
- "9043:9042"
- "6380:6379"
- "5434:5433"
- "9001:9000"
environment:
SERVICE_5433_NAME: ysql
SERVICE_9042_NAME: ycql
SERVICE_6379_NAME: yedis
SERVICE_9000_NAME: yb-tserver
depends_on:
- yb-master
启动&&扩展copy
- 启动服务
docker-compose up -d
- 启用ysql
新版本的好像默认,就启用了,后边在仔细测试下
docker-compose exec yb-master bash -c "YB_ENABLED_IN_POSTGRES=1 FLAGS_pggate_master_addresses=yb-master-n1:7100 /home/yugabyte/postgres/bin/initdb -D /tmp/yb_pg_initdb_tmp_data_dir -U postgres"
- copy 扩展
为了测试,我已经copy 出构建好的扩展到本地
docker cp hashids/pg_hashids.so yb-tserver-n1:/home/yugabyte/postgres/lib
docker cp hashids/pg_hashids.so yb-tserver-n2:/home/yugabyte/postgres/lib
docker cp hashids/extension/. yb-tserver-n1:/home/yugabyte/postgres/share/extension
docker cp hashids/extension/. yb-tserver-n2:/home/yugabyte/postgres/share/extension
扩展测试
- 启动扩展
CREATE EXTENSION pg_hashids;
- 调用函数
SELECT id_encode(1001);
- 效果

参考资料
https://github.com/iCyberon/pg_hashids
https://github.com/rongfengliang/yugabytedb-jaeger-docker-compose
https://github.com/rongfengliang/pg_hashids_docker
https://docs.yugabyte.com/latest/api/ysql/extensions/
https://hashids.org/
yugabyte 安装pg_hashids 扩展的更多相关文章
- pecl 轻松安装php扩展
PECL 的全称是 The PHP Extension Community Library ,是一个开放的并通过 PEAR(PHP Extension and Application Reposito ...
- 编译安装PHP7并安装Redis扩展Swoole扩展
编译安装PHP7并安装Redis扩展Swoole扩展 在编译php7的机器上已经有编译安装过php5.3以上的版本,从而依赖库都有了 本php7是编译成fpm-php 使用的, 如果是apache那么 ...
- 使用phpize安装php扩展
环境: CentOs 6.3 php 7 nginx 举例: 安装ssh2扩展 1.登陆http://pecl.php.net,搜索ssh2,如下图所示,注意版本的选择要根据php的版本来 2.下载s ...
- centos下安装php扩展php-memcached
说来坎坷,为了安装这个php的扩展php-memcached,连操作系统都换了,从centos5.5升级到了centos6.8!! centos5.5中在安装php扩展php-memcached的依赖 ...
- 如何正确使用 Composer 安装 Laravel 扩展包
我们经常要往现有的项目中添加扩展包,有时候因为文档的错误引导,如下图来自 这个文档 的: composer update 这个命令在我们现在的逻辑中,可能会对项目造成巨大伤害. 因为 composer ...
- win10 64位安装memcache扩展和开启redis扩展
前面有关于win10下搭建wamp环境的介绍,在此不在赘述,php操作memcache有memcache库和memcached库,其中memcache是php内置的扩展库,支持面向对象和面向过程两种操 ...
- Linux下,如何给PHP安装pdo_mysql扩展
下载了一个免费开源的广告系统(openadserver),在Linux上安装时,提示要安装 pdo_mysql 扩展,先前有过编译安装 soap扩展 的经历,今天要编译安装 pdo_mysql 扩展, ...
- [Linux][PHP]安装swoole扩展
1.下载swoole 2.解压并配置 /usr/local/php/bin/phpize ./configure --enable-swoole-debug --enable-sockets --en ...
- lnmp---------------lnmp1.3-full安装包安装lnmp环境,如何安装PHP扩展
1. 如果已经安装LNMP套件,请按以下步骤处理 a. 跳转到fileinfo源代码目录` cd /root/downloads/lnmp1.2-full/src/php-7.0.7/ext/file ...
随机推荐
- POJ 1061 青蛙的约会 题解
青蛙的约会 Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 139755 Accepted: 31803 Descript ...
- fastclick作用
fastclick 是具有消除移动端浏览器上的点击事件的 300ms 的延迟的作用. 注意几点 1.PC端无效 2.Android 上的 Chrome 32+ 浏览器,如果在 viewport met ...
- JSONBuilder的用法
一.JSONBuilder可以向文件中写入写入json字符串.如下面的例子: 1 public class Test 2 { 3 public static void main(String args ...
- Mysql系列(十二)—— 索引下推优化
索引条件下推(ICP)是对MySQL使用索引从表中检索行的情况的优化.如果没有ICP,存储引擎会遍历索引以查找基表中的行,并将它们返回给MySQL服务器,该服务器会评估WHERE行的条件.启用ICP后 ...
- Linux之IO
速度差异 I/O不仅仅是硬盘,还包括外围的所有设备,比如键盘鼠标,比如1.44M的3.5英寸软盘(还有人记得么).但服务器环境,泛指硬盘. 硬盘有多慢呢?我们不去探究不同设备的实现细节,直接看它的写入 ...
- Mysql外键约束之CASCADE、SET NULL、RESTRICT、NO ACTION
Mysql中有目前只有InnoDB引擎支持外键约束,InnoDB中外键约束定义的语法如下: ALTER TABLE tbl_name ADD [CONSTRAINT [symbol]] FOREIGN ...
- Bootstrap3-导航
Bootstrap 导航 1. 定义导航组件 基本结构: <!-- 基本导航组件 --> <ul class="nav"> <li class=&qu ...
- python plotly画柱状图
代码 import pandas as pd import numpy as np import plotly.plotly as py import plotly.graph_objs as go ...
- java mail 封装工具类使用
直接上代码 配置QQ邮箱的IMAP 进入qq电子邮件点击 设置->账户里开启 SMTP 服务(开启IMAP/SMTP服务) 注意:在启用QQ邮箱的14天之后才能开启此服务 创建Sendmail ...
- web-api POST body object always null
If the any of values of the request's JSON object are not the same type as expected by the service ...