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

How to run yugabyte-db yugastore application locally?

我正在使用 yugabyte-db-1.3.0 并正在尝试 运行 yugabyte 电子商务示例应用程序,按照其 README.md 中的说明在 CentOS7 本地运行 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

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

看起来你有一个路径 mismatch.Can 你确认文件在那里并且构建正确完成了吗?

下载并安装 (https://download.yugabyte.com)the db:

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

另一个shell:

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

网站将打开一个新标签页。