Я получаю ошибку 504, и я не знаю почему, мой сервер узлов работает, и когда я отправляю сообщение или получаю запрос на конечную точку без mysql запроса , я получаю рабочий ответ, проблема в том, что когда я отправляю запрос конечной точке, которая предполагает выполнение запроса к базе данных mysql, я получаю ошибку 504, кто-то, пожалуйста, помогите
Вот мой журнал mysql ( пожалуйста, обратите внимание, что сервер запускается и выключается много вещей: -)
Starting local mysqld server ...
Waiting for MySQL to start ...
2020-01-12 09:30:36 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2020-01-12 09:30:36 0 [Note] /opt/rh/rh-mysql56/root/usr/libexec/mysqld (mysqld 5.6.24) starting as process 58 ...
2020-01-12 09:30:36 58 [Warning] One can only use the --user switch if running as root
2020-01-12 09:30:36 58 [Note] Plugin 'FEDERATED' is disabled.
2020-01-12 09:30:36 58 [Note] InnoDB: Using atomics to ref count buffer pool pages
2020-01-12 09:30:36 58 [Note] InnoDB: The InnoDB memory heap is disabled
2020-01-12 09:30:36 58 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2020-01-12 09:30:36 58 [Note] InnoDB: Memory barrier is not used
2020-01-12 09:30:36 58 [Note] InnoDB: Compressed tables use zlib 1.2.7
2020-01-12 09:30:36 58 [Note] InnoDB: Using Linux native AIO
2020-01-12 09:30:36 58 [Note] InnoDB: Using CPU crc32 instructions
2020-01-12 09:30:36 58 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2020-01-12 09:30:36 58 [Note] InnoDB: Completed initialization of buffer pool
2020-01-12 09:30:36 58 [Note] InnoDB: Highest supported file format is Barracuda.
2020-01-12 09:30:36 58 [Note] InnoDB: 128 rollback segment(s) are active.
2020-01-12 09:30:36 58 [Note] InnoDB: Waiting for purge to start
2020-01-12 09:30:36 58 [Note] InnoDB: 5.6.24 started; log sequence number 1625987
2020-01-12 09:30:36 58 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 3040e191-351e-11ea-8290-0a580a82084d.
2020-01-12 09:30:36 58 [Note] RSA private key file not found: /var/lib/mysql/data//private_key.pem. Some authentication plugins will not work.
2020-01-12 09:30:36 58 [Note] RSA public key file not found: /var/lib/mysql/data//public_key.pem. Some authentication plugins will not work.
2020-01-12 09:30:36 58 [Warning] 'user' entry 'root@mysql-56-centos7-2-vhjzz' ignored in --skip-name-resolve mode.
2020-01-12 09:30:36 58 [Warning] 'user' entry '@mysql-56-centos7-2-vhjzz' ignored in --skip-name-resolve mode.
2020-01-12 09:30:36 58 [Warning] 'proxies_priv' entry '@ root@mysql-56-centos7-2-vhjzz' ignored in --skip-name-resolve mode.
2020-01-12 09:30:36 58 [Note] Event Scheduler: Loaded 0 events
2020-01-12 09:30:36 58 [Note] /opt/rh/rh-mysql56/root/usr/libexec/mysqld: ready for connections.
Version: '5.6.24' socket: '/tmp/mysql.sock' port: 0 MySQL Community Server (GPL)
2020-01-12 09:30:36 58 [Warning] 'user' entry 'root@mysql-56-centos7-2-vhjzz' ignored in --skip-name-resolve mode.
2020-01-12 09:30:36 58 [Warning] 'user' entry '@mysql-56-centos7-2-vhjzz' ignored in --skip-name-resolve mode.
2020-01-12 09:30:36 58 [Warning] 'proxies_priv' entry '@ root@mysql-56-centos7-2-vhjzz' ignored in --skip-name-resolve mode.
2020-01-12 09:30:36 58 [Warning] 'user' entry 'root@mysql-56-centos7-2-vhjzz' ignored in --skip-name-resolve mode.
2020-01-12 09:30:36 58 [Warning] 'user' entry '@mysql-56-centos7-2-vhjzz' ignored in --skip-name-resolve mode.
2020-01-12 09:30:36 58 [Warning] 'proxies_priv' entry '@ root@mysql-56-centos7-2-vhjzz' ignored in --skip-name-resolve mode.
2020-01-12 09:30:36 58 [Note] /opt/rh/rh-mysql56/root/usr/libexec/mysqld: Normal shutdown
2020-01-12 09:30:36 58 [Note] Giving 0 client threads a chance to die gracefully
2020-01-12 09:30:36 58 [Note] Event Scheduler: Purging the queue. 0 events
2020-01-12 09:30:36 58 [Note] Shutting down slave threads
2020-01-12 09:30:36 58 [Note] Forcefully disconnecting 0 remaining clients
2020-01-12 09:30:36 58 [Note] Binlog end
2020-01-12 09:30:36 58 [Note] Shutting down plugin 'partition'
2020-01-12 09:30:36 58 [Note] Shutting down plugin 'ARCHIVE'
2020-01-12 09:30:36 58 [Note] Shutting down plugin 'BLACKHOLE'
2020-01-12 09:30:36 58 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2020-01-12 09:30:36 58 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
2020-01-12 09:30:36 58 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2020-01-12 09:30:36 58 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2020-01-12 09:30:36 58 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2020-01-12 09:30:36 58 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2020-01-12 09:30:36 58 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2020-01-12 09:30:36 58 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2020-01-12 09:30:36 58 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2020-01-12 09:30:36 58 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2020-01-12 09:30:36 58 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2020-01-12 09:30:36 58 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2020-01-12 09:30:36 58 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2020-01-12 09:30:36 58 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2020-01-12 09:30:36 58 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2020-01-12 09:30:36 58 [Note] Shutting down plugin 'INNODB_METRICS'
2020-01-12 09:30:36 58 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2020-01-12 09:30:36 58 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2020-01-12 09:30:36 58 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2020-01-12 09:30:36 58 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2020-01-12 09:30:36 58 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2020-01-12 09:30:36 58 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2020-01-12 09:30:36 58 [Note] Shutting down plugin 'INNODB_CMPMEM'
2020-01-12 09:30:36 58 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2020-01-12 09:30:36 58 [Note] Shutting down plugin 'INNODB_CMP'
2020-01-12 09:30:36 58 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2020-01-12 09:30:36 58 [Note] Shutting down plugin 'INNODB_LOCKS'
2020-01-12 09:30:36 58 [Note] Shutting down plugin 'INNODB_TRX'
2020-01-12 09:30:36 58 [Note] Shutting down plugin 'InnoDB'
2020-01-12 09:30:36 58 [Note] InnoDB: FTS optimize thread exiting.
2020-01-12 09:30:36 58 [Note] InnoDB: Starting shutdown...
2020-01-12 09:30:38 58 [Note] InnoDB: Shutdown completed; log sequence number 1625997
2020-01-12 09:30:38 58 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2020-01-12 09:30:38 58 [Note] Shutting down plugin 'MRG_MYISAM'
2020-01-12 09:30:38 58 [Note] Shutting down plugin 'MEMORY'
2020-01-12 09:30:38 58 [Note] Shutting down plugin 'CSV'
2020-01-12 09:30:38 58 [Note] Shutting down plugin 'MyISAM'
2020-01-12 09:30:38 58 [Note] Shutting down plugin 'sha256_password'
2020-01-12 09:30:38 58 [Note] Shutting down plugin 'mysql_old_password'
2020-01-12 09:30:38 58 [Note] Shutting down plugin 'mysql_native_password'
2020-01-12 09:30:38 58 [Note] Shutting down plugin 'binlog'
2020-01-12 09:30:38 58 [Note] /opt/rh/rh-mysql56/root/usr/libexec/mysqld: Shutdown complete
2020-01-12 09:30:39 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2020-01-12 09:30:39 0 [Note] /opt/rh/rh-mysql56/root/usr/libexec/mysqld (mysqld 5.6.24) starting as process 1 ...
2020-01-12 09:30:39 1 [Warning] One can only use the --user switch if running as root
2020-01-12 09:30:39 1 [Note] Plugin 'FEDERATED' is disabled.
2020-01-12 09:30:39 1 [Note] InnoDB: Using atomics to ref count buffer pool pages
2020-01-12 09:30:39 1 [Note] InnoDB: The InnoDB memory heap is disabled
2020-01-12 09:30:39 1 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2020-01-12 09:30:39 1 [Note] InnoDB: Memory barrier is not used
2020-01-12 09:30:39 1 [Note] InnoDB: Compressed tables use zlib 1.2.7
2020-01-12 09:30:39 1 [Note] InnoDB: Using Linux native AIO
2020-01-12 09:30:39 1 [Note] InnoDB: Using CPU crc32 instructions
2020-01-12 09:30:39 1 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2020-01-12 09:30:39 1 [Note] InnoDB: Completed initialization of buffer pool
2020-01-12 09:30:39 1 [Note] InnoDB: Highest supported file format is Barracuda.
2020-01-12 09:30:39 1 [Note] InnoDB: 128 rollback segment(s) are active.
2020-01-12 09:30:39 1 [Note] InnoDB: Waiting for purge to start
2020-01-12 09:30:39 1 [Note] InnoDB: 5.6.24 started; log sequence number 1625997
2020-01-12 09:30:39 1 [Note] RSA private key file not found: /var/lib/mysql/data//private_key.pem. Some authentication plugins will not work.
2020-01-12 09:30:39 1 [Note] RSA public key file not found: /var/lib/mysql/data//public_key.pem. Some authentication plugins will not work.
2020-01-12 09:30:39 1 [Note] Server hostname (bind-address): '*'; port: 3306
2020-01-12 09:30:39 1 [Note] IPv6 is available.
2020-01-12 09:30:39 1 [Note] - '::' resolves to '::';
2020-01-12 09:30:39 1 [Note] Server socket created on IP: '::'.
2020-01-12 09:30:39 1 [Warning] 'user' entry 'root@mysql-56-centos7-2-vhjzz' ignored in --skip-name-resolve mode.
2020-01-12 09:30:39 1 [Warning] 'user' entry '@mysql-56-centos7-2-vhjzz' ignored in --skip-name-resolve mode.
2020-01-12 09:30:39 1 [Warning] 'proxies_priv' entry '@ root@mysql-56-centos7-2-vhjzz' ignored in --skip-name-resolve mode.
2020-01-12 09:30:39 1 [Note] Event Scheduler: Loaded 0 events
2020-01-12 09:30:39 1 [Note] /opt/rh/rh-mysql56/root/usr/libexec/mysqld: ready for connections.
Version: '5.6.24' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server(GPL)
node.js сервер (работает, когда я публикую без запроса sql)
const pool = mysql.createPool({
host : process.env.OPENSHIFT_MYSQL_DB_HOST,
user : process.env.OPENSHIFT_MYSQL_DB_USERNAME,
password : process.env.OPENSHIFT_MYSQL_DB_PASSWORD,
port : process.env.OPENSHIFT_MYSQL_DB_PORT || 8080,
database : "mobiletdb2"
});
//Connect
pool.query('select 1 + 1', (err, rows) => { /* */ });
//endpoints
app.post('/postthis', function(request, response) {
//response it returned to client -works fine
response.json({"message":"got this response"});
})
app.post('/posthistoo', (request, response) => {
// 504 error
let sql = `SELECT * FROM members`;
let query = pool.query(sql, (err, result)=>{
if(err) throw err;
if(result && result.length) {
response.json({"message":"your members","data":result});
}else {
response.json({"message":"no members"});
}
});
});
пожалуйста, помогите, если Вы можете