Amazon web services Beanstalk:设置LD_LIBRARY_PATH变量
在尝试将Django应用程序(使用sqlite db)部署到Beanstalk时,我遇到错误:Amazon web services Beanstalk:设置LD_LIBRARY_PATH变量,amazon-web-services,sqlite,amazon-elastic-beanstalk,Amazon Web Services,Sqlite,Amazon Elastic Beanstalk,在尝试将Django应用程序(使用sqlite db)部署到Beanstalk时,我遇到错误: "deterministic=True requires SQLite 3.8.3 or higher" 解决方案似乎是升级sqlite并设置LD_LIBRARY_PATH。因此,我将此添加到.ebextensions/app.config: option_settings: aws:elasticbeanstalk:application:environment:
"deterministic=True requires SQLite 3.8.3 or higher"
解决方案似乎是升级sqlite并设置LD_LIBRARY_PATH。因此,我将此添加到.ebextensions/app.config
:
option_settings:
aws:elasticbeanstalk:application:environment:
LD_LIBRARY_PATH: /usr/local/lib
commands:
01_upgrade_sqlite:
command: "cd ~ && wget https://www.sqlite.org/2020/sqlite-autoconf-3320100.tar.gz && tar xvfz sqlite-autoconf-3320100.tar.gz && cd sqlite-autoconf-3320100 && ./configure && make && make install"
但是无论我怎么做,环境变量LD\u LIBRARY\u PATH
都没有设置。我已经通过登录到环境(ebssh
)并执行env
命令进行了检查。我还尝试在命令
和容器_命令
下的命令中设置环境变量。无济于事。我错过什么了吗
编辑:
一些相关的讨论(尽管没有解决方案):
commands:
01_upgrade_sqlite:
command: |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(/opt/elasticbeanstalk/bin/get-config environment -k LD_LIBRARY_PATH)
echo "$LD_LIBRARY_PATH"
cd ~
wget https://www.sqlite.org/2020/sqlite-autoconf-3320100.tar.gz
tar xvfz sqlite-autoconf-3320100.tar.gz
cd sqlite-autoconf-3320100 && ./configure
make && make install
或
谢谢,但是Django仍然给我提供了
deterministic=True需要SQLite 3.8.3或更高版本的。在ssh'ing到环境中之后执行env
,不会将LD_LIBRARY_路径作为环境变量显示给我。或者您的意思是,您必须为运行的每个脚本明确地设置它们?那么在开始Django的时候呢?不过,我不知道如何访问启动Django应用程序的EB脚本。@Bercobute您的01\u upgrade\u sqlite
运行时是否没有任何错误?您是否可以通过ssh连接到eb实例并验证新的sqlite
是否已正确安装?通过ssh连接到eb实例并启动sqlite3会显示版本sqlite版本3.32.1
。看起来不错。日志(eb日志
)也没有显示任何错误。但当Django应用程序尝试使用sqlite时,它抛出:create_deterministic_函数('Django_date_extract',2,_sqlite_datetime_extract)”,“Django.db.utils.NotSupportedError:deterministic=True需要sqlite 3.8.3或更高版本”
commands:
01_upgrade_sqlite:
command: |
export $(cat /opt/elasticbeanstalk/deployment/env | xargs)
echo "$LD_LIBRARY_PATH"
cd ~
wget https://www.sqlite.org/2020/sqlite-autoconf-3320100.tar.gz
tar xvfz sqlite-autoconf-3320100.tar.gz
cd sqlite-autoconf-3320100 && ./configure
make && make install