Closed gagan-bansal closed 8 years ago
Postgis Plugin: no connection to the server
Are you sure your psql credentials are OK?
image_reader: can't determine type from input data
Any missing shp or something?
Without pm2 its working fine. I requested many tiles continuously on kosmtik with pm2 from the script on server itself and I get such error. Now also on pm2 its fine, in between I am getting such error.
I am exporting tiles for given tile list, here is the code
var fs = require('fs')
var path = require('path')
var mkdirp = require('mkdirp')
var request = require('request')
var async = require('async')
var argv = require('yargs')
.usage('Usage: $0 -u [str] -t [str] -o [str]')
.option('u', {
alias: 'baseURL',
demand: true,
default: 'http://127.0.0.1:6789/openstreetmap-carto/tile',
describe: 'base url serving map tile',
type: 'string'
})
.option('t', {
alias: 'tileList',
demand: true,
describe: 'a file for tiles list',
type: 'string'
})
.option('o', {
alias: 'outPath',
demand: true,
desc: 'output tile directory',
default: './',
type: 'string'
})
.help()
.argv
if(!isDir(argv.o)) return console.log('Not valid outPath: ' + argv.o)
fs.readFile(argv.t, 'utf8', function(err, data) {
if (err) throw err
var tiles = data.split('\n')
tiles.pop()
async.eachOfLimit(tiles,20, function(tile, index, callback) {
request(
argv.u + '/' + tile,
{encoding:'binary'},
function(err, resp, body) {
if (err) return console.error('Error for: ' + tile + ': ' + err)
var filePath = argv.o + '/' + tile
var dirPath = path.dirname(filePath)
if (!isDir(dirPath)) mkdirp.sync(dirPath)
fs.writeFile(filePath, body, 'binary', function(err) {
if (err) throw err;
console.log(filePath)
callback()
})
}
)
}, function(err) {
if (err) {
console.log('oh here is the error')
console.error(err)
} else {
console.log('all done')
}
})
})
function isDir(dir) {
try {
return fs.statSync(dir).isDirectory()
} catch (err) {
return false
}
}
I am exporting tiles for given tile list, here is the code
Have you tried https://github.com/kosmtik/kosmtik-tiles-export ?
Yes I tried it, there was small issue for labels on the edge (partial labels) may be some configuration required for meta buffer. Another thing I thought to do the tile export as asynchronous and running kosmtik on multi core machine.
Another thing I thought to do the tile export as asynchronous and running kosmtik on multi core machine.
The trunk version (not yet in npm, but I may release tomorrow) should already be multi core. You can control the number of workers with the --workers
option.
Oh nice it will solve a lot. Then I think pm2 is not required to me the only purpose of pm2 was to run on multi core.
Released.
Thanks Its working well. Creating separate issue for edge label.
Yes, thanks.
I am trying to run
kosmtik
on pm2. Its starting properly but getting error in between. Enclosing the logs herewith. Its interesting if we run kosmtik on pm2.node.js v4.4.7 starting kosmtik with pm2
pm2 logs output:
and here is the list of pm2 processes
and error log: