小编典典

如何在本地运行yugabyte-db yugastore应用程序?

redis

我正在使用yugabyte-
db-1.3.0,并尝试按照其README.md中的说明在CentOS7上本地运行yugabyte电子商务示例应用程序yugastore,如下所示:

a) downloaded and extracted application, yugastore to /var/www/html/yugastore
b) ./bin/yb-ctl start
c) cd /var/www/html/yugastore
c) yum install -y nodejs
d) npm install cassandra-driver
e) npm install redis
f) npm install async
g) ./bin/yb-ctl setup_redis
h) npm install
i) npm install --save core-js@^3
j) npm start

我收到错误,如下所示:

[root@srvr0 yugastore]# npm start

> yugastore@0.0.0 start /var/www/html/yugastore
> supervisor ./bin/www


Running node-supervisor with
  program './bin/www'
  --watch '.'
  --extensions 'node,js,/bin/www'
  --exec 'node'

Starting child process with 'node ./bin/www'
Watching directory '/var/www/html/yugastore' for changes.
Press rs for restarting the process.
DB host: 127.0.0.1
/var/www/html/yugastore/ui/build/index.html
Error: ENOENT: no such file or directory, stat '/var/www/html/yugastore/ui/build/index.html'
    at Error (native)
GET /yugastore/ui/build/index.html 404 58.690 ms - 143

请帮助我解决问题。

更新1:

非常感谢Dorian先生
有一些弃用警告,因为我使用的是较旧的CentOS7。只需按以下步骤启动应用程序:

cd ~
rm -rf /opt/yugabyte
mkdir -p /opt/yugabyte
mkdir -p /opt/yugabyte/data
cd /tmp
wget https://downloads.yugabyte.com/yugabyte-1.3.0.0-linux.tar.gz
tar -xvzf /tmp/yugabyte/yugabyte-1.3.0.0-linux.tar.gz -C /opt/yugabyte
cd /opt/yugabyte/yugabyte-1.3.0.0
/opt/yugabyte/yugabyte-1.3.0.0/bin/post_install.sh
/opt/yugabyte/yugabyte-1.3.0.0/bin/yb-ctl --data_dir "/opt/yugabyte/data" destroy
/opt/yugabyte/yugabyte-1.3.0.0/bin/yb-ctl --data_dir "/opt/yugabyte/data" create
/opt/yugabyte/yugabyte-1.3.0.0/bin/yb-ctl --data_dir "/opt/yugabyte/data" stop
/opt/yugabyte/yugabyte-1.3.0.0/bin/yb-ctl --data_dir "/opt/yugabyte/data" start
/opt/yugabyte/yugabyte-1.3.0.0/bin/yb-ctl --data_dir "/opt/yugabyte/data" setup_redis

cd ~
rm -rf /var/www/html/yugastore
cd /tmp
git clone https://github.com/yugabyte/yugastore
cd /tmp/yugastore
tar -cvzf /tmp/yugastore.tar.gz .
mkdir -p /var/www/html/yugastore
tar -xvzf /tmp/yugastore.tar.gz -C /var/www/html/yugastore

cd /var/www/html/yugastore
npm install cassandra-driver
npm install redis
npm install async
npm install
npm install --save core-js@^3
node models/yugabyte/db_init.js
npm start

###In another terminal:
cd /var/www/html/yugastore/ui
npm install
npm start

阅读 343

收藏
2020-06-20

共1个答案

小编典典

您使用的是YugabyteDB的非常旧的版本。截至2020年1月9日,最新版本为2.0.10

看起来您的路径不匹配。您可以验证文件是否存在并且构建正确完成吗?

下载并安装(https://download.yugabyte.com)数据库:

wget https://downloads.yugabyte.com/yugabyte-2.0.10.0-linux.tar.gz
tar xvfz yugabyte-2.0.10.0-linux.tar.gz && cd yugabyte-2.0.10.0/
./bin/post_install.sh
./bin/yb-ctl create
./bin/yb-ctl setup_redis

下载并安装yugastore:(https://github.com/yugabyte/yugastore#run-
locally)

git clone https://github.com/yugabyte/yugastore
cd yugastore
node models/yugabyte/db_init.js
npm start

在另一个外壳中:

cd yugastore/ui
npm install # First time only
npm start

网站将打开一个新标签。

2020-06-20