mirror of https://gitee.com/bigwinds/arangodb
we have a bootstrapping agency
This commit is contained in:
parent
5ec535bf98
commit
b3ba9be57f
|
@ -421,7 +421,8 @@ bool Constituent::start(TRI_vocbase_t* vocbase,
|
|||
void Constituent::run() {
|
||||
|
||||
LOG(WARN) << "Starting constituent";
|
||||
|
||||
_id = _agent->config().id();
|
||||
|
||||
TRI_ASSERT(_vocbase != nullptr);
|
||||
auto bindVars = std::make_shared<VPackBuilder>();
|
||||
bindVars->openObject();
|
||||
|
|
|
@ -58,9 +58,9 @@ void Inception::run() {
|
|||
TRI_ASSERT(_agent != nullptr);
|
||||
|
||||
auto s = std::chrono::system_clock::now();
|
||||
std::chrono::seconds timeout(30);
|
||||
std::chrono::seconds timeout(10);
|
||||
size_t i = 0;
|
||||
|
||||
bool cs = false;
|
||||
while (!this->isStopping()) {
|
||||
|
||||
config_t config = _agent->config(); // get a copy of conf
|
||||
|
@ -111,18 +111,19 @@ void Inception::run() {
|
|||
LOG_TOPIC(ERR, Logger::AGENCY) <<
|
||||
"Failed to find complete pool of agents. Giving up!";
|
||||
}
|
||||
// this->shutdown();
|
||||
break;
|
||||
}
|
||||
|
||||
if (config.poolComplete()) {
|
||||
_agent->startConstituent();
|
||||
break;
|
||||
if (!cs) {
|
||||
_agent->startConstituent();
|
||||
cs = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//this->shutdown();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -35,10 +35,11 @@ rm -rf agency
|
|||
mkdir -p agency
|
||||
echo -n "Starting agency ... "
|
||||
if [ $NRAGENTS -gt 1 ]; then
|
||||
for aid in `seq 0 $(( $NRAGENTS - 2 ))`; do
|
||||
for aid in `seq 0 $(( $NRAGENTS - 1 ))`; do
|
||||
port=$(( $BASE + $aid ))
|
||||
build/bin/arangod \
|
||||
-c none \
|
||||
--agency.endpoint tcp://localhost:5001 \
|
||||
--agency.activate true \
|
||||
--agency.size $NRAGENTS \
|
||||
--agency.pool-size $POOLSZ \
|
||||
|
@ -61,32 +62,6 @@ if [ $NRAGENTS -gt 1 ]; then
|
|||
> agency/$port.stdout 2>&1 &
|
||||
done
|
||||
fi
|
||||
for aid in `seq 0 $(( $NRAGENTS - 1 ))`; do
|
||||
endpoints="$endpoints --agency.endpoint tcp://localhost:$(( $BASE + $aid ))"
|
||||
done
|
||||
build/bin/arangod \
|
||||
-c none \
|
||||
$endpoints \
|
||||
--agency.activate true \
|
||||
--agency.size $NRAGENTS \
|
||||
--agency.pool-size $POOLSZ \
|
||||
--agency.supervision true \
|
||||
--agency.supervision-frequency $SFRE \
|
||||
--agency.wait-for-sync true \
|
||||
--agency.election-timeout-min $MINP \
|
||||
--agency.election-timeout-max $MAXP \
|
||||
--database.directory agency/data$(( $BASE + $aid )) \
|
||||
--javascript.app-path ./js/apps \
|
||||
--javascript.startup-directory ./js \
|
||||
--javascript.v8-contexts 1 \
|
||||
--log.file agency/$(( $BASE + $aid )).log \
|
||||
--server.authentication false \
|
||||
--server.endpoint tcp://0.0.0.0:$(( $BASE + $aid )) \
|
||||
--server.statistics false \
|
||||
--agency.compaction-step-size $COMP \
|
||||
--log.level agency=debug \
|
||||
--log.force-direct true \
|
||||
> agency/$(( $BASE + $aid )).stdout 2>&1 &
|
||||
|
||||
echo " done."
|
||||
echo "Your agents are ready at port $BASE onward"
|
||||
|
|
Loading…
Reference in New Issue